From 28a67e3b6536bca93a3d464e3c94742cef5c3d90 Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Thu, 3 Feb 2022 09:45:53 -0800 Subject: [PATCH] OTLP histo sum (#2435) --- .../exporter/otlp/proto/grpc/_metric_exporter/__init__.py | 1 + .../tests/metrics/test_otlp_metrics_exporter.py | 1 + 2 files changed, 2 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 df48a15a7bd..92aba2958c2 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 @@ -137,6 +137,7 @@ def _translate_data( time_unix_nano=metric.point.time_unix_nano, start_time_unix_nano=metric.point.start_time_unix_nano, count=sum(metric.point.bucket_counts), + sum=metric.point.sum, bucket_counts=metric.point.bucket_counts, explicit_bounds=metric.point.explicit_bounds, ) 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 9c4bd860f51..9c00ee43408 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 @@ -589,6 +589,7 @@ def test_translate_histogram(self): start_time_unix_nano=1641946016139533244, time_unix_nano=1641946016139533244, count=5, + sum=67, bucket_counts=[1, 4], explicit_bounds=[10.0, 20.0], exemplars=[],