diff --git a/src/OpenTelemetry.Contrib.Instrumentation.EventCounters/Implementation/EventCounterListener.cs b/src/OpenTelemetry.Contrib.Instrumentation.EventCounters/Implementation/EventCounterListener.cs index 98c9b1e79c..1588b2957e 100644 --- a/src/OpenTelemetry.Contrib.Instrumentation.EventCounters/Implementation/EventCounterListener.cs +++ b/src/OpenTelemetry.Contrib.Instrumentation.EventCounters/Implementation/EventCounterListener.cs @@ -231,6 +231,22 @@ private void ExtractAndPostMetric(string eventSourceName, IDictionary public string EventSource { get; set; } + /// + /// Gets a dictionary of application-defined property names and values providing additional information about this metric. + /// + public Dictionary Properties { get; } = new Dictionary(); + /// /// Gets or sets sum of the values of the metric samples. /// diff --git a/src/OpenTelemetry.Contrib.Instrumentation.EventCounters/README.md b/src/OpenTelemetry.Contrib.Instrumentation.EventCounters/README.md index b89e805ae9..1dd23231d1 100644 --- a/src/OpenTelemetry.Contrib.Instrumentation.EventCounters/README.md +++ b/src/OpenTelemetry.Contrib.Instrumentation.EventCounters/README.md @@ -40,12 +40,12 @@ namespace DotnetMetrics using var meterprovider = Sdk.CreateMeterProviderBuilder() .AddEventCounters(options => { - options.AddEventSource("Microsoft-AspNetCore-Server-Kestrel") - .WithCounters("total-connections", "connections-per-second") - .With( - "connections-per-second", - "The number of connections per update interval to the web server", - MetricType.LongSum); + options.AddEventSource("Microsoft-AspNetCore-Server-Kestrel") + .WithCounters("total-connections", "connections-per-second") + .With( + "connections-per-second", + "The number of connections per update interval to the web server", + MetricType.LongSum); }) .AddConsoleExporter() .Build(); @@ -105,7 +105,7 @@ builder.Services.AddOpenTelemetryMetrics( .AddPrometheusExporter() .AddEventCounters(options => { - builder.Configuration.GetSection("Telemetry").Bind(options); + builder.Configuration.GetSection("Telemetry").Bind(options); })); var app = builder.Build();