diff --git a/src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md b/src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md index ced48e87cc..a9ba671f55 100644 --- a/src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md +++ b/src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md @@ -2,6 +2,13 @@ ## Unreleased +## 1.3.1 + +Released 2022-Dec-07 + +* Fix the overflow bucket value serialization for Histogram. + ([#807](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/807)) + ## 1.3.0 Released 2022-Jul-28 diff --git a/src/OpenTelemetry.Exporter.Geneva/GenevaMetricExporter.cs b/src/OpenTelemetry.Exporter.Geneva/GenevaMetricExporter.cs index a809174c3a..ce92fc6011 100644 --- a/src/OpenTelemetry.Exporter.Geneva/GenevaMetricExporter.cs +++ b/src/OpenTelemetry.Exporter.Geneva/GenevaMetricExporter.cs @@ -393,7 +393,6 @@ internal unsafe ushort SerializeHistogramMetric( if (bucket.ExplicitBound != double.PositiveInfinity) { MetricSerializer.SerializeUInt64(this.bufferForHistogramMetrics, ref bufferIndex, Convert.ToUInt64(bucket.ExplicitBound)); - lastExplicitBound = bucket.ExplicitBound; } else { @@ -404,6 +403,8 @@ internal unsafe ushort SerializeHistogramMetric( MetricSerializer.SerializeUInt32(this.bufferForHistogramMetrics, ref bufferIndex, Convert.ToUInt32(bucket.BucketCount)); bucketCount++; } + + lastExplicitBound = bucket.ExplicitBound; } // Write the number of items in distribution emitted and reset back to end. diff --git a/test/OpenTelemetry.Exporter.Geneva.Tests/GenevaMetricExporterTests.cs b/test/OpenTelemetry.Exporter.Geneva.Tests/GenevaMetricExporterTests.cs index 746b413c00..70f8c97104 100644 --- a/test/OpenTelemetry.Exporter.Geneva.Tests/GenevaMetricExporterTests.cs +++ b/test/OpenTelemetry.Exporter.Geneva.Tests/GenevaMetricExporterTests.cs @@ -671,7 +671,6 @@ private void CheckSerializationForSingleMetricPoint(Metric metric, GenevaMetricE if (bucket.ExplicitBound != double.PositiveInfinity) { Assert.Equal(bucket.ExplicitBound, valueCountPairs.Columns[listIterator].Value); - lastExplicitBound = bucket.ExplicitBound; } else { @@ -683,6 +682,8 @@ private void CheckSerializationForSingleMetricPoint(Metric metric, GenevaMetricE listIterator++; bucketsWithPositiveCount++; } + + lastExplicitBound = bucket.ExplicitBound; } Assert.Equal(bucketsWithPositiveCount, valueCountPairs.DistributionSize);