Fix description of http.server.duration and http.server.request.duration (#2817)

* fix httpserverduration and httpserverrequestduration

Signed-off-by: Steven Pan <jianqiao.pan@fmr.com>

* add change log

---------

Signed-off-by: Steven Pan <jianqiao.pan@fmr.com>
This commit is contained in:
JianQiao
2024-08-30 18:42:33 +08:00
committed by GitHub
parent f7878e7613
commit 98958b6f1e
9 changed files with 14 additions and 12 deletions

View File

@ -46,6 +46,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#2563](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2563))
- `opentelemetry-instrumentation` fix `http.host` new http semantic convention mapping to depend on `kind` of span
([#2814](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2814))
- `opentelemetry-instrumentation` Fix the description of `http.server.duration` and `http.server.request.duration`
([#2753](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2753))
## Version 1.26.0/0.47b0 (2024-07-23)

View File

@ -207,7 +207,7 @@ async def middleware(request, handler):
duration_histogram = meter.create_histogram(
name=MetricInstruments.HTTP_SERVER_DURATION,
unit="ms",
description="Duration of HTTP server requests.",
description="Measures the duration of inbound HTTP requests.",
)
active_requests_counter = meter.create_up_down_counter(

View File

@ -579,7 +579,7 @@ class OpenTelemetryMiddleware:
self.duration_histogram_old = self.meter.create_histogram(
name=MetricInstruments.HTTP_SERVER_DURATION,
unit="ms",
description="Duration of HTTP server requests.",
description="Measures the duration of inbound HTTP requests.",
)
self.duration_histogram_new = None
if _report_new(sem_conv_opt_in_mode):

View File

@ -344,7 +344,7 @@ class DjangoInstrumentor(BaseInstrumentor):
_DjangoMiddleware._duration_histogram_old = meter.create_histogram(
name=MetricInstruments.HTTP_SERVER_DURATION,
unit="ms",
description="Duration of HTTP server requests.",
description="Measures the duration of inbound HTTP requests.",
)
_DjangoMiddleware._duration_histogram_new = None
if _report_new(sem_conv_opt_in_mode):

View File

@ -268,7 +268,7 @@ class _InstrumentedFalconAPI(getattr(falcon, _instrument_app)):
self.duration_histogram = self._otel_meter.create_histogram(
name=MetricInstruments.HTTP_SERVER_DURATION,
unit="ms",
description="Duration of HTTP server requests.",
description="Measures the duration of inbound HTTP requests.",
)
self.active_requests_counter = self._otel_meter.create_up_down_counter(
name=MetricInstruments.HTTP_SERVER_ACTIVE_REQUESTS,

View File

@ -568,14 +568,14 @@ class _InstrumentedFlask(flask.Flask):
duration_histogram_old = meter.create_histogram(
name=MetricInstruments.HTTP_SERVER_DURATION,
unit="ms",
description="measures the duration of the inbound HTTP request",
description="Measures the duration of inbound HTTP requests.",
)
duration_histogram_new = None
if _report_new(_InstrumentedFlask._sem_conv_opt_in_mode):
duration_histogram_new = meter.create_histogram(
name=HTTP_SERVER_REQUEST_DURATION,
unit="s",
description="measures the duration of the inbound HTTP request",
description="Duration of HTTP server requests.",
)
active_requests_counter = meter.create_up_down_counter(
name=MetricInstruments.HTTP_SERVER_ACTIVE_REQUESTS,
@ -701,14 +701,14 @@ class FlaskInstrumentor(BaseInstrumentor):
duration_histogram_old = meter.create_histogram(
name=MetricInstruments.HTTP_SERVER_DURATION,
unit="ms",
description="measures the duration of the inbound HTTP request",
description="Measures the duration of inbound HTTP requests.",
)
duration_histogram_new = None
if _report_new(sem_conv_opt_in_mode):
duration_histogram_new = meter.create_histogram(
name=HTTP_SERVER_REQUEST_DURATION,
unit="s",
description="measures the duration of the inbound HTTP request",
description="Duration of HTTP server requests.",
)
active_requests_counter = meter.create_up_down_counter(
name=MetricInstruments.HTTP_SERVER_ACTIVE_REQUESTS,

View File

@ -141,7 +141,7 @@ def trace_tween_factory(handler, registry):
duration_histogram = meter.create_histogram(
name=MetricInstruments.HTTP_SERVER_DURATION,
unit="ms",
description="Duration of HTTP server requests.",
description="Measures the duration of inbound HTTP requests.",
)
active_requests_counter = meter.create_up_down_counter(
name=MetricInstruments.HTTP_SERVER_ACTIVE_REQUESTS,

View File

@ -296,7 +296,7 @@ def _create_server_histograms(meter) -> Dict[str, Histogram]:
MetricInstruments.HTTP_SERVER_DURATION: meter.create_histogram(
name=MetricInstruments.HTTP_SERVER_DURATION,
unit="ms",
description="Duration of HTTP server requests.",
description="Measures the duration of inbound HTTP requests.",
),
MetricInstruments.HTTP_SERVER_REQUEST_SIZE: meter.create_histogram(
name=MetricInstruments.HTTP_SERVER_REQUEST_SIZE,

View File

@ -571,14 +571,14 @@ class OpenTelemetryMiddleware:
self.duration_histogram_old = self.meter.create_histogram(
name=MetricInstruments.HTTP_SERVER_DURATION,
unit="ms",
description="measures the duration of the inbound HTTP request",
description="Measures the duration of inbound HTTP requests.",
)
self.duration_histogram_new = None
if _report_new(sem_conv_opt_in_mode):
self.duration_histogram_new = self.meter.create_histogram(
name=HTTP_SERVER_REQUEST_DURATION,
unit="s",
description="measures the duration of the inbound HTTP request",
description="Duration of HTTP server requests.",
)
# We don't need a separate active request counter for old/new semantic conventions
# because the new attributes are a subset of the old attributes