Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix concurrency issue with metrics gauge value collection #106175

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

Conversation

tarekgh
Copy link
Member

@tarekgh tarekgh commented Aug 9, 2024

Fixes #91591

@tarekgh
Copy link
Member Author

tarekgh commented Aug 9, 2024

/azp run runtime-libraries-coreclr outerloop

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@noahfalk noahfalk left a comment

Choose a reason for hiding this comment

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

Product part looked good, I think part of the tests aren't needed and potentially we had an unintended compat break on MetricsEventSource arguments.

@tarekgh
Copy link
Member Author

tarekgh commented Aug 9, 2024

/azp run runtime-libraries-coreclr outerloop

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@noahfalk noahfalk left a comment

Choose a reason for hiding this comment

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

LGTM!

@tarekgh tarekgh merged commit 81d7ff1 into dotnet:main Aug 9, 2024
84 of 92 checks passed
@sebastienros
Copy link
Member

This PR is probably introducing some perf regression (here is one when using HttpClient in a proxy)

image

I think we should build a dedicated web app made for tracking telemetry/metrics performance (open to suggestions). It's a very important domain and its performance can be really impactful on apps. That would allow us to estimate the cost of changes, and detect regressions in related domains. We could also run this app retroactively and see if past changes have introduced changes we may have missed.

@tarekgh
Copy link
Member Author

tarekgh commented Aug 28, 2024

Could this be enabling all metrics in a process that was otherwise subscribed to none?

This part of the change was fixing a regression occurred by other changes. When you have empty specs, it means you need to subscribe to all metrics in the process. This was the .NET 8.0 behavior. Recently, we have added the System.Runtime meter reporting metrics for different runtime areas GC, jit,....etc.

@sebastienros how is the perf test written for the regressed part? does it listen to all meters? or just listen to the concerned meter? I expect some minor hits with the Gauge instrument as we started to synchronize the collected values but shouldn't be that much.

CC @noahfalk

@sebastienros
Copy link
Member

does it listen to all meters?

There could be an issue in Crank then. I will review all the arguments we pass for this specific app (it doesn't show up in other ones) and how meters are recorded.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

System.Diagnostics.Metrics.LastValue looks like it could experience torn reads
4 participants