Aspire.Confluent.Kafka does not emit metrics on ConsumeException
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Describe the bug
When using `Aspire.Confluent.Kafka` client to consume events, and a `ConsumeException` is encountered, no `messaging.receive.duration` and `messaging.receive.messages` metrics are generated.
This bug is the same as `opentelemetry-dotnet-contrib` Issue [#4400](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/issues/4400) which was already fixed. The fix is available in `OpenTelemetry.Instrumentation.ConfluentKafka` version `0.1.0-alpha.7`.
`Aspire.Confluent.Kafka` duplicates `OpenTelemetry.Instrumentation.ConfluentKafka` code in https://github.com/microsoft/aspire/tree/main/src/Vendoring/OpenTelemetry.Instrumentation.ConfluentKafka.
And so, to fix the bug when using `Aspire.Confluent.Kafka` client, the files in the said folder must be updated to the latest version.
### Expected Behavior
When using `Aspire.Confluent.Kafka` client to consume events, error scenarios should emit metrics (with `error.type`) for failed consume attempts, just as they do for successful ones, so failure data is visible in telemetry.
### Steps To Reproduce
Project: https://github.com/jacintodj18/aspire-confluent-kafka-issue-17655
### Exceptions (if any)
No exceptions encountered.
### Aspire doctor output
_No response_
### Anything else?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.