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

Offen
#5,959 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 2 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
18/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
python

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Python
Sterne
2.7k
Forks
1.1k
Ø Merge
3 T. 12 Std.
Gemergte PRs (30 T.)
16

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus open-telemetry/opentelemetry-python

Alle Issues in open-telemetry/opentelemetry-python

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.