Manually instrument traces in pixl_cli, orthanc_raw, and orthanc_anon#644
Merged
Conversation
Add a function to get set the relevent otel env vars before calling configure_logging and configure_tracing
This way the span belongs to the CLI rather than to the queue
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #644 +/- ##
==========================================
+ Coverage 85.85% 88.53% +2.68%
==========================================
Files 75 80 +5
Lines 3500 3813 +313
==========================================
+ Hits 3005 3376 +371
+ Misses 495 437 -58 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
stefpiatek
approved these changes
Jun 24, 2026
p-j-smith
added a commit
that referenced
this pull request
Jun 30, 2026
…_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
p-j-smith
added a commit
that referenced
this pull request
Jul 1, 2026
* Add OTEL_SDK_DISABLED environment variable to disable sending telemetry * Manually instrument traces in `pixl_cli`, `orthanc_raw`, and `orthanc_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 * Use OTEL_SDK_DISABLED to check whether telemtry collection should be disabled * Set OTEL_PYTHON_LOG_AUTO_INSTRUMENTATION to false * Reuse existing logging provider if it exists * Remove unused environment variable * Set OTEL_SDK_DISABLED to true for unit tests * Disable the otel sdk in the core unit tests too * Add tests to check provider is reused or created correctly * Set OTEL_SDK_DISABLED to true for cli unit tests * Add a core.telemetry module for configuring otel * Import configure_logging and configure_tracing from the new telemetry module * Add missing docstring * Add comments to clarify why we need to reuse an existing otel provider * Make linters happy
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 #639 Instrument the cli, Orthanc Raw, and Orthanc Anon so we can follow a DICOM study end-to-end
pixl_core.tracing.configure_tracingto set up a tracing provider_configure_telemetry_env_vars. Then configure tracing and instrument pikarecord_dicom_headers, not for the actual C-MOVEType of change
Please delete options accordingly to the description.
Suggested Checklist
mainbranch.squash and mergeAll logs selected for a given
trace_id(the trace corresponds to processing one of the DICOM studies in the integration tests):logs.mov
All spans for the same
trace_idtrace.mov