You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So to confirm, the tunnel option in the SDK works for you if you set it in an external sentry.client|server.config.js file? And your request is that the @sentry/astro package exposes a built-in proxy/forwarding functionality, correct?
It sounds like a viable option to me and I like the idea of simply injecting the route. However, right now we don't have the capacity to work on this. I'll backlog it for later. If you want to contribute this feature, feel free to open a PR. I'd recommend taking a look at this PR which was supposed to add guidance on how to implement such a proxy server in Node. Unfortunately this PR got a bit stale which is why it didn't make it to docs yet (I'll follow up on this).
Long story short, we'll need to parse the envelope payload and read the DSN from the envelope headers.
IIRC you should forward the body as application/x-sentry-envelope. The envelope itself is text but some items could be binary. This should work though because the header you need to parse to get the DSN is always text. I think we should avoid parsing the entire envelope but only look at the header, get the DSN and forward the original body.
Activity
Lms24 commentedon Jan 24, 2024
Hi @florian-lefebvre thanks for writing in!
So to confirm, the
tunneloption in the SDK works for you if you set it in an externalsentry.client|server.config.jsfile? And your request is that the@sentry/astropackage exposes a built-in proxy/forwarding functionality, correct?It sounds like a viable option to me and I like the idea of simply injecting the route. However, right now we don't have the capacity to work on this. I'll backlog it for later. If you want to contribute this feature, feel free to open a PR. I'd recommend taking a look at this PR which was supposed to add guidance on how to implement such a proxy server in Node. Unfortunately this PR got a bit stale which is why it didn't make it to docs yet (I'll follow up on this).
Long story short, we'll need to parse the envelope payload and read the DSN from the envelope headers.
florian-lefebvre commentedon Jan 24, 2024
Yes that's it! Assign me, I'll submit a PR today
2 remaining items
Lms24 commentedon Jan 24, 2024
IIRC you should forward the body as
application/x-sentry-envelope. The envelope itself is text but some items could be binary. This should work though because the header you need to parse to get the DSN is always text. I think we should avoid parsing the entire envelope but only look at the header, get the DSN and forward the original body.If you're curious, here's our envelope payload specification.
Hope this answers your question.
feat(astro): add tunnelRoute option (getsentry#10309)