Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes an IllegalArgumentException is thrown while registering metrics in PrometheusMeterRegistry #92

Open
fhussonnois opened this issue Jun 25, 2020 · 0 comments
Labels
in:metrics This issue should impact the azkarra-metrics module

Comments

@fhussonnois
Copy link
Member

fhussonnois commented Jun 25, 2020

This issue was reported on slack channel. It appears that this issue does not consistently happens.

Versions :

  • azkarra-streams/azkarra-worker : 0.7.3
  • Micrometer : 1.5.0

Stacktrace

java.lang.IllegalArgumentException: Prometheus requires that all meters with the same name have the same set of tag keys. There is already an existing meter named 'kafka_consumer_fetch_manager_bytes_consumed_total' containing tag keys [application_id, client_id, kafka_version]. The meter you are attempting to register has keys [application_id, client_id, kafka_version, topic].
      at io.micrometer.prometheus.PrometheusMeterRegistry.lambda$applyToCollector$17(PrometheusMeterRegistry.java:429) ~[micrometer-registry-prometheus-1.5.0.jar:1.5.0]
      at java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1932) ~[?:?]
      at io.micrometer.prometheus.PrometheusMeterRegistry.applyToCollector(PrometheusMeterRegistry.java:413) ~[micrometer-registry-prometheus-1.5.0.jar:1.5.0]
      at io.micrometer.prometheus.PrometheusMeterRegistry.newFunctionCounter(PrometheusMeterRegistry.java:247) ~[micrometer-registry-prometheus-1.5.0.jar:1.5.0]
      at io.micrometer.core.instrument.MeterRegistry$More.lambda$counter$1(MeterRegistry.java:884) ~[micrometer-core-1.5.0.jar:1.5.0]
      at io.micrometer.core.instrument.MeterRegistry.lambda$registerMeterIfNecessary$5(MeterRegistry.java:559) ~[micrometer-core-1.5.0.jar:1.5.0]
      at io.micrometer.core.instrument.MeterRegistry.getOrCreateMeter(MeterRegistry.java:612) ~[micrometer-core-1.5.0.jar:1.5.0]
      at io.micrometer.core.instrument.MeterRegistry.registerMeterIfNecessary(MeterRegistry.java:566) ~[micrometer-core-1.5.0.jar:1.5.0]
      at io.micrometer.core.instrument.MeterRegistry.registerMeterIfNecessary(MeterRegistry.java:559) ~[micrometer-core-1.5.0.jar:1.5.0]
      at io.micrometer.core.instrument.MeterRegistry.access$600(MeterRegistry.java:76) ~[micrometer-core-1.5.0.jar:1.5.0]
      at io.micrometer.core.instrument.MeterRegistry$More.counter(MeterRegistry.java:884) ~[micrometer-core-1.5.0.jar:1.5.0]
      at io.micrometer.core.instrument.FunctionCounter$Builder.register(FunctionCounter.java:122) ~[micrometer-core-1.5.0.jar:1.5.0]
      at io.micrometer.core.instrument.composite.CompositeFunctionCounter.registerNewMeter(CompositeFunctionCounter.java:58) ~[micrometer-core-1.5.0.jar:1.5.0]
      at io.micrometer.core.instrument.composite.CompositeFunctionCounter.registerNewMeter(CompositeFunctionCounter.java:26) ~[micrometer-core-1.5.0.jar:1.5.0]
      at io.micrometer.core.instrument.composite.AbstractCompositeMeter.add(AbstractCompositeMeter.java:66) ~[micrometer-core-1.5.0.jar:1.5.0]
      at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
      at java.util.Collections$SetFromMap.forEach(Collections.java:5581) ~[?:?]
      at io.micrometer.core.instrument.composite.CompositeMeterRegistry.lambda$new$0(CompositeMeterRegistry.java:65) ~[micrometer-core-1.5.0.jar:1.5.0]
      at io.micrometer.core.instrument.composite.CompositeMeterRegistry.lock(CompositeMeterRegistry.java:184) ~[micrometer-core-1.5.0.jar:1.5.0]
      at io.micrometer.core.instrument.composite.CompositeMeterRegistry.lambda$new$1(CompositeMeterRegistry.java:65) ~[micrometer-core-1.5.0.jar:1.5.0]
      at io.micrometer.core.instrument.MeterRegistry.getOrCreateMeter(MeterRegistry.java:622) ~[micrometer-core-1.5.0.jar:1.5.0]
      at io.micrometer.core.instrument.MeterRegistry.registerMeterIfNecessary(MeterRegistry.java:566) ~[micrometer-core-1.5.0.jar:1.5.0]
      at io.micrometer.core.instrument.MeterRegistry.registerMeterIfNecessary(MeterRegistry.java:559) ~[micrometer-core-1.5.0.jar:1.5.0]
      at io.micrometer.core.instrument.MeterRegistry.access$600(MeterRegistry.java:76) ~[micrometer-core-1.5.0.jar:1.5.0]
      at io.micrometer.core.instrument.MeterRegistry$More.counter(MeterRegistry.java:884) ~[micrometer-core-1.5.0.jar:1.5.0]
      at io.micrometer.core.instrument.FunctionCounter$Builder.register(FunctionCounter.java:122) ~[micrometer-core-1.5.0.jar:1.5.0]
      at io.micrometer.core.instrument.binder.kafka.KafkaMetrics.registerCounter(KafkaMetrics.java:189) ~[micrometer-core-1.5.0.jar:1.5.0]
      at io.micrometer.core.instrument.binder.kafka.KafkaMetrics.bindMeter(KafkaMetrics.java:174) ~[micrometer-core-1.5.0.jar:1.5.0]
      at io.micrometer.core.instrument.binder.kafka.KafkaMetrics.lambda$checkAndBindMetrics$1(KafkaMetrics.java:161) ~[micrometer-core-1.5.0.jar:1.5.0]
      at java.util.LinkedHashMap.forEach(LinkedHashMap.java:684) ~[?:?]
      at java.util.Collections$UnmodifiableMap.forEach(Collections.java:1505) ~[?:?]
      at io.micrometer.core.instrument.binder.kafka.KafkaMetrics.checkAndBindMetrics(KafkaMetrics.java:137) ~[micrometer-core-1.5.0.jar:1.5.0]
      at io.micrometer.core.instrument.binder.kafka.KafkaMetrics.bindTo(KafkaMetrics.java:93) ~[micrometer-core-1.5.0.jar:1.5.0]
      at io.micrometer.core.instrument.binder.kafka.KafkaStreamsMetrics.bindTo(KafkaStreamsMetrics.java:35) ~[micrometer-core-1.5.0.jar:1.5.0]
      at io.streamthoughts.azkarra.metrics.interceptor.MeterKafkaStreamsInterceptor$1.onChange(MeterKafkaStreamsInterceptor.java:83) ~[azkarra-metrics-0.7.3.jar:?]
      at io.streamthoughts.azkarra.api.streams.KafkaStreamsContainer.stateChanges(KafkaStreamsContainer.java:554) ~[azkarra-api-0.7.3.jar:?]
      at io.streamthoughts.azkarra.api.streams.KafkaStreamContainerBuilder$InternalKafkaStreamsFactory.lambda$make$1(KafkaStreamContainerBuilder.java:162) ~[azkarra-api-0.7.3.jar:?]
      at io.streamthoughts.azkarra.api.streams.listener.CompositeStateListener.onChange(CompositeStateListener.java:70) [azkarra-api-0.7.3.jar:?]
      at org.apache.kafka.streams.KafkaStreams.setState(KafkaStreams.java:293) [kafka-streams-2.5.0.jar:?]
      at org.apache.kafka.streams.KafkaStreams.access$000(KafkaStreams.java:139) [kafka-streams-2.5.0.jar:?]
      at org.apache.kafka.streams.KafkaStreams$StreamStateListener.maybeSetRunning(KafkaStreams.java:466) [kafka-streams-2.5.0.jar:?]
      at org.apache.kafka.streams.KafkaStreams$StreamStateListener.onChange(KafkaStreams.java:483) [kafka-streams-2.5.0.jar:?]
      at org.apache.kafka.streams.processor.internals.StreamThread.setState(StreamThread.java:233) [kafka-streams-2.5.0.jar:?]
      at org.apache.kafka.streams.processor.internals.StreamThread.runOnce(StreamThread.java:780) [kafka-streams-2.5.0.jar:?]
      at org.apache.kafka.streams.processor.internals.StreamThread.runLoop(StreamThread.java:697) [kafka-streams-2.5.0.jar:?]
      at org.apache.kafka.streams.processor.internals.StreamThread.run(StreamThread.java:670) [kafka-streams-2.5.0.jar:?]
@fhussonnois fhussonnois added the in:metrics This issue should impact the azkarra-metrics module label Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in:metrics This issue should impact the azkarra-metrics module
Projects
None yet
Development

No branches or pull requests

1 participant