Skip to content

feat(otel-ext): add Generic OTel Collector service binding support with mTLS from credentials - #421

Closed
dimitarKiryakov wants to merge 2 commits into
SAP:mainfrom
dimitarKiryakov:feat/generic-otel-collector-binding
Closed

feat(otel-ext): add Generic OTel Collector service binding support with mTLS from credentials#421
dimitarKiryakov wants to merge 2 commits into
SAP:mainfrom
dimitarKiryakov:feat/generic-otel-collector-binding

Conversation

@dimitarKiryakov

@dimitarKiryakov dimitarKiryakov commented Aug 21, 2026

Copy link
Copy Markdown

Summary

  • Introduces a Generic OTel Collector path in the OpenTelemetry agent extension: set sap.otel.collector.cf.binding.name to the name of any CF service instance (managed or user-provided) and the extension auto-configures the otlp exporter to send data there.
  • mTLS client credentials (tls.crt, tls.key, tls.ca.crt) are read directly from the service binding credentials — no external certificate service required.
  • Bearer token support: Optional token field is sent as Authorization: Bearer <token>.
  • Zero breaking changes: existing CaaS and Cloud Logging users require no changes; the new supplier is a no-op unless the new property is set.

Test plan

  • Verify 241 existing module tests still pass: mvn test -pl cf-java-logging-support-opentelemetry-agent-extension
  • Verify shaded jar builds: mvn package -pl cf-java-logging-support-opentelemetry-agent-extension -DskipTests
  • Manual smoke test: bind a user-provided service with url, tls.crt, tls.key; confirm mTLS exporter properties are set at startup
  • Manual smoke test: bind a user-provided service with url and token only; confirm bearer header is set
  • Confirm that an app with only a Cloud Logging or CaaS binding and no sap.otel.collector.cf.binding.name property behaves identically to before

@cla-assistant

cla-assistant Bot commented Aug 21, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@dimitarKiryakov
dimitarKiryakov marked this pull request as ready for review August 25, 2026 07:37
- Introduce BindingPropertiesSupplier builder with urlTransform,
  serverCaCertRequiresMtls, scheme, protocol, compression options
- Introduce BindingCredentialKeys with configurable field and file-prefix names
- Add ConfigurableOtelBindingPropertiesSupplier: selects a CF service binding
  by name, label, or tag (sap.otel.generic.cf.binding.*) and maps its
  credentials to OTLP exporter properties
- Add GenericBindingServiceProvider: finds a CF service instance by name,
  label, or tag selector
- CaasBindingPropertiesSupplier: replace broken port-append with urlTransform
  (<http-receiver-port> placeholder replacement); invoke server CA download
  only when mTLS client credentials are present (serverCaCertRequiresMtls)
- Add Javadoc to CloudLoggingBindingPropertiesSupplier, CaasBindingPropertiesSupplier,
  GenericBindingServiceProvider, ConfigurableOtelBindingPropertiesSupplier
- Fix README: correct property names (sap.otel.generic.*), document label/tag
  selectors, fix CA-required description
- Add tests: BindingPropertiesSupplierTest (urlTransform, serverCaCertRequiresMtls,
  mTLS+token), CaasBindingPropertiesSupplierTest (placeholder URL, no-CA-without-mTLS),
  GenericBindingServiceProviderTest (multi-instance, null-tags),
  ConfigurableOtelBindingPropertiesSupplierTest (label/tag selectors),
  BindingCredentialKeysTest (default file prefixes)
@dimitarKiryakov
dimitarKiryakov force-pushed the feat/generic-otel-collector-binding branch from 0c11ab8 to a7a2841 Compare August 27, 2026 11:00
…erties

Add the seven missing sap.otel.generic.cf.binding.* properties
(endpoint-name, client-cert-name, client-key-name, server-ca-name,
token-name, protocol, compression) to both configuration tables with
their default values.

Clarify that the three selector properties (name, label, tag) are
distinct but only one needs to be set; the first non-blank wins
(name → label → tag). Update all prose references that previously
only mentioned the name selector.
@dimitarKiryakov

Copy link
Copy Markdown
Author

Closing as we discussed with @KarstenSchnitter that he will provide a proper PR with a generic implementation to cover our needs.

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