Skip to content

python3Packages.opentelemetry-{api, instrumentation}: bump#498050

Open
CertainLach wants to merge 3 commits into
NixOS:stagingfrom
CertainLach:push-uukwxwnrqqnk
Open

python3Packages.opentelemetry-{api, instrumentation}: bump#498050
CertainLach wants to merge 3 commits into
NixOS:stagingfrom
CertainLach:push-uukwxwnrqqnk

Conversation

@CertainLach
Copy link
Copy Markdown
Member

Supersedes: #489017

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

@CertainLach CertainLach changed the base branch from master to staging March 8, 2026 22:19
@nixpkgs-ci nixpkgs-ci Bot closed this Mar 8, 2026
@nixpkgs-ci nixpkgs-ci Bot reopened this Mar 8, 2026
@nixpkgs-ci nixpkgs-ci Bot requested a review from natsukium March 8, 2026 22:25
@nixpkgs-ci nixpkgs-ci Bot added 8.has: package (update) This PR updates a package to a newer version 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux: 2501-5000 This PR causes many rebuilds on Linux and should target the staging branches. 10.rebuild-darwin: 2501-5000 This PR causes many rebuilds on Darwin and should target the staging branches. 6.topic: python Python is a high-level, general-purpose programming language. labels Mar 8, 2026
@CertainLach CertainLach mentioned this pull request Mar 8, 2026
13 tasks
@CertainLach
Copy link
Copy Markdown
Member Author

Cc: @sinrohit-desco @DanielNoord (from the original PR)

@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Mar 9, 2026
@DanielNoord
Copy link
Copy Markdown

@natsukium as maintainer, any chance we could merge this?

@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Mar 12, 2026
@DanielNoord
Copy link
Copy Markdown

@natsukium gentle ping :)

@stefanboca
Copy link
Copy Markdown
Contributor

stefanboca commented Apr 8, 2026

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 498050 --package-regex python313Packages\.opentelemetry.*
Commit: ca8c9c59791522eb5f69fd469445d5a44fd1730a


x86_64-linux

❌ 10 packages failed to build:
  • python313Packages.opentelemetry-instrumentation-botocore
  • python313Packages.opentelemetry-instrumentation-botocore.dist
  • python313Packages.opentelemetry-instrumentation-celery
  • python313Packages.opentelemetry-instrumentation-celery.dist
  • python313Packages.opentelemetry-instrumentation-fastapi
  • python313Packages.opentelemetry-instrumentation-fastapi.dist
  • python313Packages.opentelemetry-instrumentation-logging
  • python313Packages.opentelemetry-instrumentation-logging.dist
  • python313Packages.opentelemetry-instrumentation-requests
  • python313Packages.opentelemetry-instrumentation-requests.dist
✅ 60 packages built:
  • python313Packages.opentelemetry-api
  • python313Packages.opentelemetry-api.dist
  • python313Packages.opentelemetry-distro
  • python313Packages.opentelemetry-distro.dist
  • python313Packages.opentelemetry-exporter-otlp
  • python313Packages.opentelemetry-exporter-otlp-proto-common
  • python313Packages.opentelemetry-exporter-otlp-proto-common.dist
  • python313Packages.opentelemetry-exporter-otlp-proto-grpc
  • python313Packages.opentelemetry-exporter-otlp-proto-grpc.dist
  • python313Packages.opentelemetry-exporter-otlp-proto-http
  • python313Packages.opentelemetry-exporter-otlp-proto-http.dist
  • python313Packages.opentelemetry-exporter-otlp.dist
  • python313Packages.opentelemetry-exporter-prometheus
  • python313Packages.opentelemetry-exporter-prometheus.dist
  • python313Packages.opentelemetry-instrumentation
  • python313Packages.opentelemetry-instrumentation-aiohttp-client
  • python313Packages.opentelemetry-instrumentation-aiohttp-client.dist
  • python313Packages.opentelemetry-instrumentation-asgi
  • python313Packages.opentelemetry-instrumentation-asgi.dist
  • python313Packages.opentelemetry-instrumentation-dbapi
  • python313Packages.opentelemetry-instrumentation-dbapi.dist
  • python313Packages.opentelemetry-instrumentation-django
  • python313Packages.opentelemetry-instrumentation-django.dist
  • python313Packages.opentelemetry-instrumentation-flask
  • python313Packages.opentelemetry-instrumentation-flask.dist
  • python313Packages.opentelemetry-instrumentation-grpc
  • python313Packages.opentelemetry-instrumentation-grpc.dist
  • python313Packages.opentelemetry-instrumentation-httpx
  • python313Packages.opentelemetry-instrumentation-httpx.dist
  • python313Packages.opentelemetry-instrumentation-psycopg2
  • python313Packages.opentelemetry-instrumentation-psycopg2.dist
  • python313Packages.opentelemetry-instrumentation-redis
  • python313Packages.opentelemetry-instrumentation-redis.dist
  • python313Packages.opentelemetry-instrumentation-sqlalchemy
  • python313Packages.opentelemetry-instrumentation-sqlalchemy.dist
  • python313Packages.opentelemetry-instrumentation-sqlite3
  • python313Packages.opentelemetry-instrumentation-sqlite3.dist
  • python313Packages.opentelemetry-instrumentation-system-metrics
  • python313Packages.opentelemetry-instrumentation-system-metrics.dist
  • python313Packages.opentelemetry-instrumentation-threading
  • python313Packages.opentelemetry-instrumentation-threading.dist
  • python313Packages.opentelemetry-instrumentation-urllib3
  • python313Packages.opentelemetry-instrumentation-urllib3.dist
  • python313Packages.opentelemetry-instrumentation-wsgi
  • python313Packages.opentelemetry-instrumentation-wsgi.dist
  • python313Packages.opentelemetry-instrumentation.dist
  • python313Packages.opentelemetry-propagator-aws-xray
  • python313Packages.opentelemetry-propagator-aws-xray.dist
  • python313Packages.opentelemetry-proto
  • python313Packages.opentelemetry-proto.dist
  • python313Packages.opentelemetry-resourcedetector-gcp
  • python313Packages.opentelemetry-resourcedetector-gcp.dist
  • python313Packages.opentelemetry-sdk
  • python313Packages.opentelemetry-sdk.dist
  • python313Packages.opentelemetry-semantic-conventions
  • python313Packages.opentelemetry-semantic-conventions.dist
  • python313Packages.opentelemetry-test-utils
  • python313Packages.opentelemetry-test-utils.dist
  • python313Packages.opentelemetry-util-http
  • python313Packages.opentelemetry-util-http.dist

Error logs: `x86_64-linux`
python313Packages.opentelemetry-instrumentation-botocore
tests/test_botocore_instrumentation.py:112: in assert_span
    self.assertSpanHasAttributes(span, expected)
/nix/store/xg3y4id5438kgdw4dx2rl9z0van22vdp-python3.13-opentelemetry-test-utils-0.61b0/lib/python3.13/site-packages/opentelemetry/test/test_base.py:85: in assertSpanHasAttributes
    self.assertEqual(val, span.attributes[key])
E   AssertionError: 'fdcdcab1-ae5c-489e-9c33-4637c5dda355' != 'request-id'
E   - fdcdcab1-ae5c-489e-9c33-4637c5dda355
E   + request-id
=============================== warnings summary ===============================
../../../../nix/store/wavm4b318kvk7xqy7qfam86i0r8znz1n-python3.13-pytest-9.0.2/lib/python3.13/site-packages/_pytest/cacheprovider.py:475
  /nix/store/wavm4b318kvk7xqy7qfam86i0r8znz1n-python3.13-pytest-9.0.2/lib/python3.13/site-packages/_pytest/cacheprovider.py:475: PytestCacheWarning: could not create cache path /build/source/.pytest_cache/v/cache/nodeids: [Errno 13] Permission denied: '/build/source/pytest-cache-files-u7xoiqbk'
    config.cache.set("cache/nodeids", sorted(self.cached_nodeids))

../../../../nix/store/wavm4b318kvk7xqy7qfam86i0r8znz1n-python3.13-pytest-9.0.2/lib/python3.13/site-packages/_pytest/cacheprovider.py:429
/nix/store/wavm4b318kvk7xqy7qfam86i0r8znz1n-python3.13-pytest-9.0.2/lib/python3.13/site-packages/_pytest/cacheprovider.py:429: PytestCacheWarning: could not create cache path /build/source/.pytest_cache/v/cache/lastfailed: [Errno 13] Permission denied: '/build/source/pytest-cache-files-nt44k4ka'
config.cache.set("cache/lastfailed", self.lastfailed)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
SKIPPED [1] tests/test_botocore_lambda.py:128: Docker error, unblocking builds for now.
= 3 failed, 128 passed, 1 skipped, 1 deselected, 2 warnings, 3 subtests passed in 8.42s =

python313Packages.opentelemetry-instrumentation-fastapi
E       AssertionError: fastapi_middleware_astack not found in request scope

/nix/store/fp9gbvfybsvfik2mjj7mxzjssg01dwx6-python3.13-fastapi-0.128.0/lib/python3.13/site-packages/fastapi/routing.py:274: AssertionError
------------------------------ Captured log call -------------------------------
ERROR opentelemetry.instrumentation.fastapi:init.py:336 Skipping FastAPI instrumentation due to unexpected middleware stack: expected ServerErrorMiddleware, got <class 'fastapi.routing.APIRouter'>
=============================== warnings summary ===============================
../../../../nix/store/wavm4b318kvk7xqy7qfam86i0r8znz1n-python3.13-pytest-9.0.2/lib/python3.13/site-packages/_pytest/cacheprovider.py:475
/nix/store/wavm4b318kvk7xqy7qfam86i0r8znz1n-python3.13-pytest-9.0.2/lib/python3.13/site-packages/_pytest/cacheprovider.py:475: PytestCacheWarning: could not create cache path /build/source/.pytest_cache/v/cache/nodeids: [Errno 13] Permission denied: '/build/source/pytest-cache-files-1gl10u1y'
config.cache.set("cache/nodeids", sorted(self.cached_nodeids))

../../../../nix/store/wavm4b318kvk7xqy7qfam86i0r8znz1n-python3.13-pytest-9.0.2/lib/python3.13/site-packages/_pytest/cacheprovider.py:429
/nix/store/wavm4b318kvk7xqy7qfam86i0r8znz1n-python3.13-pytest-9.0.2/lib/python3.13/site-packages/_pytest/cacheprovider.py:429: PytestCacheWarning: could not create cache path /build/source/.pytest_cache/v/cache/lastfailed: [Errno 13] Permission denied: '/build/source/pytest-cache-files-fxwdm1ac'
config.cache.set("cache/lastfailed", self.lastfailed)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
SKIPPED [4] ../../../../nix/store/wavm4b318kvk7xqy7qfam86i0r8znz1n-python3.13-pytest-9.0.2/lib/python3.13/site-packages/_pytest/unittest.py:498: TestBaseManualFastAPI is an abstract base class
SKIPPED [1] ../../../../nix/store/wavm4b318kvk7xqy7qfam86i0r8znz1n-python3.13-pytest-9.0.2/lib/python3.13/site-packages/_pytest/unittest.py:498: TestBaseAutoFastAPI is an abstract base class
SKIPPED [1] tests/test_fastapi_instrumentation.py:2386: Use test_fastapi_unhandled_exception_both_semconv instead
=== 1 failed, 97 passed, 6 skipped, 2 warnings, 12 subtests passed in 1.44s ====

python313Packages.opentelemetry-instrumentation-logging
>       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, capteesys, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, subtests, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

/build/source/instrumentation/opentelemetry-instrumentation-logging/benchmarks/test_benchmark_logging_handler.py:42
=============================== warnings summary ===============================
instrumentation/opentelemetry-instrumentation-logging/tests/test_handler.py::TestLoggingHandler::test_logging_handler_without_env_var_uses_default_limit
instrumentation/opentelemetry-instrumentation-logging/tests/test_handler.py::TestLoggingHandler::test_otel_attribute_count_limit_includes_code_attributes
instrumentation/opentelemetry-instrumentation-logging/tests/test_handler.py::TestLoggingHandler::test_otel_attribute_count_limit_respected_in_logging_handler
<string>:7: LogRecordDroppedAttributesWarning: Log record attributes were dropped due to limits

../../../../nix/store/wavm4b318kvk7xqy7qfam86i0r8znz1n-python3.13-pytest-9.0.2/lib/python3.13/site-packages/_pytest/cacheprovider.py:475
/nix/store/wavm4b318kvk7xqy7qfam86i0r8znz1n-python3.13-pytest-9.0.2/lib/python3.13/site-packages/_pytest/cacheprovider.py:475: PytestCacheWarning: could not create cache path /build/source/.pytest_cache/v/cache/nodeids: [Errno 13] Permission denied: '/build/source/pytest-cache-files-8iiw5dxn'
config.cache.set("cache/nodeids", sorted(self.cached_nodeids))

../../../../nix/store/wavm4b318kvk7xqy7qfam86i0r8znz1n-python3.13-pytest-9.0.2/lib/python3.13/site-packages/_pytest/cacheprovider.py:429
/nix/store/wavm4b318kvk7xqy7qfam86i0r8znz1n-python3.13-pytest-9.0.2/lib/python3.13/site-packages/_pytest/cacheprovider.py:429: PytestCacheWarning: could not create cache path /build/source/.pytest_cache/v/cache/lastfailed: [Errno 13] Permission denied: '/build/source/pytest-cache-files-ef4x_7rw'
config.cache.set("cache/lastfailed", self.lastfailed)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=================== 45 passed, 5 warnings, 4 errors in 0.28s ===================

python313Packages.opentelemetry-instrumentation-requests
        )
E       AssertionError: mappingproxy({'http.method': 'GET', 'http[134 chars]o!'}) != {'http.method': 'GET', 'http.url': 'http:[120 chars]2.3'}

tests/test_requests_integration.py:548: AssertionError
=============================== warnings summary ===============================
instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py: 62 warnings
instrumentation/opentelemetry-instrumentation-requests/tests/test_user_agent_synthetic.py: 12 warnings
/nix/store/3054iyfz50i5ivbbqa8jqiw4fidc4xwk-python3.13-httpretty-1.1.4/lib/python3.13/site-packages/httpretty/core.py:1080: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
now = datetime.utcnow()

../../../../nix/store/wavm4b318kvk7xqy7qfam86i0r8znz1n-python3.13-pytest-9.0.2/lib/python3.13/site-packages/_pytest/cacheprovider.py:475
/nix/store/wavm4b318kvk7xqy7qfam86i0r8znz1n-python3.13-pytest-9.0.2/lib/python3.13/site-packages/_pytest/cacheprovider.py:475: PytestCacheWarning: could not create cache path /build/source/.pytest_cache/v/cache/nodeids: [Errno 13] Permission denied: '/build/source/pytest-cache-files-hte576a9'
config.cache.set("cache/nodeids", sorted(self.cached_nodeids))

../../../../nix/store/wavm4b318kvk7xqy7qfam86i0r8znz1n-python3.13-pytest-9.0.2/lib/python3.13/site-packages/_pytest/cacheprovider.py:429
/nix/store/wavm4b318kvk7xqy7qfam86i0r8znz1n-python3.13-pytest-9.0.2/lib/python3.13/site-packages/_pytest/cacheprovider.py:429: PytestCacheWarning: could not create cache path /build/source/.pytest_cache/v/cache/lastfailed: [Errno 13] Permission denied: '/build/source/pytest-cache-files-cb0j36_e'
config.cache.set("cache/lastfailed", self.lastfailed)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================== 22 failed, 58 passed, 76 warnings in 1.62s ==================

@DanielNoord
Copy link
Copy Markdown

@stefanboca What is needed for this to get merged?

@stefanboca
Copy link
Copy Markdown
Contributor

I'm not a maintainer so I can't really say :)

I guess I should have explained this when I posted my nixpkgs-review. I was trying to build #498040 when I ran into issues because the check phase of the openapi-integrations-.* packages was failing. I haven't looked into the failed tests.

I just tested again after rebasing on nixos-unstable (so I don't have to compile half the universe) and they're still failing. I realize that my nixpkgs-review didn't include the whole log output, so I've included one here. The other packages have similar test failiures.

nix log /nix/store/xrc09ni4fdg4zhf1nc461pllis49p5rc-python3.13-opentelemetry-instrumentation-requests-0.61b0.drv
Sourcing python-remove-tests-dir-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing pypa-build-hook
Using pypaBuildPhase
Sourcing python-runtime-deps-check-hook
Using pythonRuntimeDepsCheckHook
Sourcing pypa-install-hook
Using pypaInstallPhase
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
Sourcing python-namespaces-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing pytest-check-hook
Using pytestCheckPhase
Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/yvg45a2hy4yjl8ng7lvsc4ckjp4lpnny-source
source root is source/instrumentation/opentelemetry-instrumentation-requests
setting SOURCE_DATE_EPOCH to timestamp 315619200 of file "source/instrumentation/opentelemetry-instrumentation-requests/tests/test_user_agent_synthetic.py"
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
no configure script, doing nothing
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
Executing pypaBuildPhase
Creating a wheel...
pypa build flags: --no-isolation --outdir dist/ --wheel
* Getting build dependencies for wheel...
* Building wheel...
Successfully built opentelemetry_instrumentation_requests-0.61b0-py3-none-any.whl
Finished creating a wheel...
Finished executing pypaBuildPhase
Running phase: pythonRuntimeDepsCheckHook
@nix { "action": "setPhase", "phase": "pythonRuntimeDepsCheckHook" }
Executing pythonRuntimeDepsCheck
Checking runtime dependencies for opentelemetry_instrumentation_requests-0.61b0-py3-none-any.whl
Finished executing pythonRuntimeDepsCheck
Running phase: installPhase
@nix { "action": "setPhase", "phase": "installPhase" }
Executing pypaInstallPhase
Successfully installed opentelemetry_instrumentation_requests-0.61b0-py3-none-any.whl
Finished executing pypaInstallPhase
Running phase: pythonOutputDistPhase
@nix { "action": "setPhase", "phase": "pythonOutputDistPhase" }
Executing pythonOutputDistPhase
Finished executing pythonOutputDistPhase
Running phase: fixupPhase
@nix { "action": "setPhase", "phase": "fixupPhase" }
shrinking RPATHs of ELF executables and libraries in /nix/store/rzz9a57d422xhci9nsqch15y066vipi7-python3.13-opentelemetry-instrumentation-requests-0.61b0
checking for references to /build/ in /nix/store/rzz9a57d422xhci9nsqch15y066vipi7-python3.13-opentelemetry-instrumentation-requests-0.61b0...
patching script interpreter paths in /nix/store/rzz9a57d422xhci9nsqch15y066vipi7-python3.13-opentelemetry-instrumentation-requests-0.61b0
stripping (with command strip and flags -S -p) in  /nix/store/rzz9a57d422xhci9nsqch15y066vipi7-python3.13-opentelemetry-instrumentation-requests-0.61b0/lib
shrinking RPATHs of ELF executables and libraries in /nix/store/1l9blbxxrsjdi18x2zp5aii21p4wfhaw-python3.13-opentelemetry-instrumentation-requests-0.61b0-dist
checking for references to /build/ in /nix/store/1l9blbxxrsjdi18x2zp5aii21p4wfhaw-python3.13-opentelemetry-instrumentation-requests-0.61b0-dist...
patching script interpreter paths in /nix/store/1l9blbxxrsjdi18x2zp5aii21p4wfhaw-python3.13-opentelemetry-instrumentation-requests-0.61b0-dist
Executing pythonRemoveTestsDir
Finished executing pythonRemoveTestsDir
Running phase: installCheckPhase
@nix { "action": "setPhase", "phase": "installCheckPhase" }
no Makefile or custom installCheckPhase, doing nothing
Running phase: pythonCatchConflictsPhase
@nix { "action": "setPhase", "phase": "pythonCatchConflictsPhase" }
Running phase: pythonRemoveBinBytecodePhase
@nix { "action": "setPhase", "phase": "pythonRemoveBinBytecodePhase" }
Running phase: pythonImportsCheckPhase
@nix { "action": "setPhase", "phase": "pythonImportsCheckPhase" }
Executing pythonImportsCheckPhase
Check whether the following modules can be imported: opentelemetry.instrumentation.requests
Running phase: pytestCheckPhase
@nix { "action": "setPhase", "phase": "pytestCheckPhase" }
Executing pytestCheckPhase
pytest flags: -m pytest
============================= test session starts ==============================
platform linux -- Python 3.13.12, pytest-9.0.2, pluggy-1.6.0 -- /nix/store/pzdalg368npikvpq4ncz2saxnz19v53k-python3-3.13.12/bin/python3.13
cachedir: .pytest_cache
rootdir: /build/source
configfile: pytest.ini
collected 80 items

tests/test_requests_integration.py::TestRequestsIntegration::test_adapter_with_custom_response FAILED [  1%]
tests/test_requests_integration.py::TestRequestsIntegration::test_basic FAILED [  2%]
tests/test_requests_integration.py::TestRequestsIntegration::test_basic_both_semconv FAILED [  3%]
tests/test_requests_integration.py::TestRequestsIntegration::test_basic_new_semconv FAILED [  5%]
tests/test_requests_integration.py::TestRequestsIntegration::test_custom_headers_case_insensitive PASSED [  6%]
tests/test_requests_integration.py::TestRequestsIntegration::test_custom_headers_not_captured_when_not_configured PASSED [  7%]
tests/test_requests_integration.py::TestRequestsIntegration::test_custom_headers_with_regex PASSED [  8%]
tests/test_requests_integration.py::TestRequestsIntegration::test_custom_request_headers_captured PASSED [ 10%]
tests/test_requests_integration.py::TestRequestsIntegration::test_custom_response_headers_captured PASSED [ 11%]
tests/test_requests_integration.py::TestRequestsIntegration::test_custom_tracer_provider PASSED [ 12%]
tests/test_requests_integration.py::TestRequestsIntegration::test_distributed_context PASSED [ 13%]
tests/test_requests_integration.py::TestRequestsIntegration::test_excluded_urls_explicit PASSED [ 15%]
tests/test_requests_integration.py::TestRequestsIntegration::test_excluded_urls_from_env PASSED [ 16%]
tests/test_requests_integration.py::TestRequestsIntegration::test_hooks PASSED [ 17%]
tests/test_requests_integration.py::TestRequestsIntegration::test_if_headers_equals_none PASSED [ 18%]
tests/test_requests_integration.py::TestRequestsIntegration::test_name_callback_default PASSED [ 20%]
tests/test_requests_integration.py::TestRequestsIntegration::test_nonstandard_http_method FAILED [ 21%]
tests/test_requests_integration.py::TestRequestsIntegration::test_nonstandard_http_method_new_semconv FAILED [ 22%]
tests/test_requests_integration.py::TestRequestsIntegration::test_not_foundbasic PASSED [ 23%]
tests/test_requests_integration.py::TestRequestsIntegration::test_not_foundbasic_both_semconv PASSED [ 25%]
tests/test_requests_integration.py::TestRequestsIntegration::test_not_foundbasic_new_semconv PASSED [ 26%]
tests/test_requests_integration.py::TestRequestsIntegration::test_not_recording PASSED [ 27%]
tests/test_requests_integration.py::TestRequestsIntegration::test_remove_sensitive_params PASSED [ 28%]
tests/test_requests_integration.py::TestRequestsIntegration::test_requests_basic_exception PASSED [ 30%]
tests/test_requests_integration.py::TestRequestsIntegration::test_requests_exception_new_semconv FAILED [ 31%]
tests/test_requests_integration.py::TestRequestsIntegration::test_requests_exception_with_response FAILED [ 32%]
tests/test_requests_integration.py::TestRequestsIntegration::test_requests_exception_without_proper_response_type FAILED [ 33%]
tests/test_requests_integration.py::TestRequestsIntegration::test_requests_exception_without_response FAILED [ 35%]
tests/test_requests_integration.py::TestRequestsIntegration::test_requests_timeout_exception PASSED [ 36%]
tests/test_requests_integration.py::TestRequestsIntegration::test_response_hook FAILED [ 37%]
tests/test_requests_integration.py::TestRequestsIntegration::test_sensitive_headers_sanitized PASSED [ 38%]
tests/test_requests_integration.py::TestRequestsIntegration::test_suppress_http_instrumentation PASSED [ 40%]
tests/test_requests_integration.py::TestRequestsIntegration::test_suppress_instrumentation PASSED [ 41%]
tests/test_requests_integration.py::TestRequestsIntegration::test_uninstrument PASSED [ 42%]
tests/test_requests_integration.py::TestRequestsIntegration::test_uninstrument_session PASSED [ 43%]
tests/test_requests_integration.py::TestRequestsIntegrationPreparedRequest::test_adapter_with_custom_response FAILED [ 45%]
tests/test_requests_integration.py::TestRequestsIntegrationPreparedRequest::test_basic FAILED [ 46%]
tests/test_requests_integration.py::TestRequestsIntegrationPreparedRequest::test_basic_both_semconv FAILED [ 47%]
tests/test_requests_integration.py::TestRequestsIntegrationPreparedRequest::test_basic_new_semconv FAILED [ 48%]
tests/test_requests_integration.py::TestRequestsIntegrationPreparedRequest::test_custom_tracer_provider PASSED [ 50%]
tests/test_requests_integration.py::TestRequestsIntegrationPreparedRequest::test_distributed_context PASSED [ 51%]
tests/test_requests_integration.py::TestRequestsIntegrationPreparedRequest::test_excluded_urls_explicit PASSED [ 52%]
tests/test_requests_integration.py::TestRequestsIntegrationPreparedRequest::test_excluded_urls_from_env PASSED [ 53%]
tests/test_requests_integration.py::TestRequestsIntegrationPreparedRequest::test_hooks PASSED [ 55%]
tests/test_requests_integration.py::TestRequestsIntegrationPreparedRequest::test_name_callback_default PASSED [ 56%]
tests/test_requests_integration.py::TestRequestsIntegrationPreparedRequest::test_nonstandard_http_method FAILED [ 57%]
tests/test_requests_integration.py::TestRequestsIntegrationPreparedRequest::test_nonstandard_http_method_new_semconv FAILED [ 58%]
tests/test_requests_integration.py::TestRequestsIntegrationPreparedRequest::test_not_foundbasic PASSED [ 60%]
tests/test_requests_integration.py::TestRequestsIntegrationPreparedRequest::test_not_foundbasic_both_semconv PASSED [ 61%]
tests/test_requests_integration.py::TestRequestsIntegrationPreparedRequest::test_not_foundbasic_new_semconv PASSED [ 62%]
tests/test_requests_integration.py::TestRequestsIntegrationPreparedRequest::test_not_recording PASSED [ 63%]
tests/test_requests_integration.py::TestRequestsIntegrationPreparedRequest::test_requests_basic_exception PASSED [ 65%]
tests/test_requests_integration.py::TestRequestsIntegrationPreparedRequest::test_requests_exception_new_semconv FAILED [ 66%]
tests/test_requests_integration.py::TestRequestsIntegrationPreparedRequest::test_requests_exception_with_response FAILED [ 67%]
tests/test_requests_integration.py::TestRequestsIntegrationPreparedRequest::test_requests_exception_without_proper_response_type FAILED [ 68%]
tests/test_requests_integration.py::TestRequestsIntegrationPreparedRequest::test_requests_exception_without_response FAILED [ 70%]
tests/test_requests_integration.py::TestRequestsIntegrationPreparedRequest::test_requests_timeout_exception PASSED [ 71%]
tests/test_requests_integration.py::TestRequestsIntegrationPreparedRequest::test_response_hook FAILED [ 72%]
tests/test_requests_integration.py::TestRequestsIntegrationPreparedRequest::test_suppress_http_instrumentation PASSED [ 73%]
tests/test_requests_integration.py::TestRequestsIntegrationPreparedRequest::test_suppress_instrumentation PASSED [ 75%]
tests/test_requests_integration.py::TestRequestsIntegrationPreparedRequest::test_uninstrument PASSED [ 76%]
tests/test_requests_integration.py::TestRequestsIntegrationPreparedRequest::test_uninstrument_session PASSED [ 77%]
tests/test_requests_integration.py::TestRequestsIntergrationMetric::test_basic_metric_both_semconv PASSED [ 78%]
tests/test_requests_integration.py::TestRequestsIntergrationMetric::test_basic_metric_new_semconv PASSED [ 80%]
tests/test_requests_integration.py::TestRequestsIntergrationMetric::test_basic_metric_non_recording_span PASSED [ 81%]
tests/test_requests_integration.py::TestRequestsIntergrationMetric::test_basic_metric_success PASSED [ 82%]
tests/test_requests_integration.py::TestRequestsIntergrationMetric::test_custom_histogram_boundaries PASSED [ 83%]
tests/test_requests_integration.py::TestRequestsIntergrationMetric::test_custom_histogram_boundaries_new_semconv PASSED [ 85%]
tests/test_requests_ip_support.py::TestURLLib3InstrumentorWithRealSocket::test_basic_http_success PASSED [ 86%]
tests/test_requests_ip_support.py::TestURLLib3InstrumentorWithRealSocket::test_basic_http_success_using_connection_pool PASSED [ 87%]
tests/test_user_agent_synthetic.py::TestUserAgentSynthetic::test_empty_user_agent_header PASSED [ 88%]
tests/test_user_agent_synthetic.py::TestUserAgentSynthetic::test_no_user_agent_header PASSED [ 90%]
tests/test_user_agent_synthetic.py::TestUserAgentSynthetic::test_user_agent_bot_bingbot PASSED [ 91%]
tests/test_user_agent_synthetic.py::TestUserAgentSynthetic::test_user_agent_bot_googlebot PASSED [ 92%]
tests/test_user_agent_synthetic.py::TestUserAgentSynthetic::test_user_agent_bytes_like_header PASSED [ 93%]
tests/test_user_agent_synthetic.py::TestUserAgentSynthetic::test_user_agent_case_insensitive PASSED [ 95%]
tests/test_user_agent_synthetic.py::TestUserAgentSynthetic::test_user_agent_normal_browser PASSED [ 96%]
tests/test_user_agent_synthetic.py::TestUserAgentSynthetic::test_user_agent_priority_alwayson_over_bot PASSED [ 97%]
tests/test_user_agent_synthetic.py::TestUserAgentSynthetic::test_user_agent_substring_match PASSED [ 98%]
tests/test_user_agent_synthetic.py::TestUserAgentSynthetic::test_user_agent_test_alwayson PASSED [100%]

=================================== FAILURES ===================================
__________ TestRequestsIntegration.test_adapter_with_custom_response ___________

self = <tests.test_requests_integration.TestRequestsIntegration testMethod=test_adapter_with_custom_response>

    def test_adapter_with_custom_response(self):
        response = Response()
        response.status_code = 210
        response.reason = "hello adapter"
        response.raw = TransportMock()

        session = requests.Session()
        session.mount(self.URL, MyAdapter(response))

        self.perform_request(self.URL, session)
        span = self.assert_span()
>       self.assertEqual(
            span.attributes,
            {
                "http.method": "GET",
                "http.url": self.URL,
                "http.status_code": 210,
                USER_AGENT_ORIGINAL: "python-requests/2.32.3",
            },
        )
E       AssertionError: mappingproxy({'http.method': 'GET', 'http[102 chars]210}) != {'http.method': 'GET', 'http.url': 'http:[88 chars]2.3'}

tests/test_requests_integration.py:695: AssertionError
______________________ TestRequestsIntegration.test_basic ______________________

self = <tests.test_requests_integration.TestRequestsIntegration testMethod=test_basic>

    def test_basic(self):
        result = self.perform_request(self.URL)
        self.assertEqual(result.text, "Hello!")
        span = self.assert_span()

        self.assertIs(span.kind, trace.SpanKind.CLIENT)
        self.assertEqual(span.name, "GET")

        self.assertEqual(
            span.instrumentation_scope.schema_url,
            "https://opentelemetry.io/schemas/1.11.0",
        )

>       self.assertEqual(
            span.attributes,
            {
                HTTP_METHOD: "GET",
                HTTP_URL: self.URL,
                HTTP_STATUS_CODE: 200,
                USER_AGENT_ORIGINAL: "python-requests/2.32.3",
            },
        )
E       AssertionError: mappingproxy({'http.method': 'GET', 'http[102 chars]200}) != {'http.method': 'GET', 'http.url': 'http:[88 chars]2.3'}

tests/test_requests_integration.py:185: AssertionError
_______________ TestRequestsIntegration.test_basic_both_semconv ________________

self = <tests.test_requests_integration.TestRequestsIntegration testMethod=test_basic_both_semconv>

    def test_basic_both_semconv(self):
        url_with_port = "http://mock:80/status/200"
        httpretty.register_uri(
            httpretty.GET, url_with_port, status=200, body="Hello!"
        )
        result = self.perform_request(url_with_port)
        self.assertEqual(result.text, "Hello!")
        span = self.assert_span()

        self.assertIs(span.kind, trace.SpanKind.CLIENT)
        self.assertEqual(span.name, "GET")

        self.assertEqual(
            span.instrumentation_scope.schema_url,
            "https://opentelemetry.io/schemas/1.21.0",
        )
>       self.assertEqual(
            span.attributes,
            {
                HTTP_METHOD: "GET",
                HTTP_REQUEST_METHOD: "GET",
                HTTP_URL: url_with_port,
                URL_FULL: url_with_port,
                HTTP_HOST: "mock",
                SERVER_ADDRESS: "mock",
                NETWORK_PEER_ADDRESS: "mock",
                NET_PEER_PORT: 80,
                HTTP_STATUS_CODE: 200,
                HTTP_RESPONSE_STATUS_CODE: 200,
                HTTP_FLAVOR: "1.1",
                NETWORK_PROTOCOL_VERSION: "1.1",
                SERVER_PORT: 80,
                NETWORK_PEER_PORT: 80,
                USER_AGENT_ORIGINAL: "python-requests/2.32.3",
            },
        )
E       AssertionError: mappingproxy({'http.method': 'GET', 'http[411 chars].1'}) != {'http.method': 'GET', 'http.request.meth[397 chars]2.3'}

tests/test_requests_integration.py:254: AssertionError
________________ TestRequestsIntegration.test_basic_new_semconv ________________

self = <tests.test_requests_integration.TestRequestsIntegration testMethod=test_basic_new_semconv>

    def test_basic_new_semconv(self):
        url_with_port = "http://mock:80/status/200"
        httpretty.register_uri(
            httpretty.GET, url_with_port, status=200, body="Hello!"
        )
        result = self.perform_request(url_with_port)
        self.assertEqual(result.text, "Hello!")
        span = self.assert_span()

        self.assertIs(span.kind, trace.SpanKind.CLIENT)
        self.assertEqual(span.name, "GET")

        self.assertEqual(
            span.instrumentation_scope.schema_url,
            "https://opentelemetry.io/schemas/1.21.0",
        )
>       self.assertEqual(
            span.attributes,
            {
                HTTP_REQUEST_METHOD: "GET",
                URL_FULL: url_with_port,
                SERVER_ADDRESS: "mock",
                NETWORK_PEER_ADDRESS: "mock",
                HTTP_RESPONSE_STATUS_CODE: 200,
                NETWORK_PROTOCOL_VERSION: "1.1",
                SERVER_PORT: 80,
                NETWORK_PEER_PORT: 80,
                USER_AGENT_ORIGINAL: "python-requests/2.32.3",
            },
        )
E       AssertionError: mappingproxy({'http.request.method': 'GET[259 chars].1'}) != {'http.request.method': 'GET', 'url.full'[245 chars]2.3'}

tests/test_requests_integration.py:217: AssertionError
_____________ TestRequestsIntegration.test_nonstandard_http_method _____________

self = <tests.test_requests_integration.TestRequestsIntegration testMethod=test_nonstandard_http_method>

    @mock.patch("httpretty.http.HttpBaseClass.METHODS", ("NONSTANDARD",))
    def test_nonstandard_http_method(self):
        httpretty.register_uri("NONSTANDARD", self.URL, status=405)
        session = requests.Session()
        session.request("NONSTANDARD", self.URL)
        span = self.assert_span()
        self.assertIs(span.kind, trace.SpanKind.CLIENT)
        self.assertEqual(span.name, "HTTP")
>       self.assertEqual(
            span.attributes,
            {
                HTTP_METHOD: "_OTHER",
                HTTP_URL: self.URL,
                HTTP_STATUS_CODE: 405,
                USER_AGENT_ORIGINAL: "python-requests/2.32.3",
            },
        )
E       AssertionError: mappingproxy({'http.method': '_OTHER', 'h[105 chars]405}) != {'http.method': '_OTHER', 'http.url': 'ht[91 chars]2.3'}

tests/test_requests_integration.py:289: AssertionError
_______ TestRequestsIntegration.test_nonstandard_http_method_new_semconv _______

self = <tests.test_requests_integration.TestRequestsIntegration testMethod=test_nonstandard_http_method_new_semconv>

    @mock.patch("httpretty.http.HttpBaseClass.METHODS", ("NONSTANDARD",))
    def test_nonstandard_http_method_new_semconv(self):
        httpretty.register_uri("NONSTANDARD", self.URL, status=405)
        session = requests.Session()
        session.request("NONSTANDARD", self.URL)
        span = self.assert_span()
        self.assertIs(span.kind, trace.SpanKind.CLIENT)
        self.assertEqual(span.name, "HTTP")
>       self.assertEqual(
            span.attributes,
            {
                HTTP_REQUEST_METHOD: "_OTHER",
                URL_FULL: self.URL,
                SERVER_ADDRESS: "mock",
                NETWORK_PEER_ADDRESS: "mock",
                HTTP_RESPONSE_STATUS_CODE: 405,
                NETWORK_PROTOCOL_VERSION: "1.1",
                ERROR_TYPE: "405",
                HTTP_REQUEST_METHOD_ORIGINAL: "NONSTANDARD",
                USER_AGENT_ORIGINAL: "python-requests/2.32.3",
            },
        )
E       AssertionError: mappingproxy({'http.request.method_origin[283 chars].1'}) != {'http.request.method': '_OTHER', 'url.fu[269 chars]2.3'}

tests/test_requests_integration.py:309: AssertionError
_________ TestRequestsIntegration.test_requests_exception_new_semconv __________

self = <tests.test_requests_integration.TestRequestsIntegration testMethod=test_requests_exception_new_semconv>
_ = (<MagicMock name='send' id='140737304688160'>,), __ = {}
url_with_port = 'http://mock:80/status/200'
span = <opentelemetry.sdk.trace.ReadableSpan object at 0x7ffff51b0e90>

    @mock.patch(
        "requests.adapters.HTTPAdapter.send",
        side_effect=requests.RequestException,
    )
    def test_requests_exception_new_semconv(self, *_, **__):
        url_with_port = "http://mock:80/status/200"
        httpretty.register_uri(
            httpretty.GET, url_with_port, status=200, body="Hello!"
        )
        with self.assertRaises(requests.RequestException):
            self.perform_request(url_with_port)

        span = self.assert_span()
>       self.assertEqual(
            span.attributes,
            {
                HTTP_REQUEST_METHOD: "GET",
                URL_FULL: url_with_port,
                SERVER_ADDRESS: "mock",
                SERVER_PORT: 80,
                NETWORK_PEER_PORT: 80,
                NETWORK_PEER_ADDRESS: "mock",
                ERROR_TYPE: "RequestException",
                USER_AGENT_ORIGINAL: "python-requests/2.32.3",
            },
        )
E       AssertionError: mappingproxy({'http.request.method': 'GET[224 chars]on'}) != {'http.request.method': 'GET', 'url.full'[210 chars]2.3'}

tests/test_requests_integration.py:604: AssertionError
________ TestRequestsIntegration.test_requests_exception_with_response _________

self = <tests.test_requests_integration.TestRequestsIntegration testMethod=test_requests_exception_with_response>
_ = (<MagicMock name='send' id='140737304688496'>,), __ = {}
span = <opentelemetry.sdk.trace.ReadableSpan object at 0x7ffff51b1010>

    @mock.patch(
        "requests.adapters.HTTPAdapter.send",
        side_effect=requests.RequestException(response=mocked_response),
    )
    def test_requests_exception_with_response(self, *_, **__):
        with self.assertRaises(requests.RequestException):
            self.perform_request(self.URL)

        span = self.assert_span()
>       self.assertEqual(
            span.attributes,
            {
                HTTP_METHOD: "GET",
                HTTP_URL: self.URL,
                HTTP_STATUS_CODE: 500,
                USER_AGENT_ORIGINAL: "python-requests/2.32.3",
            },
        )
E       AssertionError: mappingproxy({'http.method': 'GET', 'http[102 chars]500}) != {'http.method': 'GET', 'http.url': 'http:[88 chars]2.3'}

tests/test_requests_integration.py:655: AssertionError
_ TestRequestsIntegration.test_requests_exception_without_proper_response_type _

self = <tests.test_requests_integration.TestRequestsIntegration testMethod=test_requests_exception_without_proper_response_type>
_ = (<MagicMock name='send' id='140737304687152'>,), __ = {}
span = <opentelemetry.sdk.trace.ReadableSpan object at 0x7ffff51b1550>

    @mock.patch(
        "requests.adapters.HTTPAdapter.send",
        side_effect=InvalidResponseObjectException,
    )
    def test_requests_exception_without_proper_response_type(self, *_, **__):
        with self.assertRaises(InvalidResponseObjectException):
            self.perform_request(self.URL)

        span = self.assert_span()
>       self.assertEqual(
            span.attributes,
            {
                HTTP_METHOD: "GET",
                HTTP_URL: self.URL,
                USER_AGENT_ORIGINAL: "python-requests/2.32.3",
            },
        )
E       AssertionError: mappingproxy({'http.method': 'GET', 'http[77 chars].5'}) != {'http.method': 'GET', 'http.url': 'http:[63 chars]2.3'}

tests/test_requests_integration.py:632: AssertionError
_______ TestRequestsIntegration.test_requests_exception_without_response _______

self = <tests.test_requests_integration.TestRequestsIntegration testMethod=test_requests_exception_without_response>
_ = (<MagicMock name='send' id='140737304686144'>,), __ = {}
span = <opentelemetry.sdk.trace.ReadableSpan object at 0x7ffff51b19d0>

    @mock.patch(
        "requests.adapters.HTTPAdapter.send",
        side_effect=requests.RequestException,
    )
    def test_requests_exception_without_response(self, *_, **__):
        with self.assertRaises(requests.RequestException):
            self.perform_request(self.URL)

        span = self.assert_span()
>       self.assertEqual(
            span.attributes,
            {
                HTTP_METHOD: "GET",
                HTTP_URL: self.URL,
                USER_AGENT_ORIGINAL: "python-requests/2.32.3",
            },
        )
E       AssertionError: mappingproxy({'http.method': 'GET', 'http[77 chars].5'}) != {'http.method': 'GET', 'http.url': 'http:[63 chars]2.3'}

tests/test_requests_integration.py:581: AssertionError
__________________ TestRequestsIntegration.test_response_hook __________________

self = <tests.test_requests_integration.TestRequestsIntegration testMethod=test_response_hook>

    def test_response_hook(self):
        RequestsInstrumentor().uninstrument()

        def response_hook(
            span,
            request: requests.PreparedRequest,
            response: requests.Response,
        ):
            span.set_attribute(
                "http.response.body", response.content.decode("utf-8")
            )

        RequestsInstrumentor().instrument(
            tracer_provider=self.tracer_provider,
            response_hook=response_hook,
        )

        result = self.perform_request(self.URL)
        self.assertEqual(result.text, "Hello!")

        span = self.assert_span()
>       self.assertEqual(
            span.attributes,
            {
                HTTP_METHOD: "GET",
                HTTP_URL: self.URL,
                HTTP_STATUS_CODE: 200,
                "http.response.body": "Hello!",
                USER_AGENT_ORIGINAL: "python-requests/2.32.3",
            },
        )
E       AssertionError: mappingproxy({'http.method': 'GET', 'http[134 chars]o!'}) != {'http.method': 'GET', 'http.url': 'http:[120 chars]2.3'}

tests/test_requests_integration.py:548: AssertionError
___ TestRequestsIntegrationPreparedRequest.test_adapter_with_custom_response ___

self = <tests.test_requests_integration.TestRequestsIntegrationPreparedRequest testMethod=test_adapter_with_custom_response>

    def test_adapter_with_custom_response(self):
        response = Response()
        response.status_code = 210
        response.reason = "hello adapter"
        response.raw = TransportMock()

        session = requests.Session()
        session.mount(self.URL, MyAdapter(response))

        self.perform_request(self.URL, session)
        span = self.assert_span()
>       self.assertEqual(
            span.attributes,
            {
                "http.method": "GET",
                "http.url": self.URL,
                "http.status_code": 210,
                USER_AGENT_ORIGINAL: "python-requests/2.32.3",
            },
        )
E       AssertionError: mappingproxy({'http.method': 'GET', 'http[102 chars]210}) != {'http.method': 'GET', 'http.url': 'http:[88 chars]2.3'}

tests/test_requests_integration.py:695: AssertionError
______________ TestRequestsIntegrationPreparedRequest.test_basic _______________

self = <tests.test_requests_integration.TestRequestsIntegrationPreparedRequest testMethod=test_basic>

    def test_basic(self):
        result = self.perform_request(self.URL)
        self.assertEqual(result.text, "Hello!")
        span = self.assert_span()

        self.assertIs(span.kind, trace.SpanKind.CLIENT)
        self.assertEqual(span.name, "GET")

        self.assertEqual(
            span.instrumentation_scope.schema_url,
            "https://opentelemetry.io/schemas/1.11.0",
        )

>       self.assertEqual(
            span.attributes,
            {
                HTTP_METHOD: "GET",
                HTTP_URL: self.URL,
                HTTP_STATUS_CODE: 200,
                USER_AGENT_ORIGINAL: "python-requests/2.32.3",
            },
        )
E       AssertionError: mappingproxy({'http.method': 'GET', 'http[102 chars]200}) != {'http.method': 'GET', 'http.url': 'http:[88 chars]2.3'}

tests/test_requests_integration.py:185: AssertionError
________ TestRequestsIntegrationPreparedRequest.test_basic_both_semconv ________

self = <tests.test_requests_integration.TestRequestsIntegrationPreparedRequest testMethod=test_basic_both_semconv>

    def test_basic_both_semconv(self):
        url_with_port = "http://mock:80/status/200"
        httpretty.register_uri(
            httpretty.GET, url_with_port, status=200, body="Hello!"
        )
        result = self.perform_request(url_with_port)
        self.assertEqual(result.text, "Hello!")
        span = self.assert_span()

        self.assertIs(span.kind, trace.SpanKind.CLIENT)
        self.assertEqual(span.name, "GET")

        self.assertEqual(
            span.instrumentation_scope.schema_url,
            "https://opentelemetry.io/schemas/1.21.0",
        )
>       self.assertEqual(
            span.attributes,
            {
                HTTP_METHOD: "GET",
                HTTP_REQUEST_METHOD: "GET",
                HTTP_URL: url_with_port,
                URL_FULL: url_with_port,
                HTTP_HOST: "mock",
                SERVER_ADDRESS: "mock",
                NETWORK_PEER_ADDRESS: "mock",
                NET_PEER_PORT: 80,
                HTTP_STATUS_CODE: 200,
                HTTP_RESPONSE_STATUS_CODE: 200,
                HTTP_FLAVOR: "1.1",
                NETWORK_PROTOCOL_VERSION: "1.1",
                SERVER_PORT: 80,
                NETWORK_PEER_PORT: 80,
                USER_AGENT_ORIGINAL: "python-requests/2.32.3",
            },
        )
E       AssertionError: mappingproxy({'http.method': 'GET', 'http[411 chars].1'}) != {'http.method': 'GET', 'http.request.meth[397 chars]2.3'}

tests/test_requests_integration.py:254: AssertionError
________ TestRequestsIntegrationPreparedRequest.test_basic_new_semconv _________

self = <tests.test_requests_integration.TestRequestsIntegrationPreparedRequest testMethod=test_basic_new_semconv>

    def test_basic_new_semconv(self):
        url_with_port = "http://mock:80/status/200"
        httpretty.register_uri(
            httpretty.GET, url_with_port, status=200, body="Hello!"
        )
        result = self.perform_request(url_with_port)
        self.assertEqual(result.text, "Hello!")
        span = self.assert_span()

        self.assertIs(span.kind, trace.SpanKind.CLIENT)
        self.assertEqual(span.name, "GET")

        self.assertEqual(
            span.instrumentation_scope.schema_url,
            "https://opentelemetry.io/schemas/1.21.0",
        )
>       self.assertEqual(
            span.attributes,
            {
                HTTP_REQUEST_METHOD: "GET",
                URL_FULL: url_with_port,
                SERVER_ADDRESS: "mock",
                NETWORK_PEER_ADDRESS: "mock",
                HTTP_RESPONSE_STATUS_CODE: 200,
                NETWORK_PROTOCOL_VERSION: "1.1",
                SERVER_PORT: 80,
                NETWORK_PEER_PORT: 80,
                USER_AGENT_ORIGINAL: "python-requests/2.32.3",
            },
        )
E       AssertionError: mappingproxy({'http.request.method': 'GET[259 chars].1'}) != {'http.request.method': 'GET', 'url.full'[245 chars]2.3'}

tests/test_requests_integration.py:217: AssertionError
_____ TestRequestsIntegrationPreparedRequest.test_nonstandard_http_method ______

self = <tests.test_requests_integration.TestRequestsIntegrationPreparedRequest testMethod=test_nonstandard_http_method>

    @mock.patch("httpretty.http.HttpBaseClass.METHODS", ("NONSTANDARD",))
    def test_nonstandard_http_method(self):
        httpretty.register_uri("NONSTANDARD", self.URL, status=405)
        session = requests.Session()
        session.request("NONSTANDARD", self.URL)
        span = self.assert_span()
        self.assertIs(span.kind, trace.SpanKind.CLIENT)
        self.assertEqual(span.name, "HTTP")
>       self.assertEqual(
            span.attributes,
            {
                HTTP_METHOD: "_OTHER",
                HTTP_URL: self.URL,
                HTTP_STATUS_CODE: 405,
                USER_AGENT_ORIGINAL: "python-requests/2.32.3",
            },
        )
E       AssertionError: mappingproxy({'http.method': '_OTHER', 'h[105 chars]405}) != {'http.method': '_OTHER', 'http.url': 'ht[91 chars]2.3'}

tests/test_requests_integration.py:289: AssertionError
_ TestRequestsIntegrationPreparedRequest.test_nonstandard_http_method_new_semconv _

self = <tests.test_requests_integration.TestRequestsIntegrationPreparedRequest testMethod=test_nonstandard_http_method_new_semconv>

    @mock.patch("httpretty.http.HttpBaseClass.METHODS", ("NONSTANDARD",))
    def test_nonstandard_http_method_new_semconv(self):
        httpretty.register_uri("NONSTANDARD", self.URL, status=405)
        session = requests.Session()
        session.request("NONSTANDARD", self.URL)
        span = self.assert_span()
        self.assertIs(span.kind, trace.SpanKind.CLIENT)
        self.assertEqual(span.name, "HTTP")
>       self.assertEqual(
            span.attributes,
            {
                HTTP_REQUEST_METHOD: "_OTHER",
                URL_FULL: self.URL,
                SERVER_ADDRESS: "mock",
                NETWORK_PEER_ADDRESS: "mock",
                HTTP_RESPONSE_STATUS_CODE: 405,
                NETWORK_PROTOCOL_VERSION: "1.1",
                ERROR_TYPE: "405",
                HTTP_REQUEST_METHOD_ORIGINAL: "NONSTANDARD",
                USER_AGENT_ORIGINAL: "python-requests/2.32.3",
            },
        )
E       AssertionError: mappingproxy({'http.request.method_origin[283 chars].1'}) != {'http.request.method': '_OTHER', 'url.fu[269 chars]2.3'}

tests/test_requests_integration.py:309: AssertionError
__ TestRequestsIntegrationPreparedRequest.test_requests_exception_new_semconv __

self = <tests.test_requests_integration.TestRequestsIntegrationPreparedRequest testMethod=test_requests_exception_new_semconv>
_ = (<MagicMock name='send' id='140737304685472'>,), __ = {}
url_with_port = 'http://mock:80/status/200'
span = <opentelemetry.sdk.trace.ReadableSpan object at 0x7ffff46f9790>

    @mock.patch(
        "requests.adapters.HTTPAdapter.send",
        side_effect=requests.RequestException,
    )
    def test_requests_exception_new_semconv(self, *_, **__):
        url_with_port = "http://mock:80/status/200"
        httpretty.register_uri(
            httpretty.GET, url_with_port, status=200, body="Hello!"
        )
        with self.assertRaises(requests.RequestException):
            self.perform_request(url_with_port)

        span = self.assert_span()
>       self.assertEqual(
            span.attributes,
            {
                HTTP_REQUEST_METHOD: "GET",
                URL_FULL: url_with_port,
                SERVER_ADDRESS: "mock",
                SERVER_PORT: 80,
                NETWORK_PEER_PORT: 80,
                NETWORK_PEER_ADDRESS: "mock",
                ERROR_TYPE: "RequestException",
                USER_AGENT_ORIGINAL: "python-requests/2.32.3",
            },
        )
E       AssertionError: mappingproxy({'http.request.method': 'GET[224 chars]on'}) != {'http.request.method': 'GET', 'url.full'[210 chars]2.3'}

tests/test_requests_integration.py:604: AssertionError
_ TestRequestsIntegrationPreparedRequest.test_requests_exception_with_response _

self = <tests.test_requests_integration.TestRequestsIntegrationPreparedRequest testMethod=test_requests_exception_with_response>
_ = (<MagicMock name='send' id='140737327147264'>,), __ = {}
span = <opentelemetry.sdk.trace.ReadableSpan object at 0x7ffff46f9b50>

    @mock.patch(
        "requests.adapters.HTTPAdapter.send",
        side_effect=requests.RequestException(response=mocked_response),
    )
    def test_requests_exception_with_response(self, *_, **__):
        with self.assertRaises(requests.RequestException):
            self.perform_request(self.URL)

        span = self.assert_span()
>       self.assertEqual(
            span.attributes,
            {
                HTTP_METHOD: "GET",
                HTTP_URL: self.URL,
                HTTP_STATUS_CODE: 500,
                USER_AGENT_ORIGINAL: "python-requests/2.32.3",
            },
        )
E       AssertionError: mappingproxy({'http.method': 'GET', 'http[102 chars]500}) != {'http.method': 'GET', 'http.url': 'http:[88 chars]2.3'}

tests/test_requests_integration.py:655: AssertionError
_ TestRequestsIntegrationPreparedRequest.test_requests_exception_without_proper_response_type _

self = <tests.test_requests_integration.TestRequestsIntegrationPreparedRequest testMethod=test_requests_exception_without_proper_response_type>
_ = (<MagicMock name='send' id='140737305898896'>,), __ = {}
span = <opentelemetry.sdk.trace.ReadableSpan object at 0x7ffff46f9f10>

    @mock.patch(
        "requests.adapters.HTTPAdapter.send",
        side_effect=InvalidResponseObjectException,
    )
    def test_requests_exception_without_proper_response_type(self, *_, **__):
        with self.assertRaises(InvalidResponseObjectException):
            self.perform_request(self.URL)

        span = self.assert_span()
>       self.assertEqual(
            span.attributes,
            {
                HTTP_METHOD: "GET",
                HTTP_URL: self.URL,
                USER_AGENT_ORIGINAL: "python-requests/2.32.3",
            },
        )
E       AssertionError: mappingproxy({'http.method': 'GET', 'http[77 chars].5'}) != {'http.method': 'GET', 'http.url': 'http:[63 chars]2.3'}

tests/test_requests_integration.py:632: AssertionError
_ TestRequestsIntegrationPreparedRequest.test_requests_exception_without_response _

self = <tests.test_requests_integration.TestRequestsIntegrationPreparedRequest testMethod=test_requests_exception_without_response>
_ = (<MagicMock name='send' id='140737305895200'>,), __ = {}
span = <opentelemetry.sdk.trace.ReadableSpan object at 0x7ffff46fa390>

    @mock.patch(
        "requests.adapters.HTTPAdapter.send",
        side_effect=requests.RequestException,
    )
    def test_requests_exception_without_response(self, *_, **__):
        with self.assertRaises(requests.RequestException):
            self.perform_request(self.URL)

        span = self.assert_span()
>       self.assertEqual(
            span.attributes,
            {
                HTTP_METHOD: "GET",
                HTTP_URL: self.URL,
                USER_AGENT_ORIGINAL: "python-requests/2.32.3",
            },
        )
E       AssertionError: mappingproxy({'http.method': 'GET', 'http[77 chars].5'}) != {'http.method': 'GET', 'http.url': 'http:[63 chars]2.3'}

tests/test_requests_integration.py:581: AssertionError
__________ TestRequestsIntegrationPreparedRequest.test_response_hook ___________

self = <tests.test_requests_integration.TestRequestsIntegrationPreparedRequest testMethod=test_response_hook>

    def test_response_hook(self):
        RequestsInstrumentor().uninstrument()

        def response_hook(
            span,
            request: requests.PreparedRequest,
            response: requests.Response,
        ):
            span.set_attribute(
                "http.response.body", response.content.decode("utf-8")
            )

        RequestsInstrumentor().instrument(
            tracer_provider=self.tracer_provider,
            response_hook=response_hook,
        )

        result = self.perform_request(self.URL)
        self.assertEqual(result.text, "Hello!")

        span = self.assert_span()
>       self.assertEqual(
            span.attributes,
            {
                HTTP_METHOD: "GET",
                HTTP_URL: self.URL,
                HTTP_STATUS_CODE: 200,
                "http.response.body": "Hello!",
                USER_AGENT_ORIGINAL: "python-requests/2.32.3",
            },
        )
E       AssertionError: mappingproxy({'http.method': 'GET', 'http[134 chars]o!'}) != {'http.method': 'GET', 'http.url': 'http:[120 chars]2.3'}

tests/test_requests_integration.py:548: AssertionError
=============================== warnings summary ===============================
instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py: 62 warnings
instrumentation/opentelemetry-instrumentation-requests/tests/test_user_agent_synthetic.py: 12 warnings
  /nix/store/3d00rj4k54f2rp9sp04qns1hsgijrx99-python3.13-httpretty-1.1.4/lib/python3.13/site-packages/httpretty/core.py:1080: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
    now = datetime.utcnow()

../../../../nix/store/0wnscii4625qqnngfh93mw44lxq5w5b2-python3.13-pytest-9.0.2/lib/python3.13/site-packages/_pytest/cacheprovider.py:475
  /nix/store/0wnscii4625qqnngfh93mw44lxq5w5b2-python3.13-pytest-9.0.2/lib/python3.13/site-packages/_pytest/cacheprovider.py:475: PytestCacheWarning: could not create cache path /build/source/.pytest_cache/v/cache/nodeids: [Errno 13] Permission denied: '/build/source/pytest-cache-files-l3ej_7d2'
    config.cache.set("cache/nodeids", sorted(self.cached_nodeids))

../../../../nix/store/0wnscii4625qqnngfh93mw44lxq5w5b2-python3.13-pytest-9.0.2/lib/python3.13/site-packages/_pytest/cacheprovider.py:429
  /nix/store/0wnscii4625qqnngfh93mw44lxq5w5b2-python3.13-pytest-9.0.2/lib/python3.13/site-packages/_pytest/cacheprovider.py:429: PytestCacheWarning: could not create cache path /build/source/.pytest_cache/v/cache/lastfailed: [Errno 13] Permission denied: '/build/source/pytest-cache-files-gpf30mya'
    config.cache.set("cache/lastfailed", self.lastfailed)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================== 22 failed, 58 passed, 76 warnings in 3.00s ==================

@CertainLach
Copy link
Copy Markdown
Member Author

CertainLach commented Apr 24, 2026

requests instrumentation hardcodes requests version to python-requests/2.32.3 in all of its tests, but nixpkgs has 2.32.5 packaged

We should either patch it with the correct versions, or just disable tests for this package, as those are just bad tests D:

@CertainLach
Copy link
Copy Markdown
Member Author

I would greatly appreciate if someone can report this problem to upstream and propose a fix for it, I would then pull this patch into this PR

@CertainLach
Copy link
Copy Markdown
Member Author

All of the other opentelemetry packages are failing because they depend on opentelemetry-instrumetation-requests package

All of the opentelemetry-instrumentation-requests tests are hardcoding
requests version, and since requests package in nixpkgs is newer than
expected by the package - all of the tests fail. This should be fixed
upstream, I do not see a good way to patch that at nixpkgs side.
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-darwin: 1001-2500 This PR causes many rebuilds on Darwin and should most likely target the staging branches. and removed 10.rebuild-darwin: 2501-5000 This PR causes many rebuilds on Darwin and should target the staging branches. labels Apr 24, 2026
@DanielNoord
Copy link
Copy Markdown

@CertainLach @natsukium Is there anything left here? The urllib3 package isn't compatible with Python 3.14 and the httpx is using deprecated functions. We're also quite far behind now so it would be good to merge newer versions into nixpkgs.

@CertainLach
Copy link
Copy Markdown
Member Author

I think everything should be fine with the requests instrumentation fix (disabled tests due to hardcoded package versions), and we just have to wait for maintainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: python Python is a high-level, general-purpose programming language. 8.has: package (update) This PR updates a package to a newer version 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 1001-2500 This PR causes many rebuilds on Darwin and should most likely target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 2501-5000 This PR causes many rebuilds on Linux and should target the staging branches. 12.approvals: 2 This PR was reviewed and approved by two persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants