chore: VCAP_SERVICES_FILE_PATH compatibility using greedy matchers#407
Merged
Conversation
sjvans
reviewed
Jun 22, 2026
sjvans
reviewed
Jun 22, 2026
Co-authored-by: sjvans <30337871+sjvans@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
The PR makes good improvements — error messages are more actionable, matching predicates are extended via vcap arrays, and comments are clearer. The one substantive issue is that the silent match on the deprecated "cloud-logging" tag in getCredsForCLSAsUPS() is inconsistent with the PR's stated intent to promote "Cloud Logging" as the sole required tag; it should emit the same deprecation warning as the name-based fallback.
PR Bot Information
Version: 1.26.5
- File Content Strategy: Full file content
- LLM:
anthropic--claude-4.6-sonnet - Event Trigger:
pull_request.ready_for_review - Correlation ID:
957f0e1c-6868-4b5a-9282-5da4a9e4f2b7
sjvans
approved these changes
Jun 22, 2026
sjvans
enabled auto-merge (squash)
June 22, 2026 14:22
sjvans
added a commit
that referenced
this pull request
Jun 29, 2026
# 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 <details> <summary>PR Bot Information</summary> **Version:** `1.26.11` - Event Trigger: `pull_request.edited` - Output Template: [Default Template](https://github.tools.sap/intelligent-insights/i2-pull-request/blob/main/src/services/llm/prompts/summary_default_output_template.md) - Correlation ID: `99a59df9-b306-487f-9485-bc9d1b221f55` - Summary Prompt: [Default Prompt](https://github.tools.sap/intelligent-insights/i2-pull-request/blob/main/src/services/llm/prompts/summary_instructions_prompt.md) - File Content Strategy: Full file content - LLM: `anthropic--claude-4.6-sonnet` </details> --- compiled of: - #364 + #424 + #442 - #407 - #374 - #425 - #443 --------- 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>
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.
Improve
VCAP_SERVICESService Binding Resolution with Greedy MatchersChore
🔧 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: Updatedvcapmatching fortelemetry-to-dynatraceandtelemetry-to-cloud-loggingfrom a single object to an array of matchers. Dynatrace now matches bylabel: "dynatrace"ortag: "dynatrace"; Cloud Logging matches bylabel: "cloud-logging"ortag: "Cloud Logging".lib/utils.js: Improved inline comments to clearly document the legacy compatibility behavior forgetCredsForDTAsUPS()andgetCredsForCLSAsUPS(). 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 legacycloud-loggingtag). Added a tip with thecf update-user-provided-servicecommand and a link to CAP's service binding documentation.PR Bot Information
Version:
1.26.581bbd7c7-2290-4812-89e9-d178ac318c25issue_comment.edited