Expose canonical tag names per-metric#6076
Merged
neha-bhargava merged 5 commits intoJun 23, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request introduces a public catalog that exposes, per MSAL OpenTelemetry metric, the set of MSAL-owned (“canonical”) tag keys so consumers can safely filter/enforce known tag schemas without depending on enrichment behavior.
Changes:
- Added new public
Microsoft.Identity.Client.MsalMetricsCatalogwithCanonicalTagsByMetricmapping metric name → canonical tag keys. - Refactored
OtelInstrumentationto use catalog-owned metric name constants and added a DEBUG-only guard to keep emitted tags aligned with the public catalog. - Added unit tests validating catalog internal consistency and validating that emitted MSAL metric tags are declared in the catalog.
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 |
|---|---|
| tests/Microsoft.Identity.Test.Unit/TelemetryTests/OTelInstrumentationTests.cs | Adds tests to validate catalog completeness/consistency and alignment with emitted metrics/tags. |
| src/client/Microsoft.Identity.Client/PublicApi/netstandard2.0/PublicAPI.Unshipped.txt | Declares new public API surface (MsalMetricsCatalog, CanonicalTagsByMetric) for netstandard2.0. |
| src/client/Microsoft.Identity.Client/PublicApi/net8.0/PublicAPI.Unshipped.txt | Declares new public API surface for net8.0. |
| src/client/Microsoft.Identity.Client/PublicApi/net8.0-ios/PublicAPI.Unshipped.txt | Declares new public API surface for net8.0-ios. |
| src/client/Microsoft.Identity.Client/PublicApi/net8.0-android/PublicAPI.Unshipped.txt | Declares new public API surface for net8.0-android. |
| src/client/Microsoft.Identity.Client/PublicApi/net472/PublicAPI.Unshipped.txt | Declares new public API surface for net472. |
| src/client/Microsoft.Identity.Client/PublicApi/net462/PublicAPI.Unshipped.txt | Declares new public API surface for net462. |
| src/client/Microsoft.Identity.Client/Platforms/Features/OpenTelemetry/OtelInstrumentation.cs | Switches metric name constants to MsalMetricsCatalog and adds DEBUG-only catalog alignment assertions for emitted base tags. |
| src/client/Microsoft.Identity.Client/MsalMetricsCatalog.cs | Adds the new public catalog mapping metrics to canonical tag keys with read-only exposure. |
bgavrilMS
reviewed
Jun 22, 2026
bgavrilMS
approved these changes
Jun 22, 2026
bgavrilMS
approved these changes
Jun 22, 2026
Contributor
|
@copilot resolve the merge conflicts in this pull request |
Contributor
Resolved. The only conflicts were in the 6 |
neha-bhargava
approved these changes
Jun 22, 2026
neha-bhargava
approved these changes
Jun 22, 2026
This was referenced Jun 27, 2026
Open
Open
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add public
MsalMetricsCatalog.CanonicalTagsByMetric, mapping each MSAL OpenTelemetry metric to its canonical tag names, so consumers can filter metrics to MSAL's known tags (without enrichment).