configureOpenTelemetrySdk
fun configureOpenTelemetrySdk(exporterConfig: BaseExporterConfig, additionalResource: Resource = Resource.create(
Attributes.of(AttributeKey.stringKey("service.name"), "unknown-service")
)): OpenTelemetrySdk(source)
Initializes the OpenTelemetrySdk using a provided BaseExporterConfig.
This method sets up a SdkTracerProvider with:
Span processors for the given configuration.
Span limits.
A shutdown hook to flush and shut down traces gracefully if ExporterCommonSettings.flushOnShutdown is true.
Return
the initialized OpenTelemetrySdk instance.
Parameters
exporterConfig
the exporter configuration defining how spans should be exported. Examples include:
LangfuseExporterConfig sends spans to a Langfuse OTLP endpoint.
WeaveExporterConfig sends spans to a W&B Weave OTLP endpoint.
ConsoleExporterConfig logs spans to the console only (for local debugging).
additionalResource
optional extra Resource attributes merged with the default OpenTelemetry resource. Use this to set values such as "service.name"