Repository navigation
Migrate to use the System.Diagnostics.Metrics API to track internal metrics - #7814
Conversation
|
@suraciii this is fantastic! Is there anything which remains before you mark this PR as "Ready for review"? |
I'm validating migrated metrics, and considering to improve the way how Orleans itself subscribes its metrics, but it can be done in a further PR. This PR is ready for review now, you can get all migrated metrics at |
| private static CounterAggregator FindOrCreate(string name, params KeyValuePair<string, object>[] tags) | ||
| { | ||
| var key = new AggregatorKey(name, tags); | ||
| ref var aggregator = ref CollectionsMarshal.GetValueRefOrAddDefault(Aggregators, key, out var exists); |
There was a problem hiding this comment.
This doesn't look thread-safe - I suggest a lock
There was a problem hiding this comment.
My mistake, you removed this already
* clean up comments
will revert it later
fix misuse on dictionary
|
If there are any other changes you'd like to make here, we can do so in a subsequent PR. Many thanks for this contribution! |
|
@ReubenBond Thank you so much for your help with this PR :) |
|
Gladly, @suraciii, your effort here is a tremendous help |
Fixes: #7480
This PR migrate most of current
*Statistics toSystem.Diagnostics.Metrics.Instruments, let metrics can be collected directly by common tools (dotnet-counters,OpenTelemetry SDK, etc.)Microsoft Reviewers: Open in CodeFlow