-
Notifications
You must be signed in to change notification settings - Fork 0
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
Event source configuration #3
Event source configuration #3
Conversation
Fix metric name
The configuration looks like using var meterprovider = Sdk.CreateMeterProviderBuilder()
.AddEventCounters(options =>
{
options.AddRuntime().WithAll(); // all from 'System.Runtime'
options.AddAspNetCore() // dedicated event counters with optional mapped metric name
.WithCurrentRequests("http_requests_in_progress")
.WithFailedRequests()
.WithRequestRate()
.WithTotalRequests("http_requests_received_total");
options.AddEventSource("Microsoft-AspNetCore-Server-Kestrel") // add any other event counter
.WithCounters("total-connections", "connections-per-second")
.With("connections-per-second", "The number of connections per update interval to the web server", MetricType.LongSum);
}) |
this.option = options.AddEventSource(KnownEventSources.SystemRuntime); | ||
} | ||
|
||
public ISystemRuntimeBuilder WithCounters(params string[] counterNames) |
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.
this approach is great and user friendly but the eventCounters under well known counters are not the only ones. We also need to support ones we do not know about. So it has use types that allow users to add theirs without code changes. Also needs to be configurable from appsettings.json or other IConfiguration sources.
Hi @hananiel,
I think this approach is a better event source configuration making it more flexible and more "explorable" for the developer.