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

Feat: Performance support for Android Apollo #1705

Merged
merged 8 commits into from
Sep 15, 2021
Merged

Feat: Performance support for Android Apollo #1705

merged 8 commits into from
Sep 15, 2021

Conversation

maciejwalkowiak
Copy link
Contributor

@maciejwalkowiak maciejwalkowiak commented Sep 9, 2021

📜 Description

Performance support for Android Apollo.

Apollo executes callback on another thread (or coroutine), which makes it impossible to set breadcrumbs, as the context is not propagated back to parent.

Since all spans are finished now automatically, BeforeSpanCallback does not allow dropping spans (this will likely change when we fix this for Feign and OkHttp).

Generated classes for test purposes, are generated using Apollo plugin for the API: https://apollo-fullstack-tutorial.herokuapp.com/graphql

💡 Motivation and Context

Fixes #1331

💚 How did you test it?

Integration test.

📝 Checklist

  • I reviewed the submitted code
  • I added tests to verify the changes
  • I updated the docs if needed
  • No breaking changes

🔮 Next steps

@maciejwalkowiak maciejwalkowiak marked this pull request as ready for review September 9, 2021 12:34
@codecov-commenter
Copy link

codecov-commenter commented Sep 9, 2021

Codecov Report

Merging #1705 (aff550f) into main (28ed730) will increase coverage by 0.06%.
The diff coverage is 86.04%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1705      +/-   ##
============================================
+ Coverage     75.01%   75.07%   +0.06%     
- Complexity     2104     2113       +9     
============================================
  Files           211      212       +1     
  Lines          7532     7575      +43     
  Branches        793      799       +6     
============================================
+ Hits           5650     5687      +37     
- Misses         1498     1503       +5     
- Partials        384      385       +1     
Impacted Files Coverage Δ
...n/java/io/sentry/apollo/SentryApolloInterceptor.kt 86.04% <86.04%> (ø)

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 28ed730...aff550f. Read the comment docs.

buildSrc/src/main/java/Config.kt Show resolved Hide resolved
val span = startChild(request, activeSpan)
val sentryTraceHeader = span.toSentryTrace()

// we have no access to URI, no way to verify tracing origins
Copy link
Member

Choose a reason for hiding this comment

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

Should we address this before we ship it?
Sounds like we should bring tracing options (allowlist of outgoing URLs to add the header info) going forward

Copy link
Contributor

Choose a reason for hiding this comment

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

looks like a limitation of apollo

Copy link
Contributor

Choose a reason for hiding this comment

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

you can do with the response object, response.httpResponse.get().request().url() but its too late

Copy link
Contributor

@marandaneto marandaneto left a comment

Choose a reason for hiding this comment

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

LGTM

@marandaneto
Copy link
Contributor

docs issue getsentry/sentry-docs#4151

@marandaneto marandaneto merged commit 1f575c6 into main Sep 15, 2021
@marandaneto marandaneto deleted the gh-1331 branch September 15, 2021 13:13
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.

Support for performance tracking with Apollo on Android
4 participants