Skip to content

Document CORS settings for browser trace propagation #11351

Closed as not planned
Closed as not planned

Description

@danielkhan

Problem Statement

As documented here, users need to configure Access-Control-Allow-Headers when the frontend and the backend are on different (sub) domains to allow trace propagation headers to be passed down with XHR requests.

Users may easily miss the docs and end up with a broken experience / spend much time trying to find the problem.

Solution Brainstorm

Here are two possible solutions:

  1. Prominently link to the CORS documentation during setup. This would affect all backend platforms. Consider adding a snippet in an expandable section.
  2. Automatically make all backend SDKs send these response headers - maybe guarded by a config option as part of the default init snippet.

Activity

  1. AbhiPrasad commented on Oct 26, 2023

    @AbhiPrasad
    Contributor

    We cannot override how CORS headers are being set via the backend SDKs because this is a security concern. It can only be configured by users, so I think option 1 is the only viable solution here.

    What we also need to make prominent is to make sentry-trace and baggage allow-listed as valid headers. Some people have strict nginx or apache configs that only allow a subset of headers through (our infrastructure at Sentry does this).

  2. changed the title [-]Make CORS configuration more intuitive/obvious[/-] [+]Document CORS settings for browser trace propagation[/+] on Jul 9, 2024
  3. getsantry commented on Sep 13, 2024

    @getsantry
    Contributor

    Auto-routing to @getsentry/product-owners-issues for triage ⏲️

  4. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Sep 13, 2024
  5. getsantry commented on Sep 13, 2024

    @getsantry
    Contributor

    Routing to @getsentry/product-owners-sdks-web-frontend for triage ⏲️

  6. 17 remaining items

  7. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Oct 16, 2024
  8. AbhiPrasad commented on Oct 17, 2024

    @AbhiPrasad
    Contributor

    @obecny I think trying to identify network failures as CORS issues vs. actual errors gets unreliable, but if there is a way forward we can take a look. As far as I'm aware it doesn't work very well, so I don't think we should spend too much time on it.

    CORS errors are purposefully sand boxed, but perhaps we can go to W3C and see if the browser vendors are open to an alternate instrumentation strategy?

  9. smeubank commented on Jan 15, 2025

    @smeubank
    Contributor

    related bordering on duplicate: #11524

  10. locked and limited conversation to collaborators on Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    SDKsjavascript

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions