Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metric name disambiguation #4938

Merged
merged 2 commits into from
Sep 19, 2024
Merged

Metric name disambiguation #4938

merged 2 commits into from
Sep 19, 2024

Conversation

noahfalk
Copy link
Member

@noahfalk noahfalk commented Sep 17, 2024

In .NET 8.0 we added tags on Meters and Instruments but MetricsEventSource only included the names when emitting value publishing events. This made it ambiguous when there was more than one Meter or Instrument with the same name. In 9.0 MetricsEventSource started included InstrumentIDs in the BeginInstrumentReporting events and in the value publishing events that provides a stronger correlation identifier. This change consumes the IDs in those events within Microsoft.Diagnostics.Monitoring.EventPipe, allowing dotnet-counters (and presumably dotnet-monitor too) to track time series that differ only by the tags provided to the Meter/Instrument constructors.

I also re-enabled a disabled test that got broken when .NET 9.0 added the System.Runtime Meter.

Fixes #4843, #4564

In .NET 8.0 we added tags on Meters and Instruments but MetricsEventSource only included the names when emitting value publishing events. This made it ambiguous when there was more than one Meter or Instrument with the same name. In 9.0 MetricsEventSource started included InstrumentIDs in the BeginInstrumentReporting events and in the value publishing events that provides a stronger correlation identifier. This change consumes the IDs in those events within Microsoft.Diagnostics.Monitoring.EventPipe, allowing dotnet-counters (and presumably dotnet-monitor too) to track time series that differ only by the tags provided to the Meter/Instrument constructors.

I also re-enabled a disabled test that got broken .NET 9.0 added the System.Runtime Meter.

Fixes dotnet#4843, dotnet#4564
@noahfalk noahfalk requested a review from a team as a code owner September 17, 2024 06:39
@noahfalk
Copy link
Member Author

@dotnet/dotnet-monitor - I have unit tests on Monitoring.EventPipe and tested dotnet-counters manually, but I haven't tested dotnet-monitor with this change. Do you guys want to try it out the next time you pull a build of Monitoring.EventPipe or is there some testing you'd like me to do in advance?

@noahfalk
Copy link
Member Author

noahfalk commented Sep 18, 2024

@kkeirstead - Thanks for taking a look! I updated the comments a bit. Let me know if you still have concerns about the metadata change on BeginInstrumentReporting or anything else.

Copy link
Member

@tommcdon tommcdon left a comment

Choose a reason for hiding this comment

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

I am not super familiar with the code but overall the changes look good to me. One suggestion for your review.

@noahfalk noahfalk merged commit 37b70e0 into dotnet:main Sep 19, 2024
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.

CreateCounter can create corruptable counter
4 participants