Skip to content

Conversation

@rajkumar-rangaraj
Copy link
Contributor

Description

Added support for Microsoft-specific override attributes to preserve exact Application Insights semantics when exporting telemetry data. These attributes allow the exporter to use the precise values from Application Insights telemetry instead of computing them from OpenTelemetry semantic conventions.

Changes

  • Added new semantic convention constants for Microsoft override attributes:
    • Request attributes: microsoft.request.name, microsoft.request.url, microsoft.request.source, microsoft.request.resultCode
    • Dependency attributes: microsoft.dependency.type, microsoft.dependency.target, microsoft.dependency.name, microsoft.dependency.data, microsoft.dependency.resultCode
    • Operation attribute: microsoft.operation_name
  • Updated ActivityTagsProcessor to recognize and process Microsoft override attributes
  • Modified RemoteDependencyData, RequestData model to use override attributes when available
  • Ensures backward compatibility with existing Application Insights instrumentation

Motivation

The Application Insights SDK generates activities with specific telemetry values that may differ from standard OpenTelemetry semantic conventions. These override attributes ensure that when the SDK transitions to OpenTelemetry-based instrumentation, the exact Application Insights semantics are preserved for compatibility with existing monitoring dashboards and queries.

Testing

  • Existing unit tests pass
  • Integration tests verify override attributes are correctly consumed by the exporter

Copilot AI review requested due to automatic review settings November 18, 2025 22:35
@github-actions github-actions bot added the Monitor - Exporter Monitor OpenTelemetry Exporter label Nov 18, 2025
Copilot finished reviewing on behalf of rajkumar-rangaraj November 18, 2025 22:41
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

This PR adds Microsoft-specific override attributes to enable Application Insights SDK to preserve exact telemetry semantics when transitioning to OpenTelemetry-based instrumentation. The changes introduce new semantic convention constants for request and dependency override attributes, update the activity processor to recognize them, and modify telemetry data models to apply these overrides with precedence over computed values from standard OpenTelemetry conventions.

Key changes:

  • Introduced 10 new Microsoft override attribute constants in SemanticConventions.cs for requests, dependencies, and operations
  • Fixed a bug in AzMonList.GetTagValue() changing from ReferenceEquals to proper string comparison
  • Modified RequestData and RemoteDependencyData constructors to check for and apply override attributes when present
  • Added comprehensive test coverage for override attribute functionality

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
SemanticConventions.cs Adds 10 new Microsoft override attribute constants with documentation; has inconsistent visibility modifiers between attributes
ActivityTagsProcessor.cs Adds override attributes to semantics list and introduces HasOverrideAttributes flag for optimization
AzMonList.cs Fixes string comparison bug by changing from ReferenceEquals to string.Equals with ordinal comparison
RequestData.cs Adds override attribute processing logic, but implementation has a critical bug where TraceHelper will overwrite the Name field
RemoteDependencyData.cs Adds override attribute processing with correct precedence; changes Azure namespace Type behavior
RequestDataTests.cs Adds comprehensive tests for request overrides, but tests don't reflect actual production code path through TraceHelper
RemoteDependencyDataTests.cs Adds comprehensive tests for dependency overrides with proper coverage of different dependency types

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

Labels

Monitor - Exporter Monitor OpenTelemetry Exporter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant