Skip to content

v2.0.0#441

Merged
sjvans merged 13 commits into
mainfrom
2
Jun 29, 2026
Merged

v2.0.0#441
sjvans merged 13 commits into
mainfrom
2

Conversation

@sjvans

@sjvans sjvans commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Release: v2.0.0 — OpenTelemetry SDK 2.0 Support

New Features

🚀 This major release upgrades @cap-js/telemetry to support OpenTelemetry SDK 2.0, introduces @opentelemetry/instrumentation-undici as a default instrumentation, adds CALM (@sap/xotel-agent-ext-js) integration, and drops support for @sap/cds^8.

Changes

  • package.json: Bumped version to 2.0.0. Updated all @opentelemetry/* dependencies to SDK 2.x-compatible versions. Replaced @opentelemetry/host-metrics with @opentelemetry/instrumentation-host-metrics. Added @opentelemetry/instrumentation-undici as a new default instrumentation. Dropped @sap/cds^8 peer dependency support. Updated vcap binding config for Dynatrace and Cloud Logging to also match by tag.
  • cds-plugin.js: Removed the startup check that blocked usage with OpenTelemetry SDK 2.0. Added a workaround for cds build command detection.
  • lib/index.js: Refactored to support two setup modes: setup_standalone (default) and setup_with_calm (when @sap/xotel-agent-ext-js is detected). Auto-detection of @opentelemetry/instrumentation-host-metrics as an instrumentation, with metricGroups limited to ['process.cpu', 'process.memory'] by default.
  • lib/tracing/index.js: Added CALM delegate support for span processors. Replaced deprecated Resource with resourceFromAttributes. Updated to use spanProcessors constructor option instead of addSpanProcessor. Added SAP Passport cleanup for new transactions.
  • lib/metrics/index.js: Added CALM delegate support for metric readers. Replaced deprecated Resource/View/DropAggregation APIs with resourceFromAttributes and readers constructor option. Removed lib/metrics/host.js (replaced by instrumentation-based approach).
  • lib/logging/index.js: Added CALM delegate support for log processors. Refactored provider initialization. Improved error message for missing Cloud Logging credentials.
  • lib/utils.js: Replaced getEnv/getEnvWithoutDefaults with getStringFromEnv. Replaced new Resource(...) with resourceFromAttributes(...) throughout.
  • lib/exporter/ConsoleSpanExporter.js: Updated span parent references from deprecated parentSpanId to parentSpanContext?.spanId.
  • lib/exporter/ConsoleMetricExporter.js: Updated scope name check for host metrics instrumentation.
  • lib/tracing/trace.js: Updated instrumentationLibrary reference to instrumentationScope (SDK 2.0 rename).
  • README.md: Removed the "not yet supported" warning for OpenTelemetry SDK 2.0. Updated host metrics docs to reflect the new metricGroups configuration. Added undici to default instrumentations list. Clarified Cloud Logging user-provided service tag requirement to "Cloud Logging" only.
  • CHANGELOG.md: Updated version header to 2.0.0 with added, changed, fixed, and removed entries.
  • .github/workflows/ci.yml: Updated CI matrix to test only with cds-version: [9]; added branch 2 to push triggers.
  • test/bookshop/.cdsrc.json: Extracted CDS profile-based test configurations from package.json into a dedicated config file.
  • Various test files: Migrated from cds.test().in(...) to cds.test(..., '--profile', ...) pattern; reduced wait times from 300ms to 150ms in metrics tests.
  • 🔄 Regenerate and Update Summary
PR Bot Information

Version: 1.26.11

  • Event Trigger: pull_request.edited
  • Output Template: Default Template
  • Correlation ID: 99a59df9-b306-487f-9485-bc9d1b221f55
  • Summary Prompt: Default Prompt
  • File Content Strategy: Full file content
  • LLM: anthropic--claude-4.6-sonnet

compiled of:

@hyperspace-pr-bot hyperspace-pr-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR only bumps the version from 1.6.0/1.7.0 to 2.0.0 in two files. The changes are minimal and straightforward — no logic, no code, nothing to flag for correctness, bugs, or security.

The PR is clean. The only notable observation is that CHANGELOG.md still marks the version as tbd (line 7), which is expected for a pre-release entry and not an issue in itself.

PR Bot Information

Version: 1.26.11

  • Correlation ID: 216ed46f-8901-4653-aad4-4e50c5c5c466
  • LLM: anthropic--claude-4.6-sonnet
  • File Content Strategy: Full file content
  • Event Trigger: pull_request.opened

sjvans and others added 6 commits June 25, 2026 21:13
Adds HTTP semantic convention attributes to remote service spans by
wrapping `fetchClient.executeHttpRequest`.

Alternative considered: Using `@opentelemetry/instrumentation-undici`
response hooks to propagate attributes from HTTP child spans. This
approach was rejected as it requires an additional dependency and
creates duplicate spans.

---------

Co-authored-by: D050513 <sebastian.van.syckel@sap.com>
Co-authored-by: sjvans <30337871+sjvans@users.noreply.github.com>
- [x] traces
- [x] metrics
- [x] logs
- [x] #442

---------

Co-authored-by: I548646 <paul.erlenwein@sap.com>
Co-authored-by: Paul <paul.erlenwein@gmail.com>
)

# Improve `VCAP_SERVICES` Service Binding Resolution with Greedy
Matchers

### Chore

🔧 Updated service instance matching for SAP Cloud Logging and Dynatrace
to use greedy (array-based) VCAP matchers, extending the default
matching without breaking existing behavior. Error messages and
documentation have been updated to guide users toward the correct
configuration.

### Changes

* `package.json`: Updated `vcap` matching for `telemetry-to-dynatrace`
and `telemetry-to-cloud-logging` from a single object to an array of
matchers. Dynatrace now matches by `label: "dynatrace"` or `tag:
"dynatrace"`; Cloud Logging matches by `label: "cloud-logging"` or `tag:
"Cloud Logging"`.

* `lib/utils.js`: Improved inline comments to clearly document the
legacy compatibility behavior for `getCredsForDTAsUPS()` and
`getCredsForCLSAsUPS()`. Updated the warning message for Cloud Logging
user-provided services to recommend only the `"Cloud Logging"` tag
(dropped `"cloud-logging"` from the recommendation).

* `lib/logging/index.js`, `lib/metrics/index.js`,
`lib/tracing/index.js`: Improved error messages when credentials are not
found — now explicitly instruct users to ensure the bound service
instance uses the correct tag (`"Cloud Logging"` or `"dynatrace"`).

* `README.md`: Clarified that user-provided service instances for SAP
Cloud Logging must use the tag `"Cloud Logging"` (removed reference to
the legacy `cloud-logging` tag). Added a tip with the `cf
update-user-provided-service` command and a link to CAP's service
binding documentation.

- [ ] 🔄 Regenerate and Update Summary



<details>
<summary>PR Bot Information</summary>

**Version:** `1.26.5`

- Correlation ID: `81bbd7c7-2290-4812-89e9-d178ac318c25`
- Event Trigger: `issue_comment.edited`
</details>

---------

Co-authored-by: sjvans <30337871+sjvans@users.noreply.github.com>
# Fix: Workaround for `cds.cli.command` Bug with `build` Command

### Bug Fix

🐛 Added a workaround to prevent the telemetry plugin from loading when
the `cds build` command is invoked. Due to a bug in `cds.cli.command`,
the `build` command incorrectly resolves to an empty string (`''`),
causing the plugin initialization check to pass unintentionally.

### Changes

* `cds-plugin.js`: Added an early return guard that checks if `build` is
present in `process.argv`. This ensures the plugin exits before
proceeding with initialization when the `cds build` command is used,
mirroring the existing workaround for `cds add`.

- [ ] 🔄 Regenerate and Update Summary



<details>
<summary>PR Bot Information</summary>

**Version:** `1.26.5`

- Correlation ID: `4743ca7e-193a-4675-a529-8872b09ede9e`
- Summary Prompt: [Default
Prompt](https://github.tools.sap/intelligent-insights/i2-pull-request/blob/main/src/services/llm/prompts/summary_instructions_prompt.md)
- LLM: `anthropic--claude-4.6-sonnet`
- Output Template: [Default
Template](https://github.tools.sap/intelligent-insights/i2-pull-request/blob/main/src/services/llm/prompts/summary_default_output_template.md)
- Event Trigger: `pull_request.ready_for_review`
- File Content Strategy: Full file content
</details>

---------

Co-authored-by: hyperspace-insights[bot] <209611008+hyperspace-insights[bot]@users.noreply.github.com>
@sjvans sjvans mentioned this pull request Jun 26, 2026
1 task
# Chore: Upgrade to `cds^10` — Migrate Test Config to `.cdsrc.json` and
CDS Profiles

### Refactor

♻️ Migrates test configuration from inline `process.env` overrides to a
dedicated `.cdsrc.json` file and CDS CLI profiles, aligning with the
`cds^10` approach for environment/profile-based configuration. Also
includes test timing optimizations and minor bug fixes.

### Changes

* `.github/workflows/ci.yml`: Commented out the `cds@8` downgrade step;
updated comment to reference `cds@9`.
* `.github/workflows/release.yml`: Added a `REVISIT` comment to remove
the `better-sqlite3` install workaround with `cds^10`.
* `.gitignore`: Removed `test/bookshop/.cdsrc.json` from the ignore list
so it can be tracked in version control.
* `test/bookshop/.cdsrc.json`: New file defining CDS profiles
(`logging`, `metrics`, `metrics-outbox`, `metrics-outbox-disabled`,
`tracing-attributes`, `persistent-outbox`, `without-outbox`)
consolidating telemetry, messaging, and metrics settings previously
scattered across test files.
* `test/bookshop/package.json`: Removed `_outbox` and profile-specific
`[metrics-outbox]`/`[metrics-outbox-disabled]` blocks (now in
`.cdsrc.json`); added `_scheduling: true`.
* `test/logging.test.js`: Removed inline `process.env` overrides for
telemetry/log format; switched to `cds.test(..., '--profile',
'logging')` with a minimal remaining env override for
`cls_custom_fields`.
* `test/metrics.test.js`: Removed `exportIntervalMillis` env override;
switched to `cds.test(..., '--profile', 'metrics')`.
* `test/metrics-outbox.test.js` /
`test/metrics-outbox-multitenant.test.js`: Reduced metric collection
wait times from `300ms` to `150ms`; fixed retry loop bug where both
loops checked `E1` instead of `E1`/`E2` respectively.
* `test/tracing-attributes.test.js`: Removed inline exporter env var;
switched to `cds.test(..., '--profile', 'tracing-attributes')`.
* `test/tracing-messaging-persistent-outbox.test.js`: Renamed `CASE` to
`persistent-outbox`; simplified env setup; marked `describe` block as
`skip` pending vitest migration.
* `test/tracing-messaging-without-outbox.test.js`: Renamed `CASE` to
`without-outbox`; simplified env setup using `outboxed: false`.
* `test/tracing-messaging-with-in-memory-outbox.test.js`: Removed this
test file entirely.
* `test/tracing-messaging.js`: Switched from `cds.test().in(...)` to
`cds.test(..., '--profile', CASE)`.
* `test/tracing.test.js`: Switched from `cds.test().in(...)` to
`cds.test(...)`.

- [ ] 🔄 Regenerate and Update Summary



<details>
<summary>PR Bot Information</summary>

**Version:** `1.26.11`

- Summary Prompt: [Default
Prompt](https://github.tools.sap/intelligent-insights/i2-pull-request/blob/main/src/services/llm/prompts/summary_instructions_prompt.md)
- Correlation ID: `14c5ae4d-4c97-4eff-a004-330c9fdcf2fe`
- Event Trigger: `pull_request.edited`
- File Content Strategy: Full file content
- Output Template: [Default
Template](https://github.tools.sap/intelligent-insights/i2-pull-request/blob/main/src/services/llm/prompts/summary_default_output_template.md)
- LLM: `anthropic--claude-4.6-sonnet`
</details>
Comment thread .github/workflows/ci.yml Outdated
Comment thread test/bookshop/package.json Outdated
Comment thread CHANGELOG.md Outdated
@sjvans
sjvans marked this pull request as ready for review June 28, 2026 10:35
@hyperspace-pr-bot

Copy link
Copy Markdown
Contributor

Summary

The following content is AI-generated and provides a summary of the pull request:


Release: v2.0.0 — OpenTelemetry SDK 2.0 Support

New Features

🚀 This major release upgrades @cap-js/telemetry to support OpenTelemetry SDK 2.0, introduces several new capabilities, and removes legacy support.

Key highlights:

  • ✨ Full OpenTelemetry SDK 2.0 compatibility — removed the startup check that previously blocked usage
  • ✨ Added @opentelemetry/instrumentation-undici as a default instrumentation
  • ✨ Added CALM (@sap/xotel-agent-ext-js) integration — auto-detects CALM and delegates span processors, metric readers, and log processors accordingly
  • ✨ Replaced deprecated @opentelemetry/host-metrics with @opentelemetry/instrumentation-host-metrics, with auto-detection and metricGroups defaulting to ['process.cpu', 'process.memory']
  • ✨ SAP Passport cleanup added for new database transactions
  • ⚠️ Breaking: Dropped support for @sap/cds^8

Changes

  • package.json: Bumped version to 2.0.0. Updated all @opentelemetry/* dependencies to SDK 2.x versions. Added @opentelemetry/instrumentation-undici. Dropped @sap/cds^8 peer dependency. Updated vcap binding config for Dynatrace and Cloud Logging to also match by tag.
  • cds-plugin.js: Removed the SDK 2.0 startup check. Added a workaround for cds build command detection.
  • lib/index.js: Refactored into setup_standalone and setup_with_calm modes. Added auto-detection of @opentelemetry/instrumentation-host-metrics with metricGroups limiting.
  • lib/tracing/index.js: Added CALM delegate support for span processors. Replaced deprecated Resource with resourceFromAttributes. Uses spanProcessors constructor option. Added SAP Passport cleanup.
  • lib/metrics/index.js: Added CALM delegate support for metric readers. Replaced deprecated Resource/View/DropAggregation with resourceFromAttributes and readers constructor option. Removed lib/metrics/host.js.
  • lib/logging/index.js: Added CALM delegate support for log processors. Refactored provider initialization. Improved error message for missing Cloud Logging credentials.
  • lib/utils.js: Replaced getEnv/getEnvWithoutDefaults with getStringFromEnv. Replaced new Resource(...) with resourceFromAttributes(...).
  • lib/exporter/ConsoleSpanExporter.js: Updated span parent references from deprecated parentSpanId to parentSpanContext?.spanId.
  • lib/exporter/ConsoleMetricExporter.js: Updated scope name check for the new host metrics instrumentation.
  • lib/tracing/trace.js: Updated instrumentationLibrary reference to instrumentationScope (SDK 2.0 rename).
  • README.md: Removed "not yet supported" warning. Updated host metrics docs. Added undici to default instrumentations. Clarified Cloud Logging tag requirement to "Cloud Logging" only.
  • CHANGELOG.md: Updated with 2.0.0 changelog entries.
  • .github/workflows/ci.yml: CI matrix now tests only cds-version: [9]; added branch 2 to push triggers.
  • test/bookshop/.cdsrc.json: Extracted CDS profile-based test configurations into a dedicated config file.
  • Various test files: Migrated from cds.test().in(...) to cds.test(..., '--profile', ...) pattern; reduced metric wait times from 300ms to 150ms.

  • 🔄 Regenerate and Update Summary
  • ✏️ Insert as PR Description (deletes this comment)
  • 🗑️ Delete comment
PR Bot Information

Version: 1.26.11

  • LLM: anthropic--claude-4.6-sonnet
  • Event Trigger: pull_request.ready_for_review
  • File Content Strategy: Full file content
  • Output Template: Default Template
  • Correlation ID: fceb2217-dcda-4cfa-8a5d-c4a4266ebe34
  • Summary Prompt: Default Prompt

@hyperspace-pr-bot hyperspace-pr-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR is a well-structured major version release upgrading to OpenTelemetry SDK 2.0. Please address the existing comments (branch 2 in CI triggers, _scheduling leftover in test/bookshop/package.json, and the CHANGELOG.md date), as well as the newly flagged issues: the invalid actions/checkout@v7.0.0 version that will break CI, two undefined processor bugs in the Dynatrace OneAgent + CALM path in lib/tracing/index.js, and the missing null-guard on pkg.dependencies in lib/index.js.

PR Bot Information

Version: 1.26.11

  • LLM: anthropic--claude-4.6-sonnet
  • Correlation ID: fceb2217-dcda-4cfa-8a5d-c4a4266ebe34
  • Event Trigger: pull_request.ready_for_review
  • File Content Strategy: Full file content

Comment thread lib/tracing/index.js
Comment thread lib/index.js
Comment thread lib/tracing/index.js
Comment thread .github/workflows/ci.yml

@PDT42 PDT42 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Comment thread lib/metrics/index.js
Comment thread lib/metrics/index.js
Comment thread lib/index.js

@hm23 hm23 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I like, no comments from my side.

@sjvans
sjvans merged commit 87b3c60 into main Jun 29, 2026
6 checks passed
@sjvans
sjvans deleted the 2 branch June 29, 2026 17:50
@sjvans sjvans mentioned this pull request Jun 29, 2026
6 tasks
sjvans added a commit that referenced this pull request Jul 3, 2026
- [x] package.json
- [x] package-lock.json
- [x] release job
- [x] check for unused vars (cf.
#441 (comment))
- [x] rm cds < 9 checks
- [x] #447

---------

Co-authored-by: sjvans <sjvans@users.noreply.github.com>
Co-authored-by: Vitaly Kozyura <58591662+vkozyura@users.noreply.github.com>
Co-authored-by: I548646 <paul.erlenwein@sap.com>
Co-authored-by: Paul <paul.erlenwein@gmail.com>
Co-authored-by: hyperspace-insights[bot] <209611008+hyperspace-insights[bot]@users.noreply.github.com>
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.

4 participants