Skip to content

Commit 489b4c5

Browse files
Dudssourceocelotl
authored andcommitted
chore: added unit test for grpc otlp metric exporter
1 parent 491482d commit 489b4c5

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_metrics_exporter.py

+16
Original file line numberDiff line numberDiff line change
@@ -1006,3 +1006,19 @@ def _number_data_point(value: int) -> NumberDataPoint:
10061006
time_unix_nano=1641946016139533244,
10071007
value=value,
10081008
)
1009+
1010+
def test_preferred_aggregation_override(self):
1011+
1012+
histogram_aggregation = ExplicitBucketHistogramAggregation(
1013+
boundaries=[0.05, 0.1, 0.5, 1, 5, 10],
1014+
)
1015+
1016+
exporter = OTLPMetricExporter(
1017+
preferred_aggregation={
1018+
Histogram: histogram_aggregation,
1019+
},
1020+
)
1021+
1022+
self.assertEqual(
1023+
exporter._preferred_aggregation[Histogram], histogram_aggregation
1024+
)

0 commit comments

Comments
 (0)