Skip to content

Fix usage of deprecated telemetry tags#48187

Open
alzimmermsft wants to merge 1 commit intoAzure:mainfrom
alzimmermsft:DeprecateAzNamespaceUseNewTag
Open

Fix usage of deprecated telemetry tags#48187
alzimmermsft wants to merge 1 commit intoAzure:mainfrom
alzimmermsft:DeprecateAzNamespaceUseNewTag

Conversation

@alzimmermsft
Copy link
Member

Description

Fixes #48068

Updates tag usage of az.namespace to include additional azure.resource_provider.namespace tag, which is the replacement for az.namespace, and same for az.service_request_id to add azure.service.request.id. In both cases, both the deprecated and replacement tags will be included in telemetry to maintain backwards compatibility. Eventually, the deprecated tags will be removed from telemetry.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Azure SDK for Java OpenTelemetry tracing to emit both deprecated and replacement telemetry attributes for Azure namespace and service request ID, maintaining backwards compatibility while aligning with newer OpenTelemetry semantic conventions.

Changes:

  • Updated attribute mapping to duplicate az.namespace -> azure.resource_provider.namespace and az.service_request_id -> azure.service.request.id.
  • Adjusted core tracing + HTTP policy tests to validate presence of both old and new attributes.
  • Updated Service Bus, Event Hubs, and AI Inference tracer tests to assert the new replacement attribute is also present.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/TracingIntegrationTests.java Extends span assertions to validate azure.resource_provider.namespace is emitted alongside az.namespace.
sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/TestSpanProcessor.java Adds assertion for azure.resource_provider.namespace for Event Hubs spans.
sdk/core/azure-core-tracing-opentelemetry/src/test/java/com/azure/core/tracing/opentelemetry/OpenTelemetryTracerTest.java Updates expectations to require both deprecated and replacement attributes across span creation paths.
sdk/core/azure-core-tracing-opentelemetry/src/test/java/com/azure/core/tracing/opentelemetry/OpenTelemetryHttpPolicyTests.java Updates HTTP tracing tests to validate both namespace and service request id attributes, and ensures response bodies are consumed before assertions.
sdk/core/azure-core-tracing-opentelemetry/src/test/java/com/azure/core/tracing/opentelemetry/CreateTracerTests.java Updates tracer-creation tests to validate both namespace attributes are set.
sdk/core/azure-core-tracing-opentelemetry/src/main/java/com/azure/core/tracing/opentelemetry/OpenTelemetryUtils.java Implements key-mapping that duplicates deprecated attributes into their replacements during attribute population.
sdk/core/azure-core-tracing-opentelemetry/src/main/java/com/azure/core/tracing/opentelemetry/OpenTelemetryTracer.java Uses the updated attribute-addition mapping when setting az.namespace so both tags are emitted.
sdk/core/azure-core-tracing-opentelemetry/CHANGELOG.md Documents the addition of the replacement attributes while keeping deprecated ones for now.
sdk/ai/azure-ai-inference/src/test/java/com/azure/ai/inference/ChatCompletionClientTracerTest.java Adds assertion for azure.resource_provider.namespace in AI inference tracing tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[QUERY] Telemetry uses deprecated az.namespace

2 participants