Skip to content
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

[BUG] Duplication between Azure.Core.Http spans and HTTP client ones #37446

Open
lmolkova opened this issue Jul 6, 2023 · 2 comments
Open

[BUG] Duplication between Azure.Core.Http spans and HTTP client ones #37446

lmolkova opened this issue Jul 6, 2023 · 2 comments
Assignees
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library. OpenTelemetry OpenTelemetry instrumentation (not Monitor-specific)

Comments

@lmolkova
Copy link
Member

lmolkova commented Jul 6, 2023

Library name and version

Azure.Core

Describe the bug

When OTel is configured to collect HTTP spans and Azure SDK spans, we report 2 spans for each HTTP call.

Azure SDK spans are 'better' because:

  • we report additional information such as x-ms-*request-id values that are used by AzMon to correlate with server-side telemetry
  • we can report precise duration including stream reading, retry number and other information generic instrumentation can't
  • we work consistently on new and old .NET versions

So, we need to find a way to suppress native HTTP client spans.

The problem is not unique to Azure SDK, but there is no otel-wide story for it (open-telemetry/opentelemetry-specification#1767) and each language has its own way to suppress duplicates.

Here's the issue tracking it on OTel .NET side
open-telemetry/opentelemetry-dotnet#4641

Expected behavior

Only one span is created per HTTP call

Actual behavior

two spans are created per http call

Reproduction Steps

https://devblogs.microsoft.com/azure-sdk/introducing-experimental-opentelemetry-support-in-the-azure-sdk-for-net/ with latest otel

Environment

No response

@github-actions github-actions bot added Azure.Core Client This issue points to a problem in the data-plane of the library. needs-team-triage Workflow: This issue needs the team to triage. labels Jul 6, 2023
@lmolkova
Copy link
Member Author

lmolkova commented Jul 6, 2023

A temporary alternative to open-telemetry/opentelemetry-dotnet#4641 could be using reflection to access OpenTelemetry.SuppressInstrumentationScope helper.

This would increase the number of AOT warnings, but none of the tracing things work with AOT anyway.

@lmolkova
Copy link
Member Author

lmolkova commented Jul 6, 2023

related: #35572, #29955

@lmolkova lmolkova changed the title [BUG] Duplication between Azure.Core.Http spans and native HTTP ones [BUG] Duplication between Azure.Core.Http spans and HTTP client ones Jul 6, 2023
@lmolkova lmolkova added OpenTelemetry OpenTelemetry instrumentation (not Monitor-specific) and removed needs-team-triage Workflow: This issue needs the team to triage. labels Jul 6, 2023
@lmolkova lmolkova mentioned this issue Oct 20, 2023
10 tasks
@lmolkova lmolkova self-assigned this Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library. OpenTelemetry OpenTelemetry instrumentation (not Monitor-specific)
Projects
None yet
Development

No branches or pull requests

1 participant