Uh oh!
There was an error while loading. Please reload this page.
feat: Allow for attaching metadata and pass it to the API and transports - #3177
Conversation
size-limit report
|
rhcarvalho
commented
Jan 15, 2021
For posteriority, this is related to #3170, as it would simplify the implementation of that one. |
rhcarvalho
left a comment
There was a problem hiding this comment.
Oh I like that eventually we can have the version defined in a single place ❤️
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Indeed. @kamilogorek, even though this replaces that one, you might consider grabbing its tests (which you'd only have to modify a little) since they're already written. (I missed gatsby entirely in that PR, but fortunately the test there already exists and only needs to be updated.) |
| const sdkInfo = getSdkInfoFromApiMetadata(api); | ||
| const envelopeHeaders = JSON.stringify({ | ||
| sent_at: new Date().toISOString(), | ||
| ...(sdkInfo && { sdk: sdkInfo }), |
There was a problem hiding this comment.
We only want name and version here not everything.
| const envelopeHeaders = JSON.stringify({ | ||
| event_id: event.event_id, | ||
| sent_at: new Date().toISOString(), | ||
| ...(sdkInfo && { sdk: sdkInfo }), |
There was a problem hiding this comment.
Same here: We only want name and version here, not everything.
Still need some tinkering and tests.
options._metadatawhich is type ofSdkMetadata = { sdk?: SdkInfo }options.transportOptionsinternally and passed to the transportnew APIwhich now has the ability to read this data-SDK_VERSIONis fixed and always read from@sentry/coreSDK_VERSIONis moved to@sentry/coreSDK_NAMEis kept where it was for backwards compatibilityand@sentry/browserand@sentry/nodestill use it as before, so it can be used as fallback for "unknown" SDKs or in a fail-safe scenario- event processors are still in place, as we use them to enhancepackagesattribute, as well as we have to modify the event itself, which is not using envelopes yet