opentelemetry-dotnet-contrib icon indicating copy to clipboard operation
opentelemetry-dotnet-contrib copied to clipboard

Histogram with negative values

Open aelij opened this issue 2 years ago • 0 comments

Issue with OpenTelemetry.Exporter.Geneva

List of all OpenTelemetry NuGet packages and version that you are using (e.g. OpenTelemetry 1.0.2):

  • OpenTelemetry, 1.4.0-rc.2
  • OpenTelemetry.Exporter.Geneva, 1.4.0-rc.1

Runtime version (e.g. net462, net48, netcoreapp3.1, net6.0 etc. You can find this information from the *.csproj file):

  • net7.0

Is this a feature request or a bug?

  • Bug

What is the expected behavior? Allow negative values in histograms

What is the actual behavior?

var m = new Meter("m");
var h = m.CreateHistogram<long>("h");
h.Record(-1);

Exception:

System.OverflowException: Arithmetic operation resulted in an overflow.
   at System.Convert.ToUInt64(Double value)
   at OpenTelemetry.Exporter.Geneva.GenevaMetricExporter.Export(Batch`1& batch)

aelij avatar Jan 20 '23 09:01 aelij