Skip to content

Populate measurements on telemetry from the microsoft.custom_measurements attribute - #48750

Open
Radhika Gupta (rads-1996) wants to merge 5 commits into
Azure:mainfrom
rads-1996:custom-measurements
Open

Populate measurements on telemetry from the microsoft.custom_measurements attribute#48750
Radhika Gupta (rads-1996) wants to merge 5 commits into
Azure:mainfrom
rads-1996:custom-measurements

Conversation

@rads-1996

Copy link
Copy Markdown
Member

Description

This PR implements the spec - https://github.com/aep-health-and-standards/Telemetry-Collection-Spec/pull/887

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.

@github-actions github-actions Bot added the Monitor - Exporter Monitor OpenTelemetry Exporter label Aug 25, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
9 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds support for mapping microsoft.custom_measurements attributes into Azure Monitor telemetry measurements.

Changes:

  • Parses and validates custom measurements.
  • Applies measurements to trace and log telemetry.
  • Adds coverage and changelog documentation.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
CHANGELOG.md Documents the feature.
_constants.py Defines the reserved attribute name.
_utils.py Parses and filters measurements.
export/trace/_exporter.py Adds measurements to trace telemetry.
export/logs/_exporter.py Adds measurements to log telemetry.
tests/test_utils.py Tests parsing and validation.
tests/trace/test_trace.py Tests trace conversion.
tests/logs/test_logs.py Tests log conversion.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
9 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings August 26, 2026 17:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

## 1.0.0b57 (Unreleased)

### Features Added
- Populate `measurements` on telemetry from the `microsoft.custom_measurements` attribute

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should add some sample code in the exporter project sending these, so customers only relying on this one can get some information about it

return processed_measurements
if not isinstance(value, Mapping):
return processed_measurements
for key, val in value.items():

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are measurements always key value pairs?, I thought we had some serialization in place for those here in azure sdk core dependency, not sure if that can be used, but it would be good to understand that part

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.

3 participants