Repository navigation
fix(otel): only detect otel-collector service names, as documented - #1471
Merged
Merged
Conversation
Detection matched any bound service whose name contains "otel", e.g. "splunk-otel" (two agents in one JVM) or "hotel-db". Docs and the Ruby buildpack only match "otel-collector"; restore that.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused change preserves explicit detection options and includes appropriate regression coverage, with no unresolved findings.
No open issues 🎉
What changed in this PR
Narrows generic OpenTelemetry agent detection to documented service-name matching, preventing unintended installation alongside vendor agents or for unrelated services.
Changes:
- Removes bare
otelname matching while preserving explicit label and tag detection. - Adds negative regression tests for
splunk-otelandhotel-db. - Updates integration coverage for Splunk isolation and supported collector naming.
| File | Description |
|---|---|
| src/java/frameworks/open_telemetry_javaagent.go | Restricts service-name matching to otel-collector. |
| src/java/frameworks/open_telemetry_javaagent_test.go | Covers vendor and unrelated service-name exclusions. |
| src/integration/frameworks_test.go | Checks Splunk isolation and updates the collector binding name. |
Review effort: Balanced
kiril-keranov
approved these changes
Oct 21, 2026
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.
Problem
The OpenTelemetry Javaagent framework is detected for any bound service whose name contains
otel(case-insensitive substring match), for example:splunk-otel-> both the Splunk OTel agent and the generic OpenTelemetry agent are installed in the same JVM:Installing frameworks [..., OpenTelemetry Javaagent, Splunk OTEL]hotel-db-> the OpenTelemetry agent is installedFound while reviewing #1360 (Elastic OTel agent): in a manual staging test, a Splunk binding named
splunk-otelalso installed the generic OpenTelemetry agent. A service namedelastic-otelwould trigger the same.Why
The documentation says the bound service "MUST contain the string
otel-collector", and the Ruby buildpack (v4) used/otel-collector/. The extraHasServiceByNamePattern("otel")came in with the Go rewrite (#1217) and is wider than documented.Change
otelname pattern. Detection still works via:otel-collector(as documented and as in v4)otel-collectororopentelemetryotel,otel-collectororopentelemetrysplunk-otelandhotel-dbare not detected (replaces the test that expectedmy-otel-sidecarto be detected).my-otel-service->my-otel-collector; both Splunk tests assert the OpenTelemetry Javaagent is not installed.Migration
Apps that rely on a service name containing only
otelcan rename the service to containotel-collector, or add theoteltag (cf update-user-provided-service <name> -t otel).Tests