Skip to content

Conversation

dennisgranath
Copy link
Contributor

@dennisgranath dennisgranath commented Oct 15, 2021

This adds support for distributed tracing.

By default a the NoopTracer is used which doesn't do anything. I've added a OpenCensusTracer implementation which can be used as well by setting client.withTracer(new OpenCensusTracer()).

This was very much inspired by the tracing inside the folsom client: github.com/spotify/folsom

Using lighstep it would look something like this:
Screenshot 2021-10-18 at 16 31 53
om

@codecov
Copy link

codecov bot commented Oct 15, 2021

Codecov Report

Merging #80 (4c6403c) into master (6490b72) will increase coverage by 0.49%.
The diff coverage is 75.29%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #80      +/-   ##
============================================
+ Coverage     68.83%   69.32%   +0.49%     
- Complexity      198      217      +19     
============================================
  Files            32       35       +3     
  Lines           770      841      +71     
  Branches         33       34       +1     
============================================
+ Hits            530      583      +53     
- Misses          217      233      +16     
- Partials         23       25       +2     
Impacted Files Coverage Δ
.../com/spotify/github/v3/clients/JwtTokenIssuer.java 100.00% <ø> (ø)
...om/spotify/github/v3/clients/RepositoryClient.java 64.15% <0.00%> (-0.67%) ⬇️
...java/com/spotify/github/v3/clients/NoopTracer.java 57.14% <57.14%> (ø)
.../com/spotify/github/opencensus/OpenCensusSpan.java 60.00% <60.00%> (ø)
...va/com/spotify/github/v3/clients/GitHubClient.java 72.84% <64.70%> (-1.93%) ⬇️
...fy/github/v3/exceptions/RequestNotOkException.java 54.54% <66.66%> (+4.54%) ⬆️
...a/com/spotify/github/v3/clients/GitDataClient.java 81.48% <86.36%> (+7.19%) ⬆️
...om/spotify/github/opencensus/OpenCensusTracer.java 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b28851...4c6403c. Read the comment docs.

@barbatron
Copy link
Contributor

barbatron commented Oct 15, 2021

Wouldn't passing an instrumented http client to the github client accomplish the same but without extra dependencies? (sry if I'm missing smth - I only glanced through the changes)

@dennisgranath
Copy link
Contributor Author

So this doesn't trace the actual outgoing calls towards GHE. It just starts a span whenever a request is made and ends it whenever the request is finished (future.get() etc.).

Copy link
Contributor

@barbatron barbatron left a comment

Choose a reason for hiding this comment

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

💯

@barbatron barbatron merged commit 695cec8 into spotify:master Oct 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants