Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log consumers should be able to differentiate sampled from unsampled traces #103

Open
carterkozak opened this issue Mar 25, 2019 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@carterkozak
Copy link
Contributor

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.

@carterkozak
Copy link
Contributor Author

@dsd987 Mind taking a look at this?

@carterkozak carterkozak changed the title Log consumers should be differentiate sampled from unsampled traces Log consumers should be able to differentiate sampled from unsampled traces Mar 26, 2019
@carterkozak
Copy link
Contributor Author

After some thought, I think we should use key traceSampled in order to make collisions with existing parameter names less likely, and provide more context describing the value.

@carterkozak
Copy link
Contributor Author

Update: Caught up with @ellisjoe who is looking into what it would take to expose this information using indexed traces without the need for additional data attached to service events.
Potential upsides:

  • Less data logged per event
  • Could work with request logs as well as service logs
  • May give us direct UI links to trace info from service/request logs

@raiju
Copy link
Contributor

raiju commented Apr 12, 2019

This PR should unblock it for Jetty filters: #137

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants