Skip to content

Commit

Permalink
fix httpserverduration and httpserverrequestduration
Browse files Browse the repository at this point in the history
Signed-off-by: Steven Pan <jianqiao.pan@fmr.com>
  • Loading branch information
StevenPenn committed Aug 20, 2024
1 parent 2a707bc commit 8f15c40
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ def __init__(
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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def _instrument(self, **kwargs):
_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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def __init__(self, *args, **kwargs):
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,14 +568,14 @@ def __init__(self, *args, **kwargs):
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,
Expand Down Expand Up @@ -701,14 +701,14 @@ def instrument_app(
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -571,14 +571,14 @@ def __init__(
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
Expand Down

0 comments on commit 8f15c40

Please sign in to comment.