|
3 | 3 | import pytest |
4 | 4 | from unittest.mock import patch, MagicMock |
5 | 5 |
|
6 | | -from opentelemetry.sdk.metrics import Counter |
| 6 | +from opentelemetry.sdk.metrics import Counter, Histogram, ObservableCounter, ObservableGauge, ObservableUpDownCounter, UpDownCounter |
7 | 7 | from opentelemetry.sdk.metrics.export import AggregationTemporality |
8 | 8 |
|
9 | 9 | from sap_cloud_sdk.core.telemetry._provider import ( |
@@ -188,7 +188,14 @@ def test_setup_meter_provider_success(self): |
188 | 188 | # Verify exporter was created with endpoint and delta temporality |
189 | 189 | mock_exporter_class.assert_called_once_with( |
190 | 190 | endpoint="http://localhost:4317", |
191 | | - preferred_temporality={Counter: AggregationTemporality.DELTA}, |
| 191 | + preferred_temporality={ |
| 192 | + Counter: AggregationTemporality.DELTA, |
| 193 | + Histogram: AggregationTemporality.DELTA, |
| 194 | + ObservableCounter: AggregationTemporality.DELTA, |
| 195 | + ObservableGauge: AggregationTemporality.DELTA, |
| 196 | + ObservableUpDownCounter: AggregationTemporality.DELTA, |
| 197 | + UpDownCounter: AggregationTemporality.DELTA, |
| 198 | + }, |
192 | 199 | ) |
193 | 200 |
|
194 | 201 | # Verify reader was created with exporter |
@@ -231,5 +238,12 @@ def test_setup_meter_provider_with_valid_config(self): |
231 | 238 | # Verify exporter was created with correct endpoint and delta temporality |
232 | 239 | mock_exporter.assert_called_with( |
233 | 240 | endpoint=config.otlp_endpoint, |
234 | | - preferred_temporality={Counter: AggregationTemporality.DELTA}, |
| 241 | + preferred_temporality={ |
| 242 | + Counter: AggregationTemporality.DELTA, |
| 243 | + Histogram: AggregationTemporality.DELTA, |
| 244 | + ObservableCounter: AggregationTemporality.DELTA, |
| 245 | + ObservableGauge: AggregationTemporality.DELTA, |
| 246 | + ObservableUpDownCounter: AggregationTemporality.DELTA, |
| 247 | + UpDownCounter: AggregationTemporality.DELTA, |
| 248 | + }, |
235 | 249 | ) |
0 commit comments