From 110bb7349599efadf2bc039504a8c7bd38a3ccb8 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Tue, 20 Aug 2024 15:01:37 -0700 Subject: [PATCH] Add ExponentialHistograms to data types supported (#4134) --- CHANGELOG.md | 2 ++ .../src/opentelemetry/sdk/metrics/_internal/point.py | 6 ++++-- .../src/opentelemetry/sdk/metrics/export/__init__.py | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a97c38d812..4edac96900 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#4103](https://github.com/open-telemetry/opentelemetry-python/pull/4103)) - Update semantic conventions to version 1.27.0 ([#4104](https://github.com/open-telemetry/opentelemetry-python/pull/4104)) +- Export ExponentialHistogram and ExponentialHistogramDataPoint + ([#4134](https://github.com/open-telemetry/opentelemetry-python/pull/4134)) - Implement Client Key and Certificate File Support for All OTLP Exporters ([#4116](https://github.com/open-telemetry/opentelemetry-python/pull/4116)) diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/point.py b/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/point.py index 42420b9008..473b45ed6b 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/point.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/point.py @@ -183,8 +183,10 @@ def to_json(self, indent=4) -> str: # pylint: disable=invalid-name -DataT = Union[Sum, Gauge, Histogram] -DataPointT = Union[NumberDataPoint, HistogramDataPoint] +DataT = Union[Sum, Gauge, Histogram, ExponentialHistogram] +DataPointT = Union[ + NumberDataPoint, HistogramDataPoint, ExponentialHistogramDataPoint +] @dataclass(frozen=True) diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/metrics/export/__init__.py b/opentelemetry-sdk/src/opentelemetry/sdk/metrics/export/__init__.py index 97c31b97ec..478237cd17 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/metrics/export/__init__.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/metrics/export/__init__.py @@ -43,6 +43,7 @@ __all__ = [ "AggregationTemporality", + "Buckets", "ConsoleMetricExporter", "InMemoryMetricReader", "MetricExporter", @@ -51,6 +52,8 @@ "PeriodicExportingMetricReader", "DataPointT", "DataT", + "ExponentialHistogram", + "ExponentialHistogramDataPoint", "Gauge", "Histogram", "HistogramDataPoint",