Skip to content

Automatically assign span context to captured events.#1156

Merged
maciejwalkowiak merged 4 commits intomainfrom
performance-polish-2
Jan 12, 2021
Merged

Automatically assign span context to captured events.#1156
maciejwalkowiak merged 4 commits intomainfrom
performance-polish-2

Conversation

@maciejwalkowiak
Copy link
Contributor

📜 Description

Automatically assign span context to captured events.

💡 Motivation and Context

One step less for users using manual performance reporting.
Result of the discussion: https://github.com/getsentry/sentry-docs/pull/2818/files#r551077018

💚 How did you test it?

Unit & Integration tests.

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • All tests passing
  • No breaking changes

🔮 Next steps

private void assignTraceContext(final @NotNull SentryEvent event) {
if (event.getThrowable() != null) {
final SpanContext spanContext = throwableToSpanContext.get(event.getThrowable());
if (spanContext != null && event.getContexts().getTrace() == null) {
Copy link
Member

Choose a reason for hiding this comment

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

If these have public setters and are nullable we should navigate through considering they might be.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@bruno-garcia
Copy link
Member

Could you please attach a screenshot of what the issue event look like having that context attached to it?

@codecov-io
Copy link

codecov-io commented Jan 12, 2021

Codecov Report

Merging #1156 (57cca2d) into main (297265a) will increase coverage by 0.02%.
The diff coverage is 76.92%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1156      +/-   ##
============================================
+ Coverage     75.31%   75.33%   +0.02%     
- Complexity     1645     1649       +4     
============================================
  Files           169      169              
  Lines          5696     5705       +9     
  Branches        557      559       +2     
============================================
+ Hits           4290     4298       +8     
- Misses         1150     1151       +1     
  Partials        256      256              
Impacted Files Coverage Δ Complexity Δ
...java/io/sentry/spring/SentryExceptionResolver.java 100.00% <ø> (+11.11%) 3.00 <0.00> (ø)
sentry/src/main/java/io/sentry/Hub.java 74.85% <76.92%> (+<0.01%) 74.00 <4.00> (+4.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 297265a...57cca2d. Read the comment docs.

@maciejwalkowiak
Copy link
Contributor Author

image
image

I do not know why in event trace details are also shown on the righthand side in tags and in other they are not.

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.

4 participants