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

Kafkaclients v0_11 : enhanced ConsumerConfig : property metric.reporters valued with hundreds of OpenTelemetryMetricsReporter className #8085

Closed
trudyq opened this issue Mar 20, 2023 · 1 comment · Fixed by #8099
Labels
bug Something isn't working

Comments

@trudyq
Copy link

trudyq commented Mar 20, 2023

Describe the bug
For some internal projects still using an old Spring boot version (2.1.3) and old Kafka client version i found, after multiple iterations, enhanced Kafka ConsumerConfigs with the property "metric.reporters" valued with the same value io.opentelemetry.javaagent.shaded.instrumentation.kafka.internal.OpenTelemetryMetricsReporter hundreds of times.

Steps to reproduce
Create multiple consumer based on the same ConsumerConfig

What did you expect to see?

Just one OpenTelemetryMetricsReporter !

metric.reporters = [io.opentelemetry.javaagent.shaded.instrumentation.kafka.internal.OpenTelemetryMetricsReporter]

What did you see instead?

...
bootstrap.servers = [kafka1:9093, kafka2:9093, kafka3:9093]
...
metric.reporters = [io.opentelemetry.javaagent.shaded.instrumentation.kafka.internal.OpenTelemetryMetricsReporter,
 io.opentelemetry.javaagent.shaded.instrumentation.kafka.internal.OpenTelemetryMetricsReporter,
 io.opentelemetry.javaagent.shaded.instrumentation.kafka.internal.OpenTelemetryMetricsReporter,
 io.opentelemetry.javaagent.shaded.instrumentation.kafka.internal.OpenTelemetryMetricsReporter,
... hundred of times ...
 io.opentelemetry.javaagent.shaded.instrumentation.kafka.internal.OpenTelemetryMetricsReporter,
 io.opentelemetry.javaagent.shaded.instrumentation.kafka.internal.OpenTelemetryMetricsReporter,
 io.opentelemetry.javaagent.shaded.instrumentation.kafka.internal.OpenTelemetryMetricsReporter,
 io.opentelemetry.javaagent.shaded.instrumentation.kafka.internal.OpenTelemetryMetricsReporter
]
...

What version are you using?
OpenTelemetry agent 1.20.2
Sprint Boot 2.1.3
Spring-kafka 2.2.2-RELEASE

Additional context
In the code below, the check "Does OpenTelemetryMetricsReporter already exists in the property ?" is missing. So config.merge always add the same value.

https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/release/v1.24.x/instrumentation/kafka/kafka-clients/kafka-clients-0.11/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/kafkaclients/v0_11/KafkaSingletons.java#L74-L77

@trudyq trudyq added the bug Something isn't working label Mar 20, 2023
@trudyq trudyq changed the title Kafkaclients v0_11 : enhanced ConsumerConfig : property metric.reporters with hundreds OpenTelemetryMetricsReporter Kafkaclients v0_11 : enhanced ConsumerConfig : property metric.reporters valued with hundreds of OpenTelemetryMetricsReporter className Mar 21, 2023
@trudyq
Copy link
Author

trudyq commented Mar 23, 2023

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant