2626
2727from opentelemetry import trace
2828from opentelemetry .instrumentation ._semconv import (
29+ HTTP_DURATION_HISTOGRAM_BUCKETS_NEW ,
30+ HTTP_DURATION_HISTOGRAM_BUCKETS_OLD ,
2931 OTEL_SEMCONV_STABILITY_OPT_IN ,
3032 _OpenTelemetrySemanticConventionStability ,
3133)
@@ -814,6 +816,10 @@ def test_wsgi_metrics_new_semconv(self):
814816 expected_duration_attributes ,
815817 dict (point .attributes ),
816818 )
819+ self .assertEqual (
820+ point .explicit_bounds ,
821+ HTTP_DURATION_HISTOGRAM_BUCKETS_NEW ,
822+ )
817823 if isinstance (point , NumberDataPoint ):
818824 number_data_point_seen = True
819825 self .assertEqual (point .value , 0 )
@@ -886,6 +892,10 @@ def test_wsgi_metrics_both_semconv(self):
886892 expected_duration_attributes_new ,
887893 dict (point .attributes ),
888894 )
895+ self .assertEqual (
896+ point .explicit_bounds ,
897+ HTTP_DURATION_HISTOGRAM_BUCKETS_NEW ,
898+ )
889899 elif metric .name == "http.server.duration" :
890900 self .assertAlmostEqual (
891901 duration , point .sum , delta = 100
@@ -894,6 +904,10 @@ def test_wsgi_metrics_both_semconv(self):
894904 expected_duration_attributes_old ,
895905 dict (point .attributes ),
896906 )
907+ self .assertEqual (
908+ point .explicit_bounds ,
909+ HTTP_DURATION_HISTOGRAM_BUCKETS_OLD ,
910+ )
897911 if isinstance (point , NumberDataPoint ):
898912 number_data_point_seen = True
899913 self .assertEqual (point .value , 0 )
0 commit comments