-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add System.Net.NameResolution metrics #88773
Conversation
Tagging subscribers to this area: @dotnet/ncl Issue DetailsContributes to #48885 The implementation piggybacks off of the existing I added a
The existing (do tell me if I'm committing any metering crimes - I haven't dealt with the new APIs yet) P.S. What's the story with
|
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.
Looks good, but we need to agree on the naming.
P.S. What's the story with
InstrumentRecorder
? It's a bit sad to see every change duplicate it in tests.
It almost made its' way to the BCL but was removed in #87873. We shall create a copy of MetricCollector
or a simplified variant in Common/tests
as we keep adding more metrics I guess.
private static readonly Meter s_meter = new("System.Net.NameResolution"); | ||
|
||
private static readonly Counter<long> s_lookupsRequestedCounter = s_meter.CreateCounter<long>( | ||
name: "dns-lookups-requested", |
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.
/cc @noahfalk to figure out the naming, since this is establishing a precedent. Should it be dns.lookups.requested
?
(The instruments in my pr are to be renamed.)
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.
LGTM, we can rename the instruments in a follow-up PR.
Contributes to #48885
The implementation piggybacks off of the existing
EventSource
logic to minimize the maintainability burden.I added a
System.Net.NameResolution
meter with:Counter<long> "dns-lookups-requested"
that just does+1
,tags: hostname=foo
.The existing
EventCounters
also have adns-lookups-duration
counter -- do we want aMeter
equivalent?(do tell me if I'm committing any metering crimes - I haven't dealt with the new APIs yet)
P.S. What's the story with
InstrumentRecorder
? It's a bit sad to see every change duplicate it in tests.cc: @davidfowl