Any way to reuse default transports but with dynamic request data #6303
Replies: 3 comments 3 replies
-
You can do something similar to #6211 (comment), but then add the following logic: const transport = supportsFetch() ? makeFetchTransport(transportOptions) : makeXHRTransport(transportOptions); |
Beta Was this translation helpful? Give feedback.
-
@AbhiPrasad thanks for the answer but |
Beta Was this translation helpful? Give feedback.
-
@AbhiPrasad any thoughts? |
Beta Was this translation helpful? Give feedback.
-
Hello, we have to send sentry events/traces to the different endpoints in a specific format which dumps those the events to kafka where we pick up them, reconstruct a proper valid envelope payload and post to internal sentry. I know that we can create custom transports for that but that's a pain considering there are a lot of good stuff in
createTransport
,makeFetchTransport
, andmakeXHRTransport
that we'll have to copy over, just to change the payload format and url/headers. Would be great if we could something like this:Basically
getRequest
callback is called with certain payload and return value (url, body, and headers) is passed down to the underlaying transport (fetch/xhr in this case). What do you think?Beta Was this translation helpful? Give feedback.
All reactions