opentelemetry-configuration: provide a way for downstream distribution to update exporter configurations

Aperta
#5,959 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
18/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

This is an API design question, not a ready patch: the proposal adds an optional callback to configure_sdk() and a call inside _OTelSDKConfigurator._configure. Start by reading how the declarative gRPC exporter factory builds its channel_options, and check whether maintainers have accepted a hook like this. Done means a maintainer decision on the API shape, followed by a reviewed design.

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

Descrizione

feature-request

Downstream distributions need a way to customize the built-in OTLP exporters when users configure the SDK through declarative configuration. Some of the arguments of our exporters are not exposed as environment variable and then configuration keys. On example of this is the channel_options GRPC exporters use to set the user agent (via grpc.primary_user_agent).

The declarative gRPC factory has no way to supply that constructor argument.

Java provides a related declarative exporter customizer Service Provider Interface (SPI) that receives an already-created exporter and can return a replacement.

Would an optional pre-construction callback on configure_sdk() fit the declarative configuration API? The callback could receive the exporter class and the constructor options derived from the configuration file, then return updated options.

configure_sdk(config, otlp_exporter_options=customize_exporter_options)

The callback would have this proposed signature:

def customize_exporter_options(
    # types are from exporters not from configuration models
    exporter_type: type[SpanExporter] | type[MetricExporter] | type[MetricReader] | type[LogRecordExporter],
    options: Mapping[str, Any],
) -> Mapping[str, Any]:
    ...

This is supposed to be called by distributions in the the ovveride of _OTelSDKConfigurator._configure.

If accepted I would implement it.

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.