-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[Monitor Opentelemetry] Duplicated dependencies span when enabling azure-sdk + http instrumentation #31694
Comments
@Apokalypt while exclusive behavior is not automatic when instrumenting with the http instrumentation yet, you can use the |
For the moment we've decided to keep the traces even if we have duplicated HTTP calls, because the other spans are quite useful. But, anyway, thanks for the tip Can we expect an implementation of something that avoids this in the near future or not? |
@Apokalypt if you're looking to keep the parent Azure tracing spans, but not duplicate the spans from the http-instrumentation, you should be able to use the As for automatic detection, I'll investigate. |
I didn't know about this parameter, but it doesn't suit us anyway, so we'll stick with duplicate traces for now. In fact, our configuration of the http-instrumentation library is not the default because we needed to add certain headers to the span and ignore others. Therefore, we don't want to remove traces/spans generated by this library As for automatic detection, if this is not possible, we should at least be able to configure/customize the behavior, just as the http-instrumentation library does ( documentation ) This would certainly be easier to implement, and would also make it easier to let developers choose what span they want generated by Azure libraries. |
@Apokalypt I'm a bit confused then. From your issue your goal appears to be disabling the duplicate http instrumentation traces coming from the Azure SDK's automatic tracking. Brining your own configuration of the OpenTelemetry http-instrumentation should be fine assuming you use that instrumentation configured to your liking + the Azure Monitor OpenTelemetry distro with the above environment variable enabled. |
@JacksonWeber Well, I'll try to rephrase to make sure everything's clear. The problem is that if you enable both HTTP and Azure instrumentation, you get duplicate traces for each HTTP call. So we'd like a solution that avoids this duplication (while preserving the other traces generated by the Azure instrumentation library, e.g. SecretClient.getSecret from my screen), while preserving the additional data we add to the HTTP traces generated by the “http-instrumentation” package (e.g. rate limit headers from response).
On the other hand, what I meant in my previous message was that we'll adapt to whatever solution is proposed by azure instrumentation package. I'm thinking of the following solutions:
const { useAzureMonitor } = require('@azure/monitor-opentelemetry')
useAzureMonitor({
instrumentationOptions: {
http: { enabled: true, ...customHttpInstrumentationOptions },
azureSdk: { enabled: true, generateHttpTraces: false }
}
})
|
Describe the bug
Since the migration to OpenTelemetry with
@azure/opentelemetry-instrumentation-azure-sdk
+@opentelemetry/instrumentation-http
we are seing duplicated span when an HTTP call is emitted from an azure SDK libraries :@azure/core-rest-pipeline
@opentelemetry/instrumentation-http
which offer better customisation for outgoing request (ignore or not, custom attributes from headers, .......)To Reproduce
Steps to reproduce the behavior:
Expected behavior
Only one span should be created for an HTTP call even if he the request goes through the tracing policy. For that there is different possibilities :
@opentelemetry/instrumentation-http
is enabled@azure/opentelemetry-instrumentation-azure-sdk
should expose options to indicate if HTTP calls should be tracked or not@opentelemetry/instrumentation-http
in terms of property/status/... If that's the case we can easily ignore request emitted from Azure SDK libraries while being able to keep all features (custom span attributes, ignore some requests, ....)Screenshots
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: