Skip to content

ARSN-601: Promote OTEL SDK packages from optionalDependencies to dependencies#2653

Merged
bert-e merged 2 commits into
development/8.4from
improvement/ARSN-601/promote-otel-sdk-deps
Jun 25, 2026
Merged

ARSN-601: Promote OTEL SDK packages from optionalDependencies to dependencies#2653
bert-e merged 2 commits into
development/8.4from
improvement/ARSN-601/promote-otel-sdk-deps

Conversation

@delthas

@delthas delthas commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Move the four OTEL SDK packages — @opentelemetry/sdk-node, sdk-trace-base, resources, exporter-trace-otlp-http — from optionalDependencies to dependencies. ioctl stays optional.

Problem

ARSN-586 classified the SDK packages as optionalDependencies, intending to mean "consumers who don't use tracing skip the ~20 MB install cost". That misuses the npm semantic.

optionalDependencies is for packages that may fail to install (typically native binaries on unsupported platforms) and whose absence the calling code tolerates gracefully. Canonical examples: fsevents, ioctl.

lib/tracing/bootstrap.ts:41 does:

const { NodeSDK } = require('@opentelemetry/sdk-node');

A bare require(). If the SDK is missing, the process crashes — that's regular dependencies semantics, not optional.

The symptom surfaced via CLDSRV-937: cloudserver's production Dockerfile uses yarn install --ignore-optional (added in 2019 during the npm→yarn migration with no commit-message rationale, never revisited). Images built that way ship without the SDK, then crash at startup when ENABLE_OTEL=true:

Error: Cannot find module '@opentelemetry/sdk-node'
Require stack:
- /usr/src/app/node_modules/arsenal/build/lib/tracing/bootstrap.js

Thanks to @DarkIsDude for flagging the optional-dep misclassification in CLDSRV-937's review.

Fix

 "dependencies": {
+    "@opentelemetry/exporter-trace-otlp-http": "^0.219.0",
+    "@opentelemetry/resources": "^2.8.0",
+    "@opentelemetry/sdk-node": "^0.219.0",
+    "@opentelemetry/sdk-trace-base": "^2.8.0",
     ...
 },
 "optionalDependencies": {
-    "@opentelemetry/exporter-trace-otlp-http": "^0.219.0",
-    "@opentelemetry/resources": "^2.8.0",
-    "@opentelemetry/sdk-node": "^0.219.0",
-    "@opentelemetry/sdk-trace-base": "^2.8.0",
     "ioctl": "^2.0.2"
 }

ioctl is the only remaining optionalDependencies entry — its usage at lib/storage/utils.js:46-51 is wrapped in try/catch with a warning fallback, so the optional semantic is honored.

lib/tracing/README.md is updated to reflect the new classification with the rationale.

Precedent in arsenal

Arsenal already ships packages as regular dependencies that not every consumer uses:

  • mongodb — some deployments use bucketd, not mongo
  • ioredis — some consumers don't use redis
  • socket.io, sproxydclient, @aws-sdk/*

There's no in-tree precedent for "opt-in feature SDK as optionalDependencies" — that was a novel (and incorrect) classification introduced by ARSN-586.

Why not the alternatives

  • try/catch around the requires in bootstrap.ts: would silently disable tracing when ENABLE_OTEL=true and SDK is missing. Worse UX — operator explicitly asked for tracing; fail-fast is preferable. Also doesn't address --ignore-optional — just papers over it.
  • Declare SDK packages in each consumer's package.json: doesn't isolate anything (other arsenal consumers without --ignore-optional already pull them in), adds friction for every future tracing consumer.
  • peerDependencies with optional: true: arsenal is git-pinned in consumers via yarn 1, which has rough handling of peer deps for git URLs. Not pragmatic.

Cost

~20 MB to backbeat / vault / sproxyd installs. Acceptable — backbeat already consumes arsenal's kafka.* tracing helpers, and broader OTEL adoption is the direction the stack is moving.

Verification

Sandbox test (yarn install --ignore-optional against this branch via file: dep):

  • node_modules/@opentelemetry/sdk-node present ✓ (the fix)
  • node_modules/ioctl absent ✓ (still optional, no regression)

Plus locally: yarn build, yarn lint, yarn jest tests/unit/tracing/ all green (71/71).

Relates to: ARSN-586, CLDSRV-937

Issue: ARSN-601

@bert-e

bert-e commented Jun 24, 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
/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 TBA
/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.

@bert-e

bert-e commented Jun 24, 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.

@delthas delthas force-pushed the improvement/ARSN-601/promote-otel-sdk-deps branch from f24f840 to dc9eb23 Compare June 24, 2026 09:50
@delthas delthas requested review from a team, DarkIsDude and SylvainSenechal and removed request for SylvainSenechal June 24, 2026 09:51
@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.03%. Comparing base (5981b88) to head (dc9eb23).

Additional details and impacted files
@@                 Coverage Diff                 @@
##           development/8.4    #2653      +/-   ##
===================================================
+ Coverage            74.00%   74.03%   +0.02%     
===================================================
  Files                  229      229              
  Lines                18503    18503              
  Branches              3820     3845      +25     
===================================================
+ Hits                 13694    13699       +5     
+ Misses                4804     4799       -5     
  Partials                 5        5              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@delthas delthas requested review from a team and benzekrimaha June 25, 2026 12:30
@delthas

delthas commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

/approve

@scality scality deleted a comment from bert-e Jun 25, 2026
@bert-e

bert-e commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/8.4

  • ✔️ development/8.5

The following branches have NOT changed:

  • development/6.4
  • development/7.10
  • development/7.4
  • development/7.70
  • development/8.1
  • development/8.2
  • development/8.3

This pull request did not target the following hotfix branch(es) so they
were left untouched:

  • hotfix/7.9.0
  • hotfix/7.10.4
  • hotfix/7.10.46
  • hotfix/7.70.14
  • hotfix/7.10.57
  • hotfix/7.70.4
  • hotfix/7.8.0
  • hotfix/7.70.20
  • hotfix/7.10.29
  • hotfix/6.4.7
  • hotfix/7.4.7
  • hotfix/7.4.4
  • hotfix/7.2.0
  • hotfix/7.10.1
  • hotfix/7.4.2
  • hotfix/7.10.36
  • hotfix/7.4.5
  • hotfix/7.4.1
  • hotfix/7.10.31
  • hotfix/7.4.0
  • hotfix/7.70.25
  • hotfix/7.4.8
  • hotfix/7.6.0
  • hotfix/7.7.0
  • hotfix/7.5.0
  • hotfix/7.10.47
  • hotfix/7.4.9
  • hotfix/7.10.3
  • hotfix/7.10.43
  • hotfix/7.10.2
  • hotfix/7.4.3
  • hotfix/7.4.10
  • hotfix/7.10.0
  • hotfix/7.4.6

Please check the status of the associated issue ARSN-601.

Goodbye delthas.

The following options are set: approve

@bert-e bert-e merged commit dc9eb23 into development/8.4 Jun 25, 2026
13 checks passed
@bert-e bert-e deleted the improvement/ARSN-601/promote-otel-sdk-deps branch June 25, 2026 12:46
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.

5 participants