Skip to content

Commit 00c4f31

Browse files
committed
pass plugin config args to entry point exporters, reject otlp_file_development
Plugin exporters now receive their config as kwargs: load_entry_point("group", name)(**(plugin_config or {})) Previously config values were discarded. otlp_file_development is explicitly rejected with ConfigurationError on all three signals — it's an experimental schema field not yet supported by the SDK. Assisted-by: Claude Opus 4.6
1 parent 2c227e6 commit 00c4f31

3 files changed

Lines changed: 27 additions & 6 deletions

File tree

opentelemetry-sdk/src/opentelemetry/sdk/_configuration/_logger_provider.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,20 @@ def _create_log_record_exporter(
144144
by the @_additional_properties decorator are loaded via the
145145
``opentelemetry_logs_exporter`` entry point group.
146146
"""
147+
if config.otlp_file_development is not None:
148+
raise ConfigurationError(
149+
"otlp_file_development log exporter is experimental "
150+
"and not yet supported."
151+
)
147152
for name, factory in _LOG_EXPORTER_REGISTRY.items():
148153
value = getattr(config, name, None)
149154
if value is not None:
150155
return factory(value)
151156
if config.additional_properties:
152-
name = next(iter(config.additional_properties))
153-
return load_entry_point("opentelemetry_logs_exporter", name)()
157+
name, plugin_config = next(iter(config.additional_properties.items()))
158+
return load_entry_point("opentelemetry_logs_exporter", name)(
159+
**(plugin_config or {})
160+
)
154161
raise ConfigurationError(
155162
"No exporter type specified in log record exporter config. "
156163
"Supported types: console, otlp_http, otlp_grpc."

opentelemetry-sdk/src/opentelemetry/sdk/_configuration/_meter_provider.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,13 +357,20 @@ def _create_push_metric_exporter(
357357
by the @_additional_properties decorator are loaded via the
358358
``opentelemetry_metrics_exporter`` entry point group.
359359
"""
360+
if config.otlp_file_development is not None:
361+
raise ConfigurationError(
362+
"otlp_file_development metric exporter is experimental "
363+
"and not yet supported."
364+
)
360365
for name, factory in _METRIC_EXPORTER_REGISTRY.items():
361366
value = getattr(config, name, None)
362367
if value is not None:
363368
return factory(value)
364369
if config.additional_properties:
365-
name = next(iter(config.additional_properties))
366-
return load_entry_point("opentelemetry_metrics_exporter", name)()
370+
name, plugin_config = next(iter(config.additional_properties.items()))
371+
return load_entry_point("opentelemetry_metrics_exporter", name)(
372+
**(plugin_config or {})
373+
)
367374
raise ConfigurationError(
368375
"No exporter type specified in push metric exporter config. "
369376
"Supported types: console, otlp_http, otlp_grpc."

opentelemetry-sdk/src/opentelemetry/sdk/_configuration/_tracer_provider.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,20 @@ def _create_span_exporter(config: SpanExporterConfig) -> SpanExporter:
152152
by the @_additional_properties decorator are loaded via the
153153
``opentelemetry_traces_exporter`` entry point group.
154154
"""
155+
if config.otlp_file_development is not None:
156+
raise ConfigurationError(
157+
"otlp_file_development span exporter is experimental "
158+
"and not yet supported."
159+
)
155160
for name, factory in _SPAN_EXPORTER_REGISTRY.items():
156161
value = getattr(config, name, None)
157162
if value is not None:
158163
return factory(value)
159164
if config.additional_properties:
160-
name = next(iter(config.additional_properties))
161-
return load_entry_point("opentelemetry_traces_exporter", name)()
165+
name, plugin_config = next(iter(config.additional_properties.items()))
166+
return load_entry_point("opentelemetry_traces_exporter", name)(
167+
**(plugin_config or {})
168+
)
162169
raise ConfigurationError(
163170
"No exporter type specified in span exporter config. "
164171
"Supported types: otlp_http, otlp_grpc, console."

0 commit comments

Comments
 (0)