palantir / palantir/tracing-java

Log consumers should be able to differentiate sampled from unsampled traces

Open
#103 4 comments 0 reactions 1 assignee View on GitHub

@dsd987 is already working on this.

Since Mar 25, 2019.

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

Description

What happened?

Log lines inside a traced operation contain a traceId MDC key. Tracing output may be loaded by ID in our logging pipeline, however most traceIds are not sampled, and as such may not be viewed. It's difficult to tell which traceIds one can search for.

What did you want to happen?

It would be helpful if we set a second MDC key-value pair to differentiate sampled and unsampled traces.

Proposal

Tracer should set sampled:true when setting the traceId key for a sampled request.

MDC key name: sampled, traceSampled, better ideas? sampled is simple and easy to remember.

Should we set sampled:false for traces that are not sampled? This would allow us to differentiate versions which have not yet upgraded, however it would also slightly increase the overhead of every log line. While it may be helpful today, I don't think it's necessary long term.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.