fix(tracing): trust preconfigured provider for APMPlus - #813
Merged
Conversation
feng-95
force-pushed
the
fix/apmplus-global-provider
branch
from
August 4, 2026 14:45
0f494f9 to
387a856
Compare
warm-wm
approved these changes
Aug 4, 2026
warm-wm
approved these changes
Aug 4, 2026
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.
Summary
ProxyTracerProviderglobal tracer provider that exists before VeADK initialization as externally managing the APMPlus trace pipeline.APMPlusExporterspan processor in that case.ENABLE_APMPLUS=trueappend behavior so VeADK can still initialize its APMPlus metric uploader; the appended exporter's trace processor is not registered because tracer initialization has already completed.Why
When the OpenTelemetry plugin or application code has already installed a global tracer provider and sends traces through
localhost:4318, VeADK must not add a second direct APMPlus trace pipeline. This is the minimal emergency fix and intentionally does not introduce the exporterregister()mechanism.Validation
.venv/bin/pytest tests/test_tracing.py -q— 8 passed.git diff --check, pre-commit CI, gitleaks CI, and Python 3.10/3.12 unit-test CI all passed.ENABLE_APMPLUSon/off × explicit exporter present/absent, including metric-uploader retention for the env-enabled cases.387a856with a code-preconfigured global provider,ENABLE_APMPLUS=true, trace OTLP relay atlocalhost:4318, and metrics relay atlocalhost:4319:0b5f914a0297440948f592fea2f4aa64: 4 received spans, 4 unique spans, relay duplicate count 0, and APMPlus cloud query returned 4 spans;localhost:4318) and zero VeADK direct APMPlus trace processors;gen_ai_chat_count=1for the unique test service.Known boundary
opentelemetry-instrumentcurrently installs an empty globalMeterProviderwhenOTEL_METRICS_EXPORTER=none. APMPlus cannot replace that provider, so this environment-specific metrics case is excluded from PR #813 acceptance; trace export remains correct and non-duplicated. This is independent of the global tracer-provider deduplication in this PR.Follow-up
Exporter runtime registration and preserving explicitly supplied APMPlus exporters for metrics remain in the dependent Draft PR #810. After this PR merges, #810 will contain only the register increment.