-
-
Notifications
You must be signed in to change notification settings - Fork 324
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
Use SentryOptions.sdkInfo instead of SentryMeta #1884
Comments
I believe we could inject SentryOptions into DependencyContainer to use it across the project |
This won't work if you use multiple hubs and not the static API. |
Why is SDKInfo even on the options? Is there a use case for users to change this? One requirement for changing the SDKInfo is for our hybrid SDKs, but they could use a private API instead to override the |
is Hub public here? I thought multiple Hubs wasn't something we supported. Happy to use a private API to set it, for as long as we can override the value from things like Unity and possibly more SDKs going forward |
Yes, it's public so that you could use multiple hubs. I guess the majority though uses the static API. |
It's needed for either Hybrid SDKs or when an SDK consists of multiple packages, eg. |
This information should not be available to the end-user in the options. |
SentryMeta is now the only source of truth. The values can be overridden by hybrid SDKs via SentrySDKOnly. Closes #1884
Description
The SDK currently uses both
SentryOptions.sdkInfo
andSentryMeta
for creating the sdkInfo.To fix this, we have to add new initializers to
SentryEnvelopeHeader
andSentryEnvelope
, requiring the SDKInfo. On Java, we also have to pass in the SDKInfo as a parameter see https://github.com/getsentry/sentry-java/blob/9f1af1c68c58570a731a65289183107d3c4f90d5/sentry/src/main/java/io/sentry/SentryEnvelope.java#L36-L78We can't get rid of the initializers using
SentryMeta
, because this would be a breaking change. I think we have two options:Option A
Marking these initializers as deprecated, adding new ones requiring SDKInfo as a parameter remove them in 8.x.x., but this would bubble up to all initializers of
SentryEnvelopes
.Option B
Use
SentrySDK.currentHub
for getting the options inSentryEnvelope
andSentryEnvelopeHeader
, and mark the initializers as deprecated in 8.x.x and remove them in 9.x.x. Even if someone would use multiple clients with different options, they most likely will use the same SDKInfo.This came up in #1853
The text was updated successfully, but these errors were encountered: