open-telemetry / open-telemetry/opentelemetry-java-instrumentation

Adding a toggle for HTTP client spans to display URI/resource path name

Open
#14,735 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement needs triage
Dominant language
Java
Stars
2.6k
Forks
1.2k
Avg merge
2d 18h
Merged PRs (30d)
228

Description

Is your feature request related to a problem? Please describe.

When using the OTEL Java agent, HTTP client spans default to very low-cardinality names such as HTTP GET. While this avoids metric explosion, it makes traces less informative when debugging or when migrating from agents like Datadog that include the request path in span names.

For example, an HTTP request: GET /users/123/orders/456

currently produces a span named: HTTP GET

This loses important context about which resource was called.

Describe the solution you'd like

Introduce a configurable toggle to include URI/resource path information in HTTP client span names, with simple templating/truncation options.

Default behavior (unchanged): HTTP GET

With toggle enabled: HTTP GET /users/?/orders/?

This would:

  • Preserve OTEL’s low-cardinality defaults OOTB
  • Provide an optional path-based naming mode for users who need more informative spans (e.g. during migrations or debugging).
Describe alternatives you've considered
  • Using an OTEL Collector transform processor, but in some environments (e.g. managed collectors) this isn’t feasible.
  • Attempting to use OkHttp directly for higher-cardinality span names, but it doesn’t work out-of-the-box.
Additional context

If there is other advice on solving my issue that already exists please let me know, but I think this would be a good feature to add and would be a great learning experience for me

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the Java agent’s HTTP client instrumentation and how span names are currently configured. Define the toggle’s URI templating and truncation behavior, while preserving the default HTTP GET name; the requested path-based example should be covered when enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, observability-sre
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.