-
Notifications
You must be signed in to change notification settings - Fork 945
[Kafka instrumentation] "Instrument has recorded multiple values for the same attributes" with version 2.7.0 #12199
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
Comments
Actually, our application has multiple consumers (to different topics/brokers). This may be related. Is there maybe a specific label that should be defined for each consumer, if so from what is it supposed to be derived? |
From the changelog, the only thing that pops to my eyes that may be related is #11975 🤷 |
This happens when a metric with given name is reported multiple times with the same attributes. If you create multiple consumers/producers from the same configuration then they will end up reporting exactly the same metrics. Form the log you pasted they all have
By default agent logs to stderr. For some applications it may be possible to redirect agent logs to application logging framework, see https://opentelemetry.io/docs/zero-code/java/agent/configuration/#java-agent-logging-output |
Thanks @laurit . I confirm that using different client ids does work. I'm fine with that in my current use case. But on the other hand, I think it's a valid Kafka setup: you can have 2 consumers with the same client id (as part of the same client/application instance), each one subscribed to a different topic ; or even more valid: they can belong to 2 different consumer groups. |
@laurit we are seeing this a lot with applications with more then one consumer, would you mind detailing how one can set a different client to suppress this error or how to turn of the metrics in question if we can not find a sufficient workaround? |
Describe the bug
When upgrading from
opentelemetry-instrumentation-bom-alpha
version 2.6.0 to 2.7.0, we encounter a lot of WARN messages like the following:And at some point it even says:
Steps to reproduce
I don't have a reproduction repository for now but I may provide one later if needed.
On our side, this happens with an application that has a very basic Kafka consumer, automatic instrumentation using the java agent and the following OTEL config:
This happens with kafka-clients library 3.7.1 and 3.8.0 (we didn't test previous versions). Seems unrelated to the kafka client library.
Expected behavior
No such warnings.
Moreover these logs are sent to stdout (
/var/log/messages
in our case) for some reason instead of being sent to the logging library. I'm not sure if this is expected and/or related.Actual behavior
Continuous warning logs.
Javaagent or library instrumentation version
2.7.0
Environment
JDK: 17.0.12
OS: Linux (AlmaLinux release 8.10)
Additional context
No response
The text was updated successfully, but these errors were encountered: