Repository: open-telemetry/opentelemetry-python

Issue:
Add min/max fields to Histogram in otlp metrics exporter
From proto https://github.com/open-telemetry/opentelemetry-proto/pull/279


Discussion:

Resolving patch:
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
--- 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
@@ -146,6 +146,8 @@ def _translate_data(
                                 sum=data_point.sum,
                                 bucket_counts=data_point.bucket_counts,
                                 explicit_bounds=data_point.explicit_bounds,
+                                max=data_point.max,
+                                min=data_point.min,
                             )
                             pb2_metric.histogram.aggregation_temporality = (
                                 metric.data.aggregation_temporality


Test patch:
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
--- 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
@@ -720,6 +720,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,
@@ -782,6 +784,8 @@ def test_translate_multiple_scope_histogram(self):
                                                 explicit_bounds=[10.0, 20.0],
                                                 exemplars=[],
                                                 flags=pb2.DataPointFlags.FLAG_NONE,
+                                                max=18.0,
+                                                min=8.0,
                                             )
                                         ],
                                         aggregation_temporality=AggregationTemporality.DELTA,
@@ -816,6 +820,8 @@ def test_translate_multiple_scope_histogram(self):
                                                 explicit_bounds=[10.0, 20.0],
                                                 exemplars=[],
                                                 flags=pb2.DataPointFlags.FLAG_NONE,
+                                                max=18.0,
+                                                min=8.0,
                                             )
                                         ],
                                         aggregation_temporality=AggregationTemporality.DELTA,
@@ -857,6 +863,8 @@ def test_translate_multiple_scope_histogram(self):
                                                 explicit_bounds=[10.0, 20.0],
                                                 exemplars=[],
                                                 flags=pb2.DataPointFlags.FLAG_NONE,
+                                                max=18.0,
+                                                min=8.0,
                                             )
                                         ],
                                         aggregation_temporality=AggregationTemporality.DELTA,
@@ -898,6 +906,8 @@ def test_translate_multiple_scope_histogram(self):
                                                 explicit_bounds=[10.0, 20.0],
                                                 exemplars=[],
                                                 flags=pb2.DataPointFlags.FLAG_NONE,
+                                                max=18.0,
+                                                min=8.0,
                                             )
                                         ],
                                         aggregation_temporality=AggregationTemporality.DELTA,