Skip to content

Commit 98958b6

Browse files
author
JianQiao
authored
Fix description of http.server.duration and http.server.request.duration (#2817)
* fix httpserverduration and httpserverrequestduration Signed-off-by: Steven Pan <[email protected]> * add change log --------- Signed-off-by: Steven Pan <[email protected]>
1 parent f7878e7 commit 98958b6

File tree

9 files changed

+14
-12
lines changed
  • instrumentation
    • opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server
    • opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi
    • opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django
    • opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon
    • opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask
    • opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid
    • opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado
    • opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi

9 files changed

+14
-12
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4646
([#2563](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2563))
4747
- `opentelemetry-instrumentation` fix `http.host` new http semantic convention mapping to depend on `kind` of span
4848
([#2814](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2814))
49+
- `opentelemetry-instrumentation` Fix the description of `http.server.duration` and `http.server.request.duration`
50+
([#2753](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2753))
4951

5052
## Version 1.26.0/0.47b0 (2024-07-23)
5153

instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ async def middleware(request, handler):
207207
duration_histogram = meter.create_histogram(
208208
name=MetricInstruments.HTTP_SERVER_DURATION,
209209
unit="ms",
210-
description="Duration of HTTP server requests.",
210+
description="Measures the duration of inbound HTTP requests.",
211211
)
212212

213213
active_requests_counter = meter.create_up_down_counter(

instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ def __init__(
579579
self.duration_histogram_old = self.meter.create_histogram(
580580
name=MetricInstruments.HTTP_SERVER_DURATION,
581581
unit="ms",
582-
description="Duration of HTTP server requests.",
582+
description="Measures the duration of inbound HTTP requests.",
583583
)
584584
self.duration_histogram_new = None
585585
if _report_new(sem_conv_opt_in_mode):

instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def _instrument(self, **kwargs):
344344
_DjangoMiddleware._duration_histogram_old = meter.create_histogram(
345345
name=MetricInstruments.HTTP_SERVER_DURATION,
346346
unit="ms",
347-
description="Duration of HTTP server requests.",
347+
description="Measures the duration of inbound HTTP requests.",
348348
)
349349
_DjangoMiddleware._duration_histogram_new = None
350350
if _report_new(sem_conv_opt_in_mode):

instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def __init__(self, *args, **kwargs):
268268
self.duration_histogram = self._otel_meter.create_histogram(
269269
name=MetricInstruments.HTTP_SERVER_DURATION,
270270
unit="ms",
271-
description="Duration of HTTP server requests.",
271+
description="Measures the duration of inbound HTTP requests.",
272272
)
273273
self.active_requests_counter = self._otel_meter.create_up_down_counter(
274274
name=MetricInstruments.HTTP_SERVER_ACTIVE_REQUESTS,

instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -568,14 +568,14 @@ def __init__(self, *args, **kwargs):
568568
duration_histogram_old = meter.create_histogram(
569569
name=MetricInstruments.HTTP_SERVER_DURATION,
570570
unit="ms",
571-
description="measures the duration of the inbound HTTP request",
571+
description="Measures the duration of inbound HTTP requests.",
572572
)
573573
duration_histogram_new = None
574574
if _report_new(_InstrumentedFlask._sem_conv_opt_in_mode):
575575
duration_histogram_new = meter.create_histogram(
576576
name=HTTP_SERVER_REQUEST_DURATION,
577577
unit="s",
578-
description="measures the duration of the inbound HTTP request",
578+
description="Duration of HTTP server requests.",
579579
)
580580
active_requests_counter = meter.create_up_down_counter(
581581
name=MetricInstruments.HTTP_SERVER_ACTIVE_REQUESTS,
@@ -701,14 +701,14 @@ def instrument_app(
701701
duration_histogram_old = meter.create_histogram(
702702
name=MetricInstruments.HTTP_SERVER_DURATION,
703703
unit="ms",
704-
description="measures the duration of the inbound HTTP request",
704+
description="Measures the duration of inbound HTTP requests.",
705705
)
706706
duration_histogram_new = None
707707
if _report_new(sem_conv_opt_in_mode):
708708
duration_histogram_new = meter.create_histogram(
709709
name=HTTP_SERVER_REQUEST_DURATION,
710710
unit="s",
711-
description="measures the duration of the inbound HTTP request",
711+
description="Duration of HTTP server requests.",
712712
)
713713
active_requests_counter = meter.create_up_down_counter(
714714
name=MetricInstruments.HTTP_SERVER_ACTIVE_REQUESTS,

instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/callbacks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def trace_tween_factory(handler, registry):
141141
duration_histogram = meter.create_histogram(
142142
name=MetricInstruments.HTTP_SERVER_DURATION,
143143
unit="ms",
144-
description="Duration of HTTP server requests.",
144+
description="Measures the duration of inbound HTTP requests.",
145145
)
146146
active_requests_counter = meter.create_up_down_counter(
147147
name=MetricInstruments.HTTP_SERVER_ACTIVE_REQUESTS,

instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def _create_server_histograms(meter) -> Dict[str, Histogram]:
296296
MetricInstruments.HTTP_SERVER_DURATION: meter.create_histogram(
297297
name=MetricInstruments.HTTP_SERVER_DURATION,
298298
unit="ms",
299-
description="Duration of HTTP server requests.",
299+
description="Measures the duration of inbound HTTP requests.",
300300
),
301301
MetricInstruments.HTTP_SERVER_REQUEST_SIZE: meter.create_histogram(
302302
name=MetricInstruments.HTTP_SERVER_REQUEST_SIZE,

instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,14 +571,14 @@ def __init__(
571571
self.duration_histogram_old = self.meter.create_histogram(
572572
name=MetricInstruments.HTTP_SERVER_DURATION,
573573
unit="ms",
574-
description="measures the duration of the inbound HTTP request",
574+
description="Measures the duration of inbound HTTP requests.",
575575
)
576576
self.duration_histogram_new = None
577577
if _report_new(sem_conv_opt_in_mode):
578578
self.duration_histogram_new = self.meter.create_histogram(
579579
name=HTTP_SERVER_REQUEST_DURATION,
580580
unit="s",
581-
description="measures the duration of the inbound HTTP request",
581+
description="Duration of HTTP server requests.",
582582
)
583583
# We don't need a separate active request counter for old/new semantic conventions
584584
# because the new attributes are a subset of the old attributes

0 commit comments

Comments
 (0)