Skip to content

feat: add niquests instrumentation#4459

Closed
Ousret wants to merge 2 commits intoopen-telemetry:mainfrom
Ousret:instrumentation-niquests
Closed

feat: add niquests instrumentation#4459
Ousret wants to merge 2 commits intoopen-telemetry:mainfrom
Ousret:instrumentation-niquests

Conversation

@Ousret
Copy link
Copy Markdown

@Ousret Ousret commented Apr 17, 2026

Description

Add OpenTelemetry instrumentation for the niquests (https://niquests.readthedocs.io/) HTTP client library. Niquests is a drop-in replacement for requests with native async support, HTTP/2, HTTP/3, and richer connection metadata. This instrumentation covers both the synchronous Session and the asynchronous AsyncSession interfaces.

Fixes # (issue)

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

I heavily inspired myself on other http client instrumentation to build up confidence that this one works too.

Does This PR Require a Core Repo Change?

  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@Ousret Ousret requested a review from a team as a code owner April 17, 2026 03:28
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Apr 17, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: Ousret / name: Ahmed (5324f3f)
  • ✅ login: Ousret / name: Ahmed TAHRI (aaf5e70)

@herin049
Copy link
Copy Markdown
Contributor

Hi @Ousret, generally speaking we prefer that library implementors consider adding first-class support for OTel over creating a dedicated instrumentation library. Have you reached out to the library authors to see if they would consider adding OTel instrumentation directly to niquests?

@Ousret
Copy link
Copy Markdown
Author

Ousret commented Apr 17, 2026

I am the maintainer of Niquests. And I am willing to keep an eye into that contribution for the long run.
I really prefer that this contrib is hosted here as the other http client out there (aiohttp, requests, httpx, ..)

regards,

@Ousret Ousret force-pushed the instrumentation-niquests branch from 19f9e88 to d7b80b8 Compare April 22, 2026 10:41
@Ousret Ousret force-pushed the instrumentation-niquests branch from d7b80b8 to aaf5e70 Compare April 22, 2026 10:53
@Ousret
Copy link
Copy Markdown
Author

Ousret commented Apr 22, 2026

I fixed the CI errors (misc).

Regards,

@MikeGoldsmith
Copy link
Copy Markdown
Member

Thanks for the contribution @Ousret. We recently discussed this in the Python approvers/maintainers group and our guidance for cases like this is that library maintainers should add OpenTelemetry instrumentation directly into their library rather than adding an instrumentation package here. See our guidelines for native OpenTelemetry instrumentation.

Since you maintain niquests, you're in the best position to add native OTel support — it gives you tighter integration, avoids version coupling issues, and means instrumentation ships with the library itself. The OTel API is designed to be a lightweight dependency for exactly this use case.

We'd be happy to help if you have questions about integrating the OTel API into niquests directly. Closing this PR in favour of that approach.

@Ousret
Copy link
Copy Markdown
Author

Ousret commented Apr 28, 2026

I was unaware of this context, and it seems I misinterpreted the native-instrumentation guidelines.

I understand the rationale, but I won't be pursuing native otel integration inside niquests itself. OpenTelemetry is one of several observability ecosystems users ask for, and taking on a first party dependency (plus the publishing, security, and long-term maintenance that comes with it) for each of them isn't sustainable across the OSS portfolio I already maintain. Keeping instrumentation as an opt-in, external adapter, exactly the model used today for requests, httpx, aiohttp, etc(...) is what allowed me to commit to maintaining this contrib long-term, as I offered earlier in the thread.

I'll leave the door open: if someone from the community wants to pick this up, either here or as an independent integration (3rd party package), I'm happy to review and support the effort.

Regards,

edit: It seems I didn't misinterpret the guidelines(...) Was updated after my PR via #4464 and applied retroactively.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add Opentelemetry Instrumentation

3 participants