fix(otel): instrumentation providers do not need a config

This commit is contained in:
Emilio Garcia 2025-10-07 10:09:49 -04:00
parent 8fe3a25158
commit deedb3fb46
5 changed files with 59 additions and 36 deletions

View file

@ -36,6 +36,9 @@ class OTelInstrumentationProvider(InstrumentationProvider):
def model_post_init(self, __context):
"""Initialize OpenTelemetry after Pydantic validation."""
# Provide default config if missing and validate type
if getattr(self, "config", None) is None:
self.config = OTelConfig()
assert isinstance(self.config, OTelConfig) # Type hint for IDE/linter
# Warn if OTLP endpoints not configured