From 9ffe569663871f9de550673b23d87c49ce5429cd Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Sat, 16 Apr 2022 17:20:16 -0600 Subject: [PATCH] Add min max fields to Histogram Fixes #2582 --- .../exporter/otlp/proto/grpc/_metric_exporter/__init__.py | 2 ++ .../tests/metrics/test_otlp_metrics_exporter.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/_metric_exporter/__init__.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/_metric_exporter/__init__.py index 92aba2958c..b16499c00b 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/_metric_exporter/__init__.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/_metric_exporter/__init__.py @@ -140,6 +140,8 @@ def _translate_data( sum=metric.point.sum, bucket_counts=metric.point.bucket_counts, explicit_bounds=metric.point.explicit_bounds, + max=metric.point.max, + min=metric.point.min ) pbmetric.histogram.aggregation_temporality = ( metric.point.aggregation_temporality diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/metrics/test_otlp_metrics_exporter.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/metrics/test_otlp_metrics_exporter.py index 4a171b7986..21ddc49fa2 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/metrics/test_otlp_metrics_exporter.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/tests/metrics/test_otlp_metrics_exporter.py @@ -554,6 +554,8 @@ def test_translate_histogram(self): explicit_bounds=[10.0, 20.0], exemplars=[], flags=pb2.DataPointFlags.FLAG_NONE, + max=18.0, + min=8.0 ) ], aggregation_temporality=AggregationTemporality.DELTA,