Skip to content

Commit

Permalink
Patch opentelemetry-python-contrib
Browse files Browse the repository at this point in the history
  • Loading branch information
dkliban committed May 10, 2024
1 parent d5df53b commit 23452b3
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,10 @@ RUN chown :root /var/lib/pulp/{scripts,media,tmp,assets}

RUN dnf install -y patch && dnf clean all

COPY images/assets/otel-aiohttp.patch /tmp/otel-aiohttp.patch
RUN patch -p1 -d /usr/local/lib/python3.9/site-packages/ < /tmp/otel-aiohttp.patch || /bin/true

COPY images/assets/otel-aiohttp.patch /tmp/otel-django.patch
RUN patch -p1 -d /usr/local/lib/python3.9/site-packages/ < /tmp/otel-django.patch || /bin/true

EXPOSE 80
13 changes: 13 additions & 0 deletions images/assets/otel-aiohttp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/__init__.py b/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/__init__.py
index c1ab960818..0cf8599b15 100644
--- a/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/__init__.py
+++ b/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/__init__.py
@@ -213,7 +213,7 @@ async def middleware(request, handler):
active_requests_counter = meter.create_up_down_counter(
name=MetricInstruments.HTTP_SERVER_ACTIVE_REQUESTS,
unit="requests",
- description="measures the number of concurrent HTTP requests those are currently in flight",
+ description="measures the number of concurrent HTTP requests that are currently in-flight",
)

with tracer.start_as_current_span(
13 changes: 13 additions & 0 deletions images/assets/otel-django.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py
index 37ac760283..b0b73168b3 100644
--- a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py
+++ b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py
@@ -327,7 +327,7 @@ def _instrument(self, **kwargs):
_DjangoMiddleware._active_request_counter = meter.create_up_down_counter(
name=MetricInstruments.HTTP_SERVER_ACTIVE_REQUESTS,
unit="requests",
- description="measures the number of concurrent HTTP requests those are currently in flight",
+ description="measures the number of concurrent HTTP requests that are currently in-flight",
)
# This can not be solved, but is an inherent problem of this approach:
# the order of middleware entries matters, and here you have no control

0 comments on commit 23452b3

Please sign in to comment.