Closed 02strich closed 11 months ago
Would modifying the DSN work for you, perhaps?
DSN is not an exact URL, but e.g. if your DSN is https://public@sentry.example.com/123
: you can set sentry.example.com
to the desired hostname (newhost.com
), and then the data will be sent to newhost.com/api/123/envelope/
I tried that but ended up with two constraints:
As such while it might work, it seems sub-optimal.
Another alternative (without implementing it in the SDK) could be implementing a custom SDK Transport (example) that implements the logic.
To clarify your use case: you have a Go app, and now you want all Sentry events from it to be sent to some example.com/endpoint
that bypasses the firewall? What will accept those events on the other end, some kind of proxy/forwarder?
I have a change to the code ready that adds the feature, but wanted to raise the topic first to get some feedback.
You can totally open a PR, but we cannot guarantee that it'll be on a high-prio list for reviewing/merging, since it's a pretty special use case IMO.
Thanks for the pointers and the link to the section in the document. This works and is a lot simpler than I originally thought (I had tried to use the transport interface).
Summary
I would like to use the Tunnel feature available in the Node SDK also in the Go one.
Motivation
This feature allows tunneling Sentry reports via a different endpoint. In the case of the Node SDK this is mostly to deal with same-origin requirements of browsers (so the tunnel endpoint is part of the same domain as where the Sentry-supported web-app runs). In the Go case, we have to deal with firewall rules that allow certain endpoints already, which we would like to re-use also for Sentry reports.
Additional Context
I have a change to the code ready that adds the feature, but wanted to raise the topic first to get some feedback.