open-telemetry / opentelemetry-java-instrumentation

OpenTelemetry auto-instrumentation and instrumentation libraries for Java
https://opentelemetry.io
Apache License 2.0
1.89k stars 826 forks source link

Azure eventhub client auto instrument requirement #6831

Closed sweetxiaodai closed 1 year ago

sweetxiaodai commented 1 year ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Azure has its own messaging PaaS service called event hub. Microsoft released several client SDK to help developer to consume and produce message to the messaging systems. Is it possible that make otel-java-instrumentation support this SDK library as well? It would be very helpful for the cloud native design.

Describe the solution you'd like A clear and concise description of what you want to happen. Please provide support for this library to auto-instrument the trace from producer to consumer.

<dependency>
    <groupId>com.azure</groupId>
    <artifactId>azure-messaging-eventhubs</artifactId>
    <version>5.7.0</version>
</dependency>

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

trask commented 1 year ago

hi @sweetxiaodai! this should already be supported (https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/azure-core)

sweetxiaodai commented 1 year ago

@trask thanks, just test the feature locally. Just one question. All the send traffic created a trace for each, but the receive spans have been put together in one trace, is it correct? or is there any specific mechanism of azure eventhub? Screenshot 2022-10-08 at 05 29 53

trask commented 1 year ago

hi @sweetxiaodai, I'd recommend opening an issue at https://github.com/Azure/azure-sdk-for-java/issues, and including some example code to show how you are consuming the messages, feel free to tag myself and @lmolkova on the issue in that repository

lmolkova commented 1 year ago

Hi @sweetxiaodai, happy to help you with eventhubs.

We're adding a bunch of improvements for EventHubs tracing - they're coming in the Nov release and solving https://github.com/Azure/azure-sdk-for-java/issues/28559, https://github.com/Azure/azure-sdk-for-java/issues/28552. Here's the WIP PR https://github.com/Azure/azure-sdk-for-java/pull/31197 .

Can you please check if any of these issues apply to your case? If not or if you're not sure, please create an issue in https://github.com/Azure/azure-sdk-for-java/issues as @trask suggested, and please include the following information:

Thanks!