Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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-falcon`: proper bucket boundaries in stable semconv http duration
([#3525](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3525))

### Breaking changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ def response_hook(span, req, resp):
import opentelemetry.instrumentation.wsgi as otel_wsgi
from opentelemetry import context, trace
from opentelemetry.instrumentation._semconv import (
HTTP_DURATION_HISTOGRAM_BUCKETS_NEW,
_get_schema_url,
_OpenTelemetrySemanticConventionStability,
_OpenTelemetryStabilitySignalType,
Expand Down Expand Up @@ -297,6 +298,7 @@ def __init__(self, *args, **kwargs):
name=HTTP_SERVER_REQUEST_DURATION,
description="Duration of HTTP server requests.",
unit="s",
explicit_bucket_boundaries_advisory=HTTP_DURATION_HISTOGRAM_BUCKETS_NEW,
)

self.active_requests_counter = self._otel_meter.create_up_down_counter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

from opentelemetry import trace
from opentelemetry.instrumentation._semconv import (
HTTP_DURATION_HISTOGRAM_BUCKETS_NEW,
OTEL_SEMCONV_STABILITY_OPT_IN,
_OpenTelemetrySemanticConventionStability,
_server_active_requests_count_attrs_new,
Expand Down Expand Up @@ -550,6 +551,10 @@ def test_falcon_metric_values_new_semconv(self):
self.assertAlmostEqual(
duration, point.sum, delta=10
)
self.assertEqual(
point.explicit_bounds,
HTTP_DURATION_HISTOGRAM_BUCKETS_NEW,
)
if isinstance(point, NumberDataPoint):
self.assertEqual(point.value, 0)
number_data_point_seen = True
Expand Down Expand Up @@ -600,6 +605,11 @@ def test_falcon_metric_values_both_semconv(self):
self.assertAlmostEqual(
max(duration_s, 0), point.sum, delta=10
)
self.assertEqual(
point.explicit_bounds,
HTTP_DURATION_HISTOGRAM_BUCKETS_NEW,
)

histogram_data_point_seen = True
if isinstance(point, NumberDataPoint):
self.assertEqual(point.value, 0)
Expand Down