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

Completely revamp tracing spans #1205

Merged
merged 45 commits into from
Sep 4, 2019
Merged

Completely revamp tracing spans #1205

merged 45 commits into from
Sep 4, 2019

Conversation

dansanduleac
Copy link
Contributor

@dansanduleac dansanduleac commented Sep 3, 2019

Before this PR

Spans for a single request's lifetime are difficult to correlate as they use different trace ids per attempt, and it's not obvious when additional attempts are being made.

After this PR

==COMMIT_MSG==
For a single JaxRsClient request, all spans are now correctly attributed to a single traceId.
==COMMIT_MSG==

both jax-rs and retrofit now trace things correctly, including ListenableFuture/CompletableFuture calls:

image

This PR uses release candidates tagged on this branch: palantir/tracing-java#124

Possible downsides?

  • more complexity in c-j-r
  • we're touching some hot codepaths here, so any unintended performance regressions could have quite an impact.

@changelog-app
Copy link

changelog-app bot commented Sep 3, 2019

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

For a single JaxRsClient request, all spans are now correctly attributed to a single traceId. Newly introduced spans are:

  • OkHttp: Attempt X (first one will be Attempt 0, max is still 4 retries for a total of 5 reqs)
  • OkHttp: client-side-concurrency-limiter 4/10 (showing number of inflight request / current limit)
  • OkHttp: dispatcher (signifies a client may have hit the max requests per host)
  • OkHttp: backoff-with-jitter
  • OkHttp: wait-for-headers
  • OkHttp: wait-for-body

Check the box to generate changelog(s)

  • Generate changelog entry

@dansanduleac
Copy link
Contributor Author

Looking good:
image

The long times at the beginning of each attempt are the backoff times for each retry.

@iamdanfox iamdanfox changed the title Use new detached spans Completely revamp tracing spans Sep 4, 2019
@iamdanfox iamdanfox marked this pull request as ready for review September 4, 2019 18:35
@iamdanfox iamdanfox requested a review from a team as a code owner September 4, 2019 18:35

@Value.Modifiable
@ImmutablesStyle
interface SettableDispatcherSpan {
Copy link
Contributor

Choose a reason for hiding this comment

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

These could probably use some docs explaining how they're used

@ferozco
Copy link
Contributor

ferozco commented Sep 4, 2019

👍

@bulldozer-bot bulldozer-bot bot merged commit 98524f5 into develop Sep 4, 2019
@bulldozer-bot bulldozer-bot bot deleted the ds/use-new-tracing branch September 4, 2019 19:29
@svc-autorelease
Copy link
Collaborator

Released 4.36.0

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.

4 participants