fix(UNTRACKED): support "none" value for OTEL exporters to disable telemetry
#64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When
OTEL_TRACES_EXPORTER=noneorOTEL_METRICS_EXPORTER=noneis set, plugin pods crash on startup with:Real-world scenario
In in-vpc or single-node clusters, you might notice this issue in plugin pods (created by the job-execution-operator) when you set those environment variables in the
JOB_ENV_VARSblock.https://github.com/Unstructured-IO/platform-applications-cd/blob/9cf7335f3fe620106c61da208c12d44539d743bc/apps/dataplane/etl-operator/values.yaml#L52
Root cause: The code splits the env var by comma but doesn't filter "none", then tries to initialize exporters for it, hitting the
NotImplementedErrorin_add_trace_exporter()and_get_metrics_reader().Solution
1. Filter "none" from exporter lists (lines 33, 37)
2. Return None when no exporters configured (lines 45-49, 59-63)
Compatibility
FastAPIInstrumentor.instrument_app()explicitly supportsNonevalues fortracer_providerandmeter_providerparameters (defaults to None). When None, OTEL SDK uses its built-in no-op providers.Testing
Before: Plugin crashes with
NotImplementedErrorAfter: Plugin starts successfully with telemetry disabled
Changes
Deployment