Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- `opentelemetry-instrumentation-fastapi`: fix wrapping of middlewares
([#3012](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3012))
- `opentelemetry-instrumentation-urllib`: proper bucket boundaries in stable semconv http duration metrics
([#3519](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3519))
- `opentelemetry-instrumentation-falcon`: proper bucket boundaries in stable semconv http duration
([#3525](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3525))
- `opentelemetry-instrumentation-wsgi`: add explicit http duration buckets for stable semconv
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def response_hook(span: Span, request: Request, response: HTTPResponse):
)

from opentelemetry.instrumentation._semconv import (
HTTP_DURATION_HISTOGRAM_BUCKETS_NEW,
_client_duration_attrs_new,
_client_duration_attrs_old,
_filter_semconv_duration_attrs,
Expand Down Expand Up @@ -434,6 +435,7 @@ def _create_client_histograms(
name=HTTP_CLIENT_REQUEST_DURATION,
unit="s",
description="Duration of HTTP client requests.",
explicit_bucket_boundaries_advisory=HTTP_DURATION_HISTOGRAM_BUCKETS_NEW,
)
histograms[HTTP_CLIENT_REQUEST_BODY_SIZE] = (
create_http_client_request_body_size(meter)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from pytest import mark

from opentelemetry.instrumentation._semconv import (
HTTP_DURATION_HISTOGRAM_BUCKETS_NEW,
OTEL_SEMCONV_STABILITY_OPT_IN,
_OpenTelemetrySemanticConventionStability,
)
Expand Down Expand Up @@ -76,10 +77,17 @@ def tearDown(self):
httpretty.disable()

# Return Sequence with one histogram
def create_histogram_data_points(self, sum_data_point, attributes):
def create_histogram_data_points(
self, sum_data_point, attributes, explicit_bounds=None
):
return [
self.create_histogram_data_point(
sum_data_point, 1, sum_data_point, sum_data_point, attributes
sum_data_point,
1,
sum_data_point,
sum_data_point,
attributes,
explicit_bounds=explicit_bounds,
)
]

Expand Down Expand Up @@ -176,6 +184,7 @@ def test_basic_metric_new_semconv(self):
"http.request.method": "GET",
"network.protocol.version": "1.1",
},
explicit_bounds=HTTP_DURATION_HISTOGRAM_BUCKETS_NEW,
),
est_value_delta=40,
)
Expand Down Expand Up @@ -295,6 +304,7 @@ def test_basic_metric_both_semconv(self):
"http.request.method": "GET",
"network.protocol.version": "1.1",
},
explicit_bounds=HTTP_DURATION_HISTOGRAM_BUCKETS_NEW,
),
est_value_delta=40,
)
Expand Down