Skip to content

chore: VCAP_SERVICES_FILE_PATH compatibility using greedy matchers#407

Merged
sjvans merged 18 commits into
2from
feat/vcap-services-file-path-greedy-matchers
Jun 26, 2026
Merged

chore: VCAP_SERVICES_FILE_PATH compatibility using greedy matchers#407
sjvans merged 18 commits into
2from
feat/vcap-services-file-path-greedy-matchers

Conversation

@PDT42

@PDT42 PDT42 commented Jan 19, 2026

Copy link
Copy Markdown
Contributor

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
PR Bot Information

Version: 1.26.5

  • Correlation ID: 81bbd7c7-2290-4812-89e9-d178ac318c25
  • Event Trigger: issue_comment.edited

Comment thread README.md Outdated
Comment thread README.md Outdated
Co-authored-by: sjvans <30337871+sjvans@users.noreply.github.com>

@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 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

Comment thread lib/utils.js
@sjvans
sjvans enabled auto-merge (squash) June 22, 2026 14:22
@sjvans
sjvans changed the base branch from main to 2 June 26, 2026 14:23
@sjvans
sjvans merged commit f623a7f into 2 Jun 26, 2026
3 checks passed
@sjvans
sjvans deleted the feat/vcap-services-file-path-greedy-matchers branch June 26, 2026 14:26
@sjvans sjvans mentioned this pull request Jun 28, 2026
1 task
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>
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