-
Notifications
You must be signed in to change notification settings - Fork 358
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
CreateCounter can create corruptable counter #4843
Comments
For .NET Runtime, I think this is a duplicate of dotnet/runtime#93767, which was fixed in dotnet/runtime#104993 before v9.0.0-preview.6.24327.7. For dotnet-counters, TraceEventExtensions will have to be changed to use the new |
@tarekgh can you confirm @KalleOlaviNiemitalo's analysis |
Yes @KalleOlaviNiemitalo is correct. We added a support to emit a unique Id for every instrument in the runtime. Tools like dotnet-counter and dotnet-monitor or any similar tools need to benefit from that and ensure distinguishing between instruments created with the same name. We need to transfer this issue to the https://github.com/dotnet/diagnostics repo. @noahfalk @davmason @tommcdon @brianrob I don't have write permission on the diagnostics repo to transfer the issue there, can anyone of you help transferring it there? |
I'm happy to leave both this issue and #4564 open for tracking multiple instruments and multiple meters respectively. They technically could be fixed independently even though probably one PR is going to resolve both at the same time. |
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
Description
👍 This will correctly register 1 metrics with 2 different tag values for
type
:👎 This creates 2 counter with same name, but tags specified at creation:
dotnet-counters monitor -n ConsoleApp10 --counters HatCo.Store --showDeltas
shows just 1 metric label fortype=blue
, that consistently shows a value that matches theblue
; but a delta value that is the difference betweenblue
andred
.So somehow the same metrics is reported on top of itself with wrong tags.
Reproduction Steps
See above code examples
Expected behavior
Both code examples work the same
Actual behavior
invalid metrics reported
Regression?
No response
Known Workarounds
The first example obviously works
Configuration
8.0
Other information
No response
The text was updated successfully, but these errors were encountered: