Simplify OpenTelemetry approach - always enable instrumentation

- Always enable OpenTelemetry instrumentation, use OTEL_EXPORT_ENABLED for data export control
- Remove conditional checks from middleware, metrics, and decorators
- Simplify CI configuration to use single test job instead of parallel jobs
- Update tests to remove conditional logic and mocking of is_enabled()
- Add comprehensive environment variable documentation to README
- Update config.py to always add OpenTelemetry middleware
- Replace ENABLE_OPENTELEMETRY/OTEL_ENABLED with OTEL_EXPORT_ENABLED

This approach is much simpler and eliminates the complexity of conditional
OpenTelemetry loading while still allowing control over data export.
This commit is contained in:
Oliver Falk
2025-10-17 09:54:59 +02:00
parent b4e10e3ec5
commit 4d86a11728
6 changed files with 128 additions and 240 deletions

View File

@@ -35,6 +35,9 @@ MIDDLEWARE.extend(
]
)
# Add OpenTelemetry middleware (always enabled now)
MIDDLEWARE.insert(0, "ivatar.opentelemetry_middleware.OpenTelemetryMiddleware")
# Add OpenTelemetry middleware only if feature flag is enabled
# Note: This will be checked at runtime, not at import time
MIDDLEWARE.insert(