Skip to content

Allow metric telemetry properties to be set - #3251

Merged
Matthew Sainsbury (Microsoft) (mattsains-msft) merged 3 commits into
microsoft:mainfrom
mattsains-msft:3243
Nov 19, 2026
Merged

Matthew Sainsbury (Microsoft) (mattsains-msft) merged 3 commits into
microsoft:mainfrom
mattsains-msft:3243

Conversation

@mattsains-msft

Copy link
Copy Markdown
Member

Fix Issue #3243

Changes

Initializes the Properties object of the MetricTelemetry class so that users can set metric telemetry properties.

Checklist

  • I ran Unit Tests locally.
  • CHANGELOG.md updated with one line description of the fix, and a link to the original issue if available.

For significant contributions please make sure you have completed the following items:

  • Design discussion issue #
  • Changes in public surface reviewed

The PR will trigger build, unit tests, and functional tests automatically. Please follow these instructions to build and test locally.

Notes for authors:

  • FxCop and other analyzers will fail the build. To see these errors yourself, compile localy using the Release configuration.

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.

🟢 Approval recommended

No active review issues are reported for the change initializing metric properties so callers can add custom values.

No open issues 🎉

What changed in this PR

Fixes issue #3243 by initializing MetricTelemetry.Properties, allowing SDK users to add custom metric properties instead of encountering a null dictionary.

Changes:

  • Initializes an empty Dictionary<string, string> in the metric constructor.
File Description
BASE/​src/​Microsoft.ApplicationInsights/​DataContracts/​MetricTelemetry.cs Initializes the metric properties dictionary so callers can populate it.

Review effort: Balanced

@mattsains-msft
Matthew Sainsbury (Microsoft) (mattsains-msft) merged commit 5dc3242 into microsoft:main Nov 19, 2026
20 checks passed
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.

3 participants