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

Add contexts to SentryTracer and add otel context to it #2361

Merged
merged 6 commits into from
Nov 28, 2022

Conversation

adinauer
Copy link
Member

@adinauer adinauer commented Nov 15, 2022

#skip-changelog

📜 Description

SentryTracer now has a contexts: Contexts attribute and methods to retrieve and add to contexts.

💡 Motivation and Context

This allows us to attach OTEL attributes to the transaction context.

💚 How did you test it?

📝 Checklist

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

🔮 Next steps

@@ -234,4 +234,19 @@ private SpanStatus mapOtelStatus(final @NotNull ReadableSpan otelSpan) {
private boolean hasSentryBeenInitialized() {
return Sentry.isEnabled();
}

private @NotNull Map<String, Object> toMapWithStringKeys(@Nullable Attributes attributes) {
Copy link
Member Author

@adinauer adinauer Nov 15, 2022

Choose a reason for hiding this comment

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

JsonObjectSerializer only serializes Maps with String keys.

@getsentry getsentry deleted a comment from github-actions bot Nov 15, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Nov 15, 2022

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 93b327f

@github-actions
Copy link
Contributor

github-actions bot commented Nov 15, 2022

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 312.16 ms 381.31 ms 69.15 ms
Size 1.73 MiB 2.32 MiB 610.45 KiB

Baseline results on branch: feat/otel-span-processor

Startup times

Revision Plain With Sentry Diff
cfaca0b 334.94 ms 389.09 ms 54.15 ms

App size

Revision Plain With Sentry Diff
cfaca0b 1.73 MiB 2.32 MiB 610.44 KiB

Previous results on branch: feat/otel-context

Startup times

Revision Plain With Sentry Diff
4241258 299.25 ms 333.24 ms 33.99 ms
8baf861 345.27 ms 366.88 ms 21.61 ms

App size

Revision Plain With Sentry Diff
4241258 1.73 MiB 2.32 MiB 610.41 KiB
8baf861 1.73 MiB 2.32 MiB 610.41 KiB

@codecov-commenter
Copy link

codecov-commenter commented Nov 15, 2022

Codecov Report

Base: 80.44% // Head: 80.44% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (bde13a9) compared to base (9cef931).
Patch coverage: 71.42% of modified lines in pull request are covered.

Additional details and impacted files
@@                      Coverage Diff                       @@
##             feat/otel-span-processor    #2361      +/-   ##
==============================================================
- Coverage                       80.44%   80.44%   -0.01%     
- Complexity                       3692     3694       +2     
==============================================================
  Files                             292      292              
  Lines                           13777    13784       +7     
  Branches                         1817     1817              
==============================================================
+ Hits                            11083    11088       +5     
- Misses                           1993     1995       +2     
  Partials                          701      701              
Impacted Files Coverage Δ
...entry/src/main/java/io/sentry/NoOpTransaction.java 22.50% <0.00%> (-1.19%) ⬇️
sentry/src/main/java/io/sentry/SentryTracer.java 89.32% <100.00%> (+0.17%) ⬆️
...ain/java/io/sentry/protocol/SentryTransaction.java 90.37% <100.00%> (+0.07%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@adinauer adinauer marked this pull request as ready for review November 15, 2022 15:15
@adinauer adinauer mentioned this pull request Nov 17, 2022
21 tasks
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.

3 participants