Skip to content

Fix OTEL init order (CLDSRV-1023) - #6326

Draft
delthas wants to merge 1 commit into
development/9.4from
bugfix/CLDSRV-1023/fix-otel-init-order
Draft

delthas wants to merge 1 commit into
development/9.4from
bugfix/CLDSRV-1023/fix-otel-init-order

Conversation

@delthas

@delthas delthas commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Fix OTEL auto-instrumentation per CLDSRV-1023.

The guard in index.js required ./lib/Config to decide whether to skip init on the cluster primary, which transitively loaded mongodb (260 modules) and ioredis (108 modules) via arsenal's barrel before tracing.init() ran — so MongoDBInstrumentation and IORedisInstrumentation never patched them.

Drop the primary-skip, initialize unconditionally when ENABLE_OTEL=true. Primary now boots an idle SDK (bounded cost: one BatchSpanProcessor + exporter connection).

Issue: CLDSRV-1023

@bert-e

bert-e commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Hello delthas,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval ⭐
/bypass_build_status Bypass the build and test status ⭐
/bypass_commit_size Bypass the check on the size of the changeset TBA ⭐
/bypass_incompatible_branch Bypass the check on the source branch prefix ⭐
/bypass_jira_check Bypass the Jira issue check ⭐
/bypass_peer_approval Bypass the pull request peers' approval ⭐
/bypass_leader_approval Bypass the pull request leaders' approval ⭐
/bypass_source_branch_lineage Bypass the cross-branch contamination check ⭐
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request.
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@scality scality deleted a comment from bert-e Oct 13, 2026
Comment thread tests/unit/tracing.js Outdated
@bert-e

bert-e commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Request integration branches

Waiting for integration branch creation to be requested by the user.

To request integration branches, please comment on this pull request with the following command:

/create_integration_branches

Alternatively, the /approve and /create_pull_requests commands will automatically
create the integration branches.

Comment thread tests/unit/tracing.js Outdated
@codecov

codecov Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.47%. Comparing base (a8fd9ea) to head (59f4d65).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff                @@
##           development/9.4    #6326   +/-   ##
================================================
  Coverage            86.47%   86.47%           
================================================
  Files                  212      212           
  Lines                14569    14569           
================================================
  Hits                 12598    12598           
  Misses                1971     1971           
Flag Coverage Δ
checksums-disabled-tests 35.33% <ø> (ø)
file-ft-tests 69.97% <ø> (ø)
file-ft-tests-null-compat 70.47% <ø> (ø)
kmip-ft-tests 28.10% <ø> (ø)
mongo-v0-ft-tests 71.10% <ø> (-0.02%) ⬇️
mongo-v1-ft-tests 71.08% <ø> (ø)
multiple-backend 36.11% <ø> (ø)
s3c-ft-tests-v0 65.01% <ø> (+0.01%) ⬆️
s3c-ft-tests-v0-null-compat 65.06% <ø> (+0.01%) ⬆️
s3c-ft-tests-v1 64.98% <ø> (ø)
sur-tests 37.55% <ø> (+0.87%) ⬆️
sur-tests-inflights 39.48% <ø> (ø)
unit 74.33% <ø> (ø)
utapi-v2-tests 35.31% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The guard previously required ./lib/Config to decide whether to skip
tracing.init() on the cluster primary. Config top-level-requires
arsenal, which eagerly loads mongodb and ioredis clients. By the time
tracing.init() ran, those modules were already in require.cache, so
require-in-the-middle hooks installed by MongoDBInstrumentation and
IORedisInstrumentation never patched them and spans silently never
emerged (HTTP spans worked because HttpInstrumentation patches the
Node core modules directly).

Drop the primary-skip entirely and initialize unconditionally when
ENABLE_OTEL=true. The cluster primary now boots a BatchSpanProcessor
that has nothing to export; the fixed, bounded cost is accepted in
exchange for correct auto-instrumentation on workers.

Issue: CLDSRV-1023
@delthas
delthas force-pushed the bugfix/CLDSRV-1023/fix-otel-init-order branch from 22a6170 to 59f4d65 Compare October 13, 2026 14:50

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants