From 972427d3a86481dba7022d6f0bb7a46bd7150f71 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Mon, 16 Nov 2020 17:12:53 -0600 Subject: [PATCH] Change temporality for Counter and UpDownCounter to CUMULATIVE Fixes #1383 --- exporter/opentelemetry-exporter-otlp/CHANGELOG.md | 2 ++ .../exporter/otlp/metrics_exporter/__init__.py | 9 +++++---- .../tests/test_otlp_metric_exporter.py | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/exporter/opentelemetry-exporter-otlp/CHANGELOG.md b/exporter/opentelemetry-exporter-otlp/CHANGELOG.md index 4233ddded00..22990677969 100644 --- a/exporter/opentelemetry-exporter-otlp/CHANGELOG.md +++ b/exporter/opentelemetry-exporter-otlp/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +- Change temporality for Counter and UpDownCounter + ([#1384](https://github.com/open-telemetry/opentelemetry-python/pull/1384)) - Add Gzip compression for exporter ([#1141](https://github.com/open-telemetry/opentelemetry-python/pull/1141)) ## Version 0.15b0 diff --git a/exporter/opentelemetry-exporter-otlp/src/opentelemetry/exporter/otlp/metrics_exporter/__init__.py b/exporter/opentelemetry-exporter-otlp/src/opentelemetry/exporter/otlp/metrics_exporter/__init__.py index 2078664b439..2cd1ffad66b 100644 --- a/exporter/opentelemetry-exporter-otlp/src/opentelemetry/exporter/otlp/metrics_exporter/__init__.py +++ b/exporter/opentelemetry-exporter-otlp/src/opentelemetry/exporter/otlp/metrics_exporter/__init__.py @@ -15,8 +15,7 @@ """OTLP Metrics Exporter""" import logging -import os -from typing import List, Optional, Sequence, Type, TypeVar, Union +from typing import List, Optional, Sequence, Type, TypeVar from grpc import ChannelCredentials @@ -222,7 +221,8 @@ def _translate_data( sdk_metric_record, data_point_class ), aggregation_temporality=( - AggregationTemporality.AGGREGATION_TEMPORALITY_DELTA + AggregationTemporality. + AGGREGATION_TEMPORALITY_CUMULATIVE ), is_monotonic=True, ) @@ -234,7 +234,8 @@ def _translate_data( sdk_metric_record, data_point_class ), aggregation_temporality=( - AggregationTemporality.AGGREGATION_TEMPORALITY_DELTA + AggregationTemporality. + AGGREGATION_TEMPORALITY_CUMULATIVE ), is_monotonic=False, ) diff --git a/exporter/opentelemetry-exporter-otlp/tests/test_otlp_metric_exporter.py b/exporter/opentelemetry-exporter-otlp/tests/test_otlp_metric_exporter.py index 3034fcdf651..3e77b64a8ea 100644 --- a/exporter/opentelemetry-exporter-otlp/tests/test_otlp_metric_exporter.py +++ b/exporter/opentelemetry-exporter-otlp/tests/test_otlp_metric_exporter.py @@ -133,7 +133,8 @@ def test_translate_metrics(self, mock_time_ns): ) ], aggregation_temporality=( - AggregationTemporality.AGGREGATION_TEMPORALITY_DELTA + AggregationTemporality. + AGGREGATION_TEMPORALITY_CUMULATIVE ), is_monotonic=True, ),