Skip to content

Commit

Permalink
Added OTEL meter/instrument names
Browse files Browse the repository at this point in the history
  • Loading branch information
samlam committed Sep 1, 2023
1 parent d56ea68 commit 685f352
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions src/OpenTelemetry/Metrics/AggregatorStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ private static double[] FindDefaultHistogramBounds(in MetricStreamIdentity metri
{
switch (metricStreamIdentity.MeterName)
{
// .NET 8 meter
// AspNetCore .NET 8 meter
case "Microsoft.AspNetCore.RateLimiting":
{
switch (metricStreamIdentity.InstrumentName)
Expand All @@ -229,7 +229,7 @@ private static double[] FindDefaultHistogramBounds(in MetricStreamIdentity metri
break;
}

// AspNetCore instrumentation
// AspNetCore .NET 8 meter
case "Microsoft.AspNetCore.Hosting":
{
switch (metricStreamIdentity.InstrumentName)
Expand All @@ -241,7 +241,7 @@ private static double[] FindDefaultHistogramBounds(in MetricStreamIdentity metri
break;
}

// AspNetCore instrumentation
// AspNetCore .NET 8 meter
case "Microsoft.AspNetCore.Server.Kestrel":
{
switch (metricStreamIdentity.InstrumentName)
Expand All @@ -254,7 +254,7 @@ private static double[] FindDefaultHistogramBounds(in MetricStreamIdentity metri
break;
}

// AspNetCore instrumentation
// AspNetCore .NET 8 meter
case "Microsoft.AspNetCore.Http.Connections":
{
switch (metricStreamIdentity.InstrumentName)
Expand All @@ -277,6 +277,30 @@ private static double[] FindDefaultHistogramBounds(in MetricStreamIdentity metri

break;
}

// OTel AspNetCore Instrumentation
case "OpenTelemetry.Instrumentation.AspNetCore":
{
switch (metricStreamIdentity.InstrumentName)
{
case "http.server.duration":
return Metric.DefaultHistogramBoundsSeconds;
}

break;
}

// OTel Http Instrumentation
case "OpenTelemetry.Instrumentation.Http":
{
switch (metricStreamIdentity.InstrumentName)
{
case "http.client.duration":
return Metric.DefaultHistogramBoundsSeconds;
}

break;
}
}
}

Expand Down

0 comments on commit 685f352

Please sign in to comment.