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

[improvement] Add sampled-state to filters #137

Merged
merged 5 commits into from
Apr 17, 2019

Conversation

raiju
Copy link
Contributor

@raiju raiju commented Apr 12, 2019

Before this PR

The jetty filter doesn't add the sampled state of the trace the request context.

After this PR

The jetty filter adds the sampled state to the request context, enabling e.g. logging to mark sampled traces for later inspection/filtering.

@raiju raiju changed the title [improvement] Add sampled-state to jetty filter [improvement] Add sampled-state to filters Apr 17, 2019
// Populate response before calling delegate since delegate might commit the response.
exchange.getResponseHeaders().put(TRACE_ID, traceId);
exchange.getResponseHeaders().put(IS_SAMPLED, sampled);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we create an attachment for this instead of using the response headers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Is this how attachments should be used?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, thanks!

@carterkozak
Copy link
Contributor

lgtm 👍

@bulldozer-bot bulldozer-bot bot merged commit ef1eb83 into palantir:develop Apr 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants