Azure / azure-sdk-for-java

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

Open heyams opened 2 months ago

heyams commented 2 months ago

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.

public static void addAfterRetryPolicies(List<HttpPipelinePolicy> policies) {
        policies.add(new InstrumentationPolicy());
        addPolices(policies, AFTER_PROVIDER);
}

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.

github-actions[bot] commented 2 months ago

Thank you for your feedback. Tagging and routing to the team member best able to assist.

lmolkova commented 2 months ago

Context:

Solutions: