-
Notifications
You must be signed in to change notification settings - Fork 763
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
Make ResourceUtilizationInstruments class public #5345
Comments
This proposal makes sense to me as otherwise consumers migrating from It'd be great if we could keep the original instrument names, however the underlying metric names have changed, so it doesn't make much sense. Making this type public will also enable us to obsolete instruments, if that becomes necessary for one reason or another. That is, will be able to do something like this: public static class ResourceUtilizationInstruments
{
+ [Obsolete("Use XYZ instrument instead", UrlFormat = "aka.ms/docs/...")]
public const string CpuUtilization = "process.cpu.utilization";
public const string MemoryUtilization = "dotnet.process.memory.virtual.utilization";
} @joperezr @geeknoid @mwierzchowski: I'm inclinde to approve this proposal unless there are objections. |
It makes me a bit nervous if we are the first ones to ever expose these constants in the sense of: Why hasn't this been done elsewhere with other meters? In general I'm not really opposed to it, but I'd be curious to hear what either @JamesNK or @noahfalk think about this given I don't think there is a lot of precedent of strong-typing meter names. |
I don't know anywhere we do this for other metrics. Or telemetry in general. Meters, instruments, activity source names, activity names, tag names, event counters, etc. If folks want to use telemetry in a .NET app, then they likely copy the name into a string from docs. I don't think you should expose constants. It's possible to add it in the future if there is demand for it. |
I feel the same as James. We haven't exposed these strings as public API constants for any other built-in telemetry and I've never seen any criticism/requests related to it.
Most references to the names of telemetry occur in config files or out-of-process tooling so I'd expect plenty of editing whether API constants are available or not. |
Thank you for your feedback. Closing as "rejected". |
The
Microsoft.Extensions.Diagnostics.ResourceMonitoring.ResourceUtilizationInstruments
class contains only constants which represent metric names. Those metric names are used internally in the library, but they also might be used by customers in their code, and since metric names areinternal
, currently customers are forced to use hard-coded strings. Therefore, I propose to make theResourceUtilizationInstruments
classpublic
, which will expose all its members (they are alreadypublic const
).Proposed API
Usage Examples
The text was updated successfully, but these errors were encountered: