Skip to content

Commit d7eadce

Browse files
authored
Merge branch 'main' into bump-urllib3-requirements
2 parents d35681d + 840d4bd commit d7eadce

33 files changed

Lines changed: 1198 additions & 245 deletions

File tree

.changelog/4216.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
`opentelemetry-instrumentation-aws-lambda`: fix improper handling of header casing

.changelog/4469.added

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
`opentelemetry-instrumentation`: update auto-instrumentation to re-inject instrumentation path after init

.changelog/4481.added

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
`opentelemetry-instrumentation-dbapi`: Add Database client operation duration and returned rows metrics

.changelog/4504.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
`opentelemetry-instrumentation-celery`: clear completed task ids from `task_id_to_start_time`

.changelog/4505.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
`opentelemetry-instrumentation-celery`: add null guards and type-safe helper handling around Celery context propagation internals

.changelog/4583.changed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
`opentelemetry-instrumentation-{urllib,urllib3,requests}`: switch http mock library from abandoned httpretty to mocket

.github/workflows/test.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5534,6 +5534,44 @@ jobs:
55345534
- name: Run tests
55355535
run: tox -e py313-test-instrumentation-urllib3-1 -- -ra
55365536

5537+
py314-test-instrumentation-urllib3-0_ubuntu-latest:
5538+
name: instrumentation-urllib3-0 3.14 Ubuntu
5539+
runs-on: ubuntu-latest
5540+
timeout-minutes: 30
5541+
steps:
5542+
- name: Checkout repo @ SHA - ${{ github.sha }}
5543+
uses: actions/checkout@v4
5544+
5545+
- name: Set up Python 3.14
5546+
uses: actions/setup-python@v5
5547+
with:
5548+
python-version: "3.14"
5549+
5550+
- name: Install tox
5551+
run: pip install tox-uv
5552+
5553+
- name: Run tests
5554+
run: tox -e py314-test-instrumentation-urllib3-0 -- -ra
5555+
5556+
py314-test-instrumentation-urllib3-1_ubuntu-latest:
5557+
name: instrumentation-urllib3-1 3.14 Ubuntu
5558+
runs-on: ubuntu-latest
5559+
timeout-minutes: 30
5560+
steps:
5561+
- name: Checkout repo @ SHA - ${{ github.sha }}
5562+
uses: actions/checkout@v4
5563+
5564+
- name: Set up Python 3.14
5565+
uses: actions/setup-python@v5
5566+
with:
5567+
python-version: "3.14"
5568+
5569+
- name: Install tox
5570+
run: pip install tox-uv
5571+
5572+
- name: Run tests
5573+
run: tox -e py314-test-instrumentation-urllib3-1 -- -ra
5574+
55375575
pypy3-test-instrumentation-urllib3-0_ubuntu-latest:
55385576
name: instrumentation-urllib3-0 pypy-3.10 Ubuntu
55395577
runs-on: ubuntu-latest

dev-requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
pylint==4.0.5
2-
httpretty==1.1.4
32
pyright==v1.1.404
43
sphinx==7.1.2
54
sphinx-rtd-theme==2.0.0rc4

docs/nitpick-exceptions.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ py-class=
3232
httpx.URL
3333
httpx.Headers
3434
aiohttp.web_request.Request
35+
celery.worker.request.Request
3536
yarl.URL
3637
cimpl.Producer
3738
cimpl.Consumer

instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def custom_event_context_extractor(lambda_event):
7373
from opentelemetry.context.context import Context
7474
from opentelemetry.instrumentation.aws_lambda.package import _instruments
7575
from opentelemetry.instrumentation.aws_lambda.version import __version__
76+
from opentelemetry.instrumentation.cidict import CIDict
7677
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
7778
from opentelemetry.instrumentation.utils import unwrap
7879
from opentelemetry.metrics import MeterProvider, get_meter_provider
@@ -165,7 +166,9 @@ def _default_event_context_extractor(lambda_event: Any) -> Context:
165166
)
166167
if not isinstance(headers, dict):
167168
headers = {}
168-
return get_global_textmap().extract(headers)
169+
return get_global_textmap().extract(
170+
CIDict(headers),
171+
)
169172

170173

171174
def _determine_parent_context(
@@ -205,20 +208,21 @@ def _set_api_gateway_v1_proxy_attributes(
205208
span.set_attribute(HTTP_METHOD, lambda_event.get("httpMethod"))
206209

207210
if lambda_event.get("headers"):
208-
if "User-Agent" in lambda_event["headers"]:
211+
headers = CIDict(lambda_event["headers"])
212+
if "User-Agent" in headers:
209213
span.set_attribute(
210214
HTTP_USER_AGENT,
211-
lambda_event["headers"]["User-Agent"],
215+
headers["User-Agent"],
212216
)
213-
if "X-Forwarded-Proto" in lambda_event["headers"]:
217+
if "X-Forwarded-Proto" in headers:
214218
span.set_attribute(
215219
HTTP_SCHEME,
216-
lambda_event["headers"]["X-Forwarded-Proto"],
220+
headers["X-Forwarded-Proto"],
217221
)
218-
if "Host" in lambda_event["headers"]:
222+
if "Host" in headers:
219223
span.set_attribute(
220224
NET_HOST_NAME,
221-
lambda_event["headers"]["Host"],
225+
headers["Host"],
222226
)
223227
if "resource" in lambda_event:
224228
span.set_attribute(HTTP_ROUTE, lambda_event["resource"])

0 commit comments

Comments
 (0)