Make it possible to intercept the gRPC channel for OTLP based export

Aperta
#4,802 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@sid200727 ci sta già lavorando.

Dal 30/1/2026.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python

Direzione di ricerca

Inizia da exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py e traccia il modo in cui il canale viene creato e passato allo stub. Poi esamina i metodi init degli exporter che lo utilizzano, come OTLPSpanExporter e OTLPMetricExporter. Il lavoro è completato quando i chiamanti possono fornire un interceptor del canale attraverso questi exporter e l’interceptor viene applicato prima della creazione dello stub client.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

feature-request
Is your feature request related to a problem?

I'm having trouble with a particular use of OTLP export, and it would have been helpful to be able to use gRPC channel interceptors as a debugging tool.

https://grpc-interceptor.readthedocs.io/en/latest/#client-interceptors

However, there is no way to pass down an interceptor into the OTLP gRPC exporter code.

Describe the solution you'd like

In the code here:
https://github.com/open-telemetry/opentelemetry-python/blob/main/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py

A sketch of the logic might be something like:

+ def _default_interceptor(channel):
+  return channel

class OTLPExporterMixin(
   ...
   channel_options=...,
+ channel_interceptor=None):
+ channel_interceptor = channel_interceptor or _default_interceptor
...
+ self._channel = channel_interceptor(self._channel)
self._client = self._stub(self._channel)  # type: ignore [reportCallIssue]
...

Along with exposing access to channel_interceptor in the __init__ methods of the consuming classes (e.g. OTLPSpanExporter, OTLPMetricExporter, etc.)

Describe alternatives you've considered

No response

Additional Context

No response

Would you like to implement a fix?

None

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Lingua principale
Python
Stelle
2.7k
Fork
1.1k
Merge medio
3g 12h
PR unite (30g)
16

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di open-telemetry/opentelemetry-python

Tutte le issue di open-telemetry/opentelemetry-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.