This repository is for active development of the Azure SDK for Java. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/java/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-java.
MIT License
2.33k
stars
1.97k
forks
source link
Should azure core add InstrumentationPolicy by default whenever azure core httpclient is used #41100
We have a customer who used azure core http client and tracing failed to work.
The workaround was to add HttpPolicyProviders.addAfterRetryPolicies(policies) to their azure core HttpClient instance.
Then it started working as expected.
Should azure-core handled this automatically? or have a doc somewhere along with azure core HttpClient emphasizing the fact that InstrumentationPolicy is mandatory in order for the instrumentation to work.
original HTTP client instrumentation is suppressed in scope of Azure HttpClient
when a plain client without instrumentation policy is used it suppresses the original client, but does not add instrumentation
we can't add instrumentation policy by default because we don't know at which position it should be; logging policy has to be after it; logging is added explicitly
Solutions:
just document the behavior and ask to call addAfterRetryPolicies
short-term: change how suppression works - needs to react to context set by instr policy
long term: get rid of instrumentation policy alltogether and rely on underlying client instrumentation. Need changes in otel spec.
We have a customer who used azure core http client and tracing failed to work. The workaround was to add
HttpPolicyProviders.addAfterRetryPolicies(policies)
to their azure coreHttpClient
instance. Then it started working as expected.Should azure-core handled this automatically? or have a doc somewhere along with azure core
HttpClient
emphasizing the fact that InstrumentationPolicy is mandatory in order for the instrumentation to work.