Area
area:api
Package Version
| Package Name |
Version |
| OpenTelemetry.Api |
1.8.1 |
| OpenTelemetry |
1.8.1 |
Runtime Version
net8.0
Description
When using a Histogram<decimal>, values are not reported.
Based on the .NET documentation, Histogram<T> should work with decimal.
Steps to Reproduce
using System.Diagnostics.Metrics;
using OpenTelemetry;
using OpenTelemetry.Metrics;
using var meterProvider = Sdk.CreateMeterProviderBuilder()
.AddMeter("TestMeter")
.AddConsoleExporter()
.Build();
var meter = new Meter("TestMeter");
var histogram = meter.CreateHistogram<decimal>("test-histogram");
histogram.Record(10);
This produces the following output:
Resource associated with Metric:
telemetry.sdk.name: opentelemetry
telemetry.sdk.language: dotnet
telemetry.sdk.version: 1.8.1
service.name: unknown_service:ConsoleApp1
But when using a Histogram<double> for example, the output is:
Resource associated with Metric:
telemetry.sdk.name: opentelemetry
telemetry.sdk.language: dotnet
telemetry.sdk.version: 1.8.1
service.name: unknown_service:ConsoleApp1
Metric Name: test-histogram, Meter: TestMeter
(2024-05-14T16:27:14.4076497Z, 2024-05-14T16:27:14.4159669Z] Histogram
Value: Sum: 10 Count: 1 Min: 10 Max: 10
(-Infinity,0]:0
(0,5]:0
(5,10]:1
(10,25]:0
(25,50]:0
(50,75]:0
(75,100]:0
(100,250]:0
(250,500]:0
(500,750]:0
(750,1000]:0
(1000,2500]:0
(2500,5000]:0
(5000,7500]:0
(7500,10000]:0
(10000,+Infinity]:0
Expected Result
Values should be reported when using Histogram<decimal>.
Actual Result
Values are not reported when using Histogram<decimal>.
Additional Context
No response
Area
area:api
Package Version
Runtime Version
net8.0
Description
When using a
Histogram<decimal>, values are not reported.Based on the .NET documentation,
Histogram<T>should work withdecimal.Steps to Reproduce
This produces the following output:
Resource associated with Metric: telemetry.sdk.name: opentelemetry telemetry.sdk.language: dotnet telemetry.sdk.version: 1.8.1 service.name: unknown_service:ConsoleApp1But when using a
Histogram<double>for example, the output is:Resource associated with Metric: telemetry.sdk.name: opentelemetry telemetry.sdk.language: dotnet telemetry.sdk.version: 1.8.1 service.name: unknown_service:ConsoleApp1 Metric Name: test-histogram, Meter: TestMeter (2024-05-14T16:27:14.4076497Z, 2024-05-14T16:27:14.4159669Z] Histogram Value: Sum: 10 Count: 1 Min: 10 Max: 10 (-Infinity,0]:0 (0,5]:0 (5,10]:1 (10,25]:0 (25,50]:0 (50,75]:0 (75,100]:0 (100,250]:0 (250,500]:0 (500,750]:0 (750,1000]:0 (1000,2500]:0 (2500,5000]:0 (5000,7500]:0 (7500,10000]:0 (10000,+Infinity]:0Expected Result
Values should be reported when using
Histogram<decimal>.Actual Result
Values are not reported when using
Histogram<decimal>.Additional Context
No response