Skip to content

Expose canonical tag names per-metric#6076

Merged
neha-bhargava merged 5 commits into
mainfrom
ssmelov/expose_canonical_tag_names_per_metric
Jun 23, 2026
Merged

Expose canonical tag names per-metric#6076
neha-bhargava merged 5 commits into
mainfrom
ssmelov/expose_canonical_tag_names_per_metric

Conversation

@ssmelov

@ssmelov ssmelov commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

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

Copilot AI review requested due to automatic review settings June 19, 2026 13:43

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

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.MsalMetricsCatalog with CanonicalTagsByMetric mapping metric name → canonical tag keys.
  • Refactored OtelInstrumentation to 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.

@ssmelov ssmelov marked this pull request as ready for review June 22, 2026 07:46
@ssmelov ssmelov requested a review from a team as a code owner June 22, 2026 07:46
Comment thread src/client/Microsoft.Identity.Client/MsalMetricsCatalog.cs Outdated
@neha-bhargava

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Copilot AI commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved. The only conflicts were in the 6 PublicAPI.Unshipped.txt files — the post-release 4.85.0 commit had moved 5 previously unshipped entries into Shipped.txt, leaving Unshipped.txt empty. I kept only the 2 new MsalMetricsCatalog entries (commit 77d7ef9).

Copilot AI review requested due to automatic review settings June 22, 2026 19:45

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 9 out of 9 changed files in this pull request and generated 3 comments.

Comment thread src/client/Microsoft.Identity.Client/Extensibility/MsalMetricsCatalog.cs Outdated
@neha-bhargava neha-bhargava enabled auto-merge (squash) June 22, 2026 20:49
@neha-bhargava neha-bhargava disabled auto-merge June 22, 2026 20:49
Copilot AI review requested due to automatic review settings June 22, 2026 22:27
This was referenced Jun 27, 2026
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.

5 participants