Skip to content

Send events from relay-server to proxy and then to Sentry #71812

@revathyrams

Description

@revathyrams

Environment

SaaS (https://sentry.io/)

What are you trying to accomplish?

I have a sentry instrumented PHP service that sends events to the sentry-relay server. I need to setup a proxy server in between relay and Sentry. The proxy server exists because it needs needs to transform Sentry traces to open telemetry and send to otel collector. So the proxy will forward the request as it is to Sentry, but transform to otel and send to otel collector.

relay-proxy-design

How are you getting stuck?

When I forward the request from the proxy server to Sentry, it fails with a 500

{"detail":"bad envelope authentication header","causes":["expected value at line 1 column 1"]}

I think this is happening because the dsn in the envelope points to the proxy-server's address and not sentry.io, since the upstream route of relay-server is the proxy-server "http://<redacted>:@localhost:3000/<redacted>"

This would mean that I have to decode the event, replace the dsn, and then encode and make an http request.
Is there an easier method to achieve this? Is there a drop-in replacement instead of modifying the header/payload?

Where in the product are you?

Settings - Relay

Link

No response

DSN

No response

Version

No response

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions