feat(otel-ext): add Generic OTel Collector service binding support with mTLS from credentials - #421
Draft
dimitarKiryakov wants to merge 22 commits into
Draft
Conversation
…n spec, plan, and README updates
…rties + Bouncy Castle dep
… creds read directly from collector binding
…LS creds from binding
…omizer chain - Add OtelCollectorBindingPropertiesSupplier as first supplier in the chain - Make OtelCollectorBindingPropertiesSupplier and its no-arg constructor public for use outside package - Add regression test for OtelCollectorBindingPropertiesSupplier visibility - Maintains backward compatibility: new supplier is a no-op unless sap.otel.collector.cf.binding.name is set
…l tls.crt/tls.key/tls.ca.crt approach
|
|
SERVICE_UAA constant, its case in parseServiceInstance, and the keyPrefix parameter in populateCredentials were added without being requested and served no documented use case. Remove them along with the accompanying VCAP_WITH_CERT_SERVICE test fixture and parsesUaaSiblingAsCredentialsPrefixedKeys test.
The populateCredentials(JsonParser, CloudFoundryCredentials.Builder) refactor was introduced solely to support UAA credential merging (two JSON blocks contributing to one builder with key prefixes). That feature was removed; restore the simpler original form where parseServiceCredentials creates the credentials builder internally.
- OtelCollectorBindingPropertiesSupplierTest: add tests for null-credentials and both-URLs-absent branches identified as uncovered by Opus review - CaasBindingPropertiesSupplierTest: fix pre-existing assertion checking non-existent key 'client.cert' instead of 'client.certificate'
…add CaaS tests - Fix MtlsClientCertHelper to buffer all TLS properties in a local map before merging into the output; a failed write no longer leaves a half-configured TLS state in the result map. - Add CaaS test: partial IOException on client cert write yields no TLS keys. - Add CaaS test: blank tls.crt skips server cert download and yields no TLS keys. - Add Javadoc to all public methods and builder methods in pre-existing binding classes: CloudFoundryServicesAdapter, CloudLoggingBindingPropertiesSupplier, CloudLoggingServicesProvider, CaasServiceProvider, DynatraceServiceProvider, CloudFoundryServiceInstance, CloudFoundryCredentials, DefaultOtelBackendPropertiesSupplier.
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.
Summary
sap.otel.collector.cf.binding.nameto the name of any CF service instance (managed or user-provided) and the extension auto-configures theotlpexporter to send data there.tls.crt,tls.key) and an optional server CA (tls.ca.crt) are read directly from the service binding credentials — no external certificate service required.tokenfield is sent asAuthorization: Bearer <token>.Changes
ExtensionConfigurationsOTEL_COLLECTOR.BINDING_NAMEconfig propertyCloudFoundryServicesAdapterfindByName(String)method to locate a binding by instance name across all service labelsOtelCollectorServiceProviderCloudFoundryServicesAdapter.findByName()OtelCollectorBindingPropertiesSupplierCloudLoggingConfigurationCustomizerProviderOtelCollectorBindingPropertiesSupplieras first entry in the supplier chainREADME.mdTest plan
mvn test -pl cf-java-logging-support-opentelemetry-agent-extensionmvn package -pl cf-java-logging-support-opentelemetry-agent-extension -DskipTestsurl,tls.crt,tls.key; confirm mTLS exporter properties are set at startupurlandtokenonly; confirm bearer header is setsap.otel.collector.cf.binding.nameproperty behaves identically to before