palantir / palantir/tracing-java

Tracer.startSpan should support overloads to parameterize messages

Open
#177 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
28
Forks
20
Avg merge
1d 8h
Merged PRs (30d)
15

Description

What happened?

We do a great deal of unnecessary string concatenation in span names which can be completely avoided for unsampled traces:

https://github.com/palantir/tracing-java/blob/c63567eacecc677c63db0f146fcd2f34493f2ffa/tracing-jersey/src/main/java/com/palantir/tracing/jersey/TraceEnrichingFilter.java#L62

https://github.com/palantir/tracing-java/blob/c63567eacecc677c63db0f146fcd2f34493f2ffa/tracing-okhttp3/src/main/java/com/palantir/tracing/okhttp3/OkhttpTraceInterceptor.java#L42

What did you want to happen?

Slf4j style overloads to construct trace strings only for sampled operations

Contributor guide

No contributing guide indexed for this repository

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 at the Tracer.startSpan entry point and compare the string construction in tracing-jersey/src/main/java/com/palantir/tracing/jersey/TraceEnrichingFilter.java and tracing-okhttp3/src/main/java/com/palantir/tracing/okhttp3/OkhttpTraceInterceptor.java. Review how sampled operations are handled, then define the overload behavior so span-name strings are only constructed when needed. Done means callers can use SLF4J-style parameterized messages without unnecessary concatenation for unsampled traces.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.