Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 19, 2025

Description

Implements export of Activity.StatusDescription as a custom property otel.status_description in telemetry sent to Azure Monitor, addressing the gap where status descriptions set via Activity.SetStatus(statusCode, description) were being ignored.

Changes

  • RequestData.cs and RemoteDependencyData.cs: Added conditional export of Activity.StatusDescription as custom property when present
  • Tests: Added coverage for both presence and absence of status descriptions in RequestData and RemoteDependencyData

The property key follows OpenTelemetry semantic conventions and leverages existing truncation/validation logic.

Example Usage

using var activity = activitySource.StartActivity("MyOperation", ActivityKind.Server);
activity.SetStatus(ActivityStatusCode.Error, "Request failed due to timeout");
// StatusDescription now exported to Azure Monitor as otel.status_description

This checklist is used to make sure that common guidelines for a pull request are followed.

General Guidelines

  • 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.

SDK Generation Guidelines

  • If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.
  • The generate.cmd file for the SDK has been updated with the version of AutoRest, as well as the commitid of your swagger spec or link to the swagger spec, used to generate the code.
  • The *.csproj and AssemblyInfo.cs files have been updated with the new version of the SDK.
Original prompt

This section details on the original issue you should resolve

<issue_title>[FEATURE REQ] Support Activity.StatusDescription in Exporter</issue_title>
<issue_description>### Library name

Azure.Monitor.OpenTelemetry.Exporter

Please describe the feature.

Support exporting Activity.StatusDescription as a custom property otel.status_description in telemetry.

OpenTelemetry suggest using Activity.SetStatus() to set status of trace. (https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/src/OpenTelemetry.Api/README.md#setting-status)
Currently the Exporter can use Activity.Status to determine the Success field, but the Activity.StatusDescription is totally ignored. The information of status description is missing in Azure telemetry. One possible way to keep this information would be adding custom property otel.status_description which matches the sematic convention of OpenTelemetry.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…ription custom property

Co-authored-by: rajkumar-rangaraj <[email protected]>
Copilot AI changed the title [WIP] Add activity status description support in exporter Export Activity.StatusDescription as otel.status_description custom property Nov 19, 2025
Copilot finished work on behalf of rajkumar-rangaraj November 19, 2025 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE REQ] Support Activity.StatusDescription in Exporter

2 participants