chore: VCAP_SERVICES_FILE_PATH compatibility
#400
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.
Relates to: #389
Problem
Currently, when using
VCAP_SERVICES_FILE_PATHvia CF feature flagfile-based-vcap-services, a user provided service instance of Cloud Logging (or dynatrace) will not be correctly resolved. The relevant local util:telemetry/lib/utils.js
Lines 114 to 130 in ae3e619
... is not equipped to resolve binding information from anywhere but the
VCAP_SERVICESenv variable.Fix
However, the existing
cds.envis - given we provide the correct matching predicate incds.requires.telemetry.vcap. Currently, we use:telemetry/package.json
Lines 126 to 128 in ae3e619
... but instruct integrating developers to add
cloud-loggingto the tags of the user provided service, rather than a label. It looks like the label of user provided services will always beuser-provided. Matching ofuser-providedservices works out, if the integrating developer updates their local config like:{ "cds": { "requires": { "telemetry": { "vcap": { "label": false, "tag": "cloud-logging" } } } } }... as described in CAPire: https://cap.cloud.sap/docs/node.js/cds-connect#vcap_services
Solution
Since it seems, a non-user-provided instance comes tagged with
Cloud Loggingby default, we might want to consider updating our default matching predicate inpackage.jsonaccordingly and get that much closer to what's described in the cloud logging docs. This PR suggests the required changes.Less Intrusive Alternative
In case we do not want to update our default matching predicates, we should update the
READMEwith the config section, that will causelabelto be ignored during matching, from above.