Skip to content

Commit

Permalink
wp
Browse files Browse the repository at this point in the history
  • Loading branch information
ysolomchenko committed Sep 18, 2024
1 parent 15b7bce commit b6d7ddf
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,22 @@ private static MeterProviderBuilder AddEventCountersInstrumentation(

var options = new EventCountersInstrumentationOptions();
configure?.Invoke(options);
configuration?.Bind(options);

// configuration?.Bind(options);

if (configuration != null)
{
if (int.TryParse(configuration["EventCounters:RefreshIntervalSecs"], out var refreshInterval))
{
options.RefreshIntervalSecs = refreshInterval;
}

var eventSourceNames = configuration.GetSection("EventCounters:EventSourceNames").Get<string[]>();
if (eventSourceNames != null)
{
options.AddEventSources(eventSourceNames);
}
}

builder.AddMeter(EventCountersMetrics.MeterInstance.Name);
return builder.AddInstrumentation(() => new EventCountersMetrics(options));
Expand Down

0 comments on commit b6d7ddf

Please sign in to comment.