Search in sources :

Example 1 with MetricsConfig

use of io.strimzi.api.kafka.model.MetricsConfig in project strimzi by strimzi.

the class KafkaMirrorMakerClusterTest method testMetricsParsingFromConfigMap.

@ParallelTest
public void testMetricsParsingFromConfigMap() {
    MetricsConfig metrics = new JmxPrometheusExporterMetricsBuilder().withNewValueFrom().withConfigMapKeyRef(new ConfigMapKeySelectorBuilder().withName("my-metrics-configuration").withKey("config.yaml").build()).endValueFrom().build();
    KafkaMirrorMaker mirrorMaker = new KafkaMirrorMakerBuilder(this.resource).editSpec().withMetricsConfig(metrics).endSpec().build();
    KafkaMirrorMakerCluster kmm = KafkaMirrorMakerCluster.fromCrd(Reconciliation.DUMMY_RECONCILIATION, mirrorMaker, VERSIONS);
    assertThat(kmm.isMetricsEnabled(), is(true));
    assertThat(kmm.getMetricsConfigInCm(), is(metrics));
}
Also used : KafkaMirrorMakerBuilder(io.strimzi.api.kafka.model.KafkaMirrorMakerBuilder) JmxPrometheusExporterMetricsBuilder(io.strimzi.api.kafka.model.JmxPrometheusExporterMetricsBuilder) ConfigMapKeySelectorBuilder(io.fabric8.kubernetes.api.model.ConfigMapKeySelectorBuilder) MetricsConfig(io.strimzi.api.kafka.model.MetricsConfig) KafkaMirrorMaker(io.strimzi.api.kafka.model.KafkaMirrorMaker) ParallelTest(io.strimzi.test.annotations.ParallelTest)

Example 2 with MetricsConfig

use of io.strimzi.api.kafka.model.MetricsConfig in project strimzi by strimzi.

the class ZookeeperClusterTest method testMetricsParsingFromConfigMap.

@ParallelTest
public void testMetricsParsingFromConfigMap() {
    MetricsConfig metrics = new JmxPrometheusExporterMetricsBuilder().withNewValueFrom().withConfigMapKeyRef(new ConfigMapKeySelectorBuilder().withName("my-metrics-configuration").withKey("config.yaml").build()).endValueFrom().build();
    Kafka kafkaAssembly = new KafkaBuilder(ResourceUtils.createKafka(namespace, cluster, replicas, image, healthDelay, healthTimeout)).editSpec().editZookeeper().withMetricsConfig(metrics).endZookeeper().endSpec().build();
    ZookeeperCluster zc = ZookeeperCluster.fromCrd(Reconciliation.DUMMY_RECONCILIATION, kafkaAssembly, VERSIONS);
    assertThat(zc.isMetricsEnabled(), is(true));
    assertThat(zc.getMetricsConfigInCm(), is(metrics));
}
Also used : JmxPrometheusExporterMetricsBuilder(io.strimzi.api.kafka.model.JmxPrometheusExporterMetricsBuilder) ConfigMapKeySelectorBuilder(io.fabric8.kubernetes.api.model.ConfigMapKeySelectorBuilder) Kafka(io.strimzi.api.kafka.model.Kafka) KafkaBuilder(io.strimzi.api.kafka.model.KafkaBuilder) MetricsConfig(io.strimzi.api.kafka.model.MetricsConfig) ParallelTest(io.strimzi.test.annotations.ParallelTest)

Example 3 with MetricsConfig

use of io.strimzi.api.kafka.model.MetricsConfig in project strimzi by strimzi.

the class KafkaClusterTest method testMetricsParsingFromConfigMap.

@ParallelTest
public void testMetricsParsingFromConfigMap() {
    MetricsConfig metrics = new JmxPrometheusExporterMetricsBuilder().withNewValueFrom().withConfigMapKeyRef(new ConfigMapKeySelectorBuilder().withName("my-metrics-configuration").withKey("config.yaml").build()).endValueFrom().build();
    Kafka kafkaAssembly = new KafkaBuilder(ResourceUtils.createKafka(namespace, cluster, replicas, image, healthDelay, healthTimeout)).editSpec().editKafka().withMetricsConfig(metrics).endKafka().endSpec().build();
    KafkaCluster kc = KafkaCluster.fromCrd(Reconciliation.DUMMY_RECONCILIATION, kafkaAssembly, VERSIONS);
    assertThat(kc.isMetricsEnabled(), is(true));
    assertThat(kc.getMetricsConfigInCm(), is(metrics));
}
Also used : JmxPrometheusExporterMetricsBuilder(io.strimzi.api.kafka.model.JmxPrometheusExporterMetricsBuilder) ConfigMapKeySelectorBuilder(io.fabric8.kubernetes.api.model.ConfigMapKeySelectorBuilder) Kafka(io.strimzi.api.kafka.model.Kafka) KafkaBuilder(io.strimzi.api.kafka.model.KafkaBuilder) MetricsConfig(io.strimzi.api.kafka.model.MetricsConfig) ParallelTest(io.strimzi.test.annotations.ParallelTest)

Example 4 with MetricsConfig

use of io.strimzi.api.kafka.model.MetricsConfig in project strimzi-kafka-operator by strimzi.

the class CruiseControlTest method testMetricsParsingFromConfigMap.

@ParallelTest
public void testMetricsParsingFromConfigMap() {
    MetricsConfig metrics = new JmxPrometheusExporterMetricsBuilder().withNewValueFrom().withConfigMapKeyRef(new ConfigMapKeySelectorBuilder().withName("my-metrics-configuration").withKey("config.yaml").build()).endValueFrom().build();
    CruiseControlSpec cruiseControlSpec = new CruiseControlSpecBuilder().withMetricsConfig(metrics).build();
    Kafka kafkaAssembly = createKafka(cruiseControlSpec);
    CruiseControl cc = createCruiseControl(kafkaAssembly);
    assertThat(cc.isMetricsEnabled(), is(true));
    assertThat(cc.getMetricsConfigInCm(), is(metrics));
}
Also used : CruiseControlSpec(io.strimzi.api.kafka.model.CruiseControlSpec) JmxPrometheusExporterMetricsBuilder(io.strimzi.api.kafka.model.JmxPrometheusExporterMetricsBuilder) ConfigMapKeySelectorBuilder(io.fabric8.kubernetes.api.model.ConfigMapKeySelectorBuilder) Kafka(io.strimzi.api.kafka.model.Kafka) CruiseControlSpecBuilder(io.strimzi.api.kafka.model.CruiseControlSpecBuilder) MetricsConfig(io.strimzi.api.kafka.model.MetricsConfig) ParallelTest(io.strimzi.test.annotations.ParallelTest)

Example 5 with MetricsConfig

use of io.strimzi.api.kafka.model.MetricsConfig in project strimzi-kafka-operator by strimzi.

the class KafkaConnectClusterTest method testMetricsParsingFromConfigMap.

@ParallelTest
public void testMetricsParsingFromConfigMap() {
    MetricsConfig metrics = new JmxPrometheusExporterMetricsBuilder().withNewValueFrom().withConfigMapKeyRef(new ConfigMapKeySelectorBuilder().withName("my-metrics-configuration").withKey("config.yaml").build()).endValueFrom().build();
    KafkaConnect kafkaConnect = new KafkaConnectBuilder(this.resource).editSpec().withMetricsConfig(metrics).endSpec().build();
    KafkaConnectCluster kc = KafkaConnectCluster.fromCrd(Reconciliation.DUMMY_RECONCILIATION, kafkaConnect, VERSIONS);
    assertThat(kc.isMetricsEnabled(), is(true));
    assertThat(kc.getMetricsConfigInCm(), is(metrics));
}
Also used : KafkaConnectBuilder(io.strimzi.api.kafka.model.KafkaConnectBuilder) JmxPrometheusExporterMetricsBuilder(io.strimzi.api.kafka.model.JmxPrometheusExporterMetricsBuilder) ConfigMapKeySelectorBuilder(io.fabric8.kubernetes.api.model.ConfigMapKeySelectorBuilder) KafkaConnect(io.strimzi.api.kafka.model.KafkaConnect) MetricsConfig(io.strimzi.api.kafka.model.MetricsConfig) ParallelTest(io.strimzi.test.annotations.ParallelTest)

Aggregations

ConfigMapKeySelectorBuilder (io.fabric8.kubernetes.api.model.ConfigMapKeySelectorBuilder)12 JmxPrometheusExporterMetricsBuilder (io.strimzi.api.kafka.model.JmxPrometheusExporterMetricsBuilder)12 MetricsConfig (io.strimzi.api.kafka.model.MetricsConfig)12 ParallelTest (io.strimzi.test.annotations.ParallelTest)12 Kafka (io.strimzi.api.kafka.model.Kafka)6 KafkaBuilder (io.strimzi.api.kafka.model.KafkaBuilder)4 CruiseControlSpec (io.strimzi.api.kafka.model.CruiseControlSpec)2 CruiseControlSpecBuilder (io.strimzi.api.kafka.model.CruiseControlSpecBuilder)2 KafkaConnect (io.strimzi.api.kafka.model.KafkaConnect)2 KafkaConnectBuilder (io.strimzi.api.kafka.model.KafkaConnectBuilder)2 KafkaMirrorMaker (io.strimzi.api.kafka.model.KafkaMirrorMaker)2 KafkaMirrorMaker2 (io.strimzi.api.kafka.model.KafkaMirrorMaker2)2 KafkaMirrorMaker2Builder (io.strimzi.api.kafka.model.KafkaMirrorMaker2Builder)2 KafkaMirrorMakerBuilder (io.strimzi.api.kafka.model.KafkaMirrorMakerBuilder)2