|
23 | 23 | import opentelemetry.instrumentation.wsgi as otel_wsgi |
24 | 24 | from opentelemetry import trace as trace_api |
25 | 25 | from opentelemetry.instrumentation._semconv import ( |
| 26 | + HTTP_DURATION_HISTOGRAM_BUCKETS_NEW, |
26 | 27 | OTEL_SEMCONV_STABILITY_OPT_IN, |
27 | 28 | _OpenTelemetrySemanticConventionStability, |
28 | 29 | _server_active_requests_count_attrs_new, |
@@ -418,6 +419,11 @@ def test_wsgi_metrics_new_semconv(self): |
418 | 419 | for point in data_points: |
419 | 420 | if isinstance(point, HistogramDataPoint): |
420 | 421 | self.assertEqual(point.count, 3) |
| 422 | + if metric.name == "http.server.request.duration": |
| 423 | + self.assertEqual( |
| 424 | + point.explicit_bounds, |
| 425 | + HTTP_DURATION_HISTOGRAM_BUCKETS_NEW, |
| 426 | + ) |
421 | 427 | histogram_data_point_seen = True |
422 | 428 | if isinstance(point, NumberDataPoint): |
423 | 429 | number_data_point_seen = True |
@@ -456,6 +462,11 @@ def test_wsgi_metrics_both_semconv(self): |
456 | 462 | for point in data_points: |
457 | 463 | if isinstance(point, HistogramDataPoint): |
458 | 464 | self.assertEqual(point.count, 1) |
| 465 | + if metric.name == "http.server.request.duration": |
| 466 | + self.assertEqual( |
| 467 | + point.explicit_bounds, |
| 468 | + HTTP_DURATION_HISTOGRAM_BUCKETS_NEW, |
| 469 | + ) |
459 | 470 | histogram_data_point_seen = True |
460 | 471 | if isinstance(point, NumberDataPoint): |
461 | 472 | number_data_point_seen = True |
|
0 commit comments