Add option to disable sending telemetry to an Otel Collector#647
Merged
Conversation
…_anon` (#644) * Add a configure_tracing function to set up a trace provider * Remove unused OTEL_EXPORTER_OTLP_HEADERS env var * Add a instrument_pika_producer to producer.py to instrument and enrich the producer * Instrument the cli Add a function to get set the relevent otel env vars before calling configure_logging and configure_tracing * Instrument orthanc raw * Instrument orthanc anon * Use logging fixtures from the conftest * Add tests for configure_tracing * Manually create a span before publishing the message This way the span belongs to the CLI rather than to the queue * Remove test of configure_tracing as we're no longer returning a bool * Add OTEL_SDK_DISABLED environment variable to disable sending telemetry
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #647 +/- ##
==========================================
- Coverage 88.53% 88.52% -0.02%
==========================================
Files 80 80
Lines 3813 3834 +21
==========================================
+ Hits 3376 3394 +18
- Misses 437 440 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
p-j-smith
commented
Jun 30, 2026
adc735e to
b66196e
Compare
stefpiatek
approved these changes
Jul 1, 2026
stefpiatek
left a comment
Contributor
There was a problem hiding this comment.
Thanks Paul, looking good
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Fixes #646
OTEL_SDK_DISABLEDenvironment variable to determine whether telemetry should be disabledOTEL_SDK_DISABLEDisFalsebutOTEL_EXPORTER_OTLP_ENDPOINTis empty (otherwise we will still see errors in the logs)LoggerProvidercreated by opentelemetry, otherwise we see a warning in the logs:Overriding of current LoggerProvider is not allowedI've tested this on the GAE and it stops the error messages. If the sdk is enabled, we also need to make sure the service name of the endpoint is added to the
no_proxyvariable (or usedocker.host.internalas the hostname for the endpoint)Type of change
Please delete options accordingly to the description.
Suggested Checklist
mainbranch.squash and merge