-
Notifications
You must be signed in to change notification settings - Fork 366
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
Conversation
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
@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? |
src/Microsoft.Diagnostics.Monitoring.EventPipe/Counters/TraceEventExtensions.cs
Show resolved
Hide resolved
src/Microsoft.Diagnostics.Monitoring.EventPipe/Counters/TraceEventExtensions.cs
Show resolved
Hide resolved
src/Microsoft.Diagnostics.Monitoring.EventPipe/Counters/TraceEventExtensions.cs
Outdated
Show resolved
Hide resolved
@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. |
src/Microsoft.Diagnostics.Monitoring.EventPipe/Counters/TraceEventExtensions.cs
Show resolved
Hide resolved
There was a problem hiding this 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.
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