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

Send DSN with SentryEnvelopeHeader #873

Closed
wants to merge 6 commits into from

Conversation

vishnukvmd
Copy link
Contributor

@vishnukvmd vishnukvmd commented May 28, 2022

📜 Description

This change injects DSN into the SentryEnvelopeHeader class and serializes it if available.

💡 Motivation and Context

This change ensures that the DSN is passed to the server along with events, bringing in consistency with the JavaScript SDK. This gets us one step closer to passing a tunnel that can be used to proxy data to Sentry servers (to fixe #872). Once this change is merged, will create a separate PR that accepts tunnel as a parameter within the SentryConfig and configures the transport accordingly (again, similar to the JS SDK).

💚 How did you test it?

Verified that the dsn was passed within the envelope to the remote server.

📝 Checklist

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

🔮 Next steps

@marandaneto
Copy link
Contributor

@vishnukvmd Thanks for doing this.
That would require changes on the Android SDK as well since it does a roundtrip in the JSON, otherwise, this field is gonna be lost.
https://github.com/getsentry/sentry-java/blob/6.x.x/sentry/src/main/java/io/sentry/SentryEnvelopeHeader.java

Would you like to raise an issue on that repo as well? Thanks.

@vishnukvmd
Copy link
Contributor Author

Hey @marandaneto, why would this require changes to the Java SDK? Isn't the Dart SDK self contained?

@marandaneto
Copy link
Contributor

Hey @marandaneto, why would this require changes to the Java SDK? Isn't the Dart SDK self contained?

Hey, no, the Android SDK has to deserialize and serialize again the event in order to enrich the event with the device context.
The reason is: getsentry/team-mobile#11

On iOS it'd work ootb.

@vishnukvmd
Copy link
Contributor Author

Yikes, I had no idea. I would much rather someone who is familiar with the development environment for the Java SDK make that change. I hope that's okay.

@marandaneto
Copy link
Contributor

Yikes, I had no idea. I would much rather someone who is familiar with the development environment for the Java SDK make that change. I hope that's okay.

Yep, let me try to get into this latest next week since this is a short week, if that's ok.

@vishnukvmd
Copy link
Contributor Author

Yikes, I had no idea. I would much rather someone who is familiar with the development environment for the Java SDK make that change. I hope that's okay.

Yep, let me try to get into this latest next week since this is a short week, if that's ok.

That'd be great, thank you so much! 🙏

flutter/pubspec.yaml Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

Base: 90.05% // Head: 90.13% // Increases project coverage by +0.08% 🎉

Coverage data is based on head (3502ee4) compared to base (fa7e619).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #873      +/-   ##
==========================================
+ Coverage   90.05%   90.13%   +0.08%     
==========================================
  Files         105      107       +2     
  Lines        3357     3405      +48     
==========================================
+ Hits         3023     3069      +46     
- Misses        334      336       +2     
Impacted Files Coverage Δ
dart/lib/src/sentry_envelope.dart 100.00% <ø> (ø)
dart/lib/src/sentry_client.dart 93.43% <100.00%> (+0.04%) ⬆️
dart/lib/src/sentry_envelope_header.dart 100.00% <100.00%> (ø)
logging/lib/src/extension.dart 100.00% <0.00%> (ø)
logging/lib/src/logging_integration.dart 90.47% <0.00%> (ø)

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.

@marandaneto
Copy link
Contributor

@ua741 CI is unhappy, also, add a new changelog entry, after that, happy to LGTM.

@marandaneto
Copy link
Contributor

@ua741 CI is unhappy, also, add a new changelog entry, after that, happy to LGTM.

@ua741 any update here?

@krystofwoldrich
Copy link
Member

Seems like only a lint issue, preferred const over final, otherwise tests are passing.

@marandaneto
Copy link
Contributor

Closing in favor of #1050

@ua741
Copy link
Contributor

ua741 commented Oct 10, 2022

@ua741 CI is unhappy, also, add a new changelog entry, after that, happy to LGTM.

@ua741 any update here?

Sorry for dropping the ball here, I was on vacation.
Thank you so much for taking it forward and merging it. Really appreciate it.

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.

5 participants