-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Output unexpected literal string in MetricsEventSource.ParseSpecs #60110
Comments
Tagging subscribers to this area: @tarekgh, @tommcdon, @pjanotti Issue DetailsDescriptionSome log message in MetricsEventSource seems to be unexpected literal string.
using System;
using System.Diagnostics.Metrics;
using var meter = new Meter("appmeter");
var counter = meter.CreateCounter<int>("counter1", "unit", "desc");
while(true)
{
await Task.Delay(1000).ConfigureAwait(false);
if(counter.Enabled)
{
counter.Add(1);
}
}
And there is record which has Configurationdotnet-sdk-6.0-rc1 windows10-x64 Other informationI found the source location which should be fixed. Lines 375 to 390 in 240a64d
|
I made branch and commit for fixing it, not write test yet. |
@itn3000 thanks for your report. do you want to submit a PR to fix it? it should be a trivial fix - Log.Message("Failed to parse metric spec: {specString}");
+ Log.Message($"Failed to parse metric spec: {specString}"); and -Log.Message("Parsed metric: {spec}");
+Log.Message($"Parsed metric: {spec}"); I looked at the rest of the file and couldn't find any other similar case. CC @noahfalk |
I create PR #60176 |
a bug was found in a new API introduced in 6.0, should it be in 6.0 milestone (akin #60182)? |
Description
Some log message in MetricsEventSource seems to be unexpected literal string.
steps of reproduce are following.
dotnet-trace collect -p [PID] --provideres System.Diagnostics.Metrics:::Metrics=appmeter
And there is record which has
Message="Parsed metric: {spec}"
.It should be
Message="Parsed metric: appmeter"
.Configuration
dotnet-sdk-6.0-rc1 windows10-x64
Other information
I found the source location which should be fixed.
runtime/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/MetricsEventSource.cs
Lines 375 to 390 in 240a64d
The text was updated successfully, but these errors were encountered: