豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Session replays not routing to dedicated DSN when using makeMultiplexedTransport #20346

@behnammodi

Description

@behnammodi

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

Sentry Browser CDN bundle

SDK Version

10.42.0

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

<script src="https://browser.sentry-cdn.com/10.42.0/bundle.replay.min.js"                    
  integrity="sha384-sbojwIJFpv9duIzsI9FRm87g7pB15s4QwJS1m1xMSOdV1CF3pwgrPPEu38Em7M9+" 
  crossorigin="anonymous"></script>                                                            
<script src="https://browser.sentry-cdn.com/10.42.0/multiplexedtransport.min.js"             
integrity="sha384-p8HeEw7yYcSl/9moL9rH0pJjLSPDCpZz0MHmuysvDyKur6U8PgHLNywONPkNqZyV" 
crossorigin="anonymous"></script>                                                            
<script>                                                  
    (function() {                                                                            
        window.Sentry.init({                              
            dsn: "__DEFAULT_DSN__",
            replaysSessionSampleRate: 0.1,
            replaysOnErrorSampleRate: 1.0,                                                   
            integrations: [window.Sentry.replayIntegration()],
            transport: window.Sentry.makeMultiplexedTransport(                               
                window.Sentry.makeFetchTransport,                                            
                function({ getEvent }) {                                                     
                    if (getEvent(["replay_event"])) {                                        
                        return [{ dsn: "__REPLAY_DSN__" }];
                    }                                                                        
                    return [];                                                               
                }             
            ),                                                                               
        });                                               
    })();                                                                                    
</script>

Steps to Reproduce

Steps to Reproduce

  1. Load bundle.replay.min.js and multiplexedtransport.min.js via CDN script tags
    (server-rendered, not dynamically injected)
  2. Initialize Sentry with makeMultiplexedTransport routing replay_event types to a separate
    DSN
  3. Trigger a session replay
  4. Check both Sentry projects

Expected Result

Replay events arrive in the project associated with REPLAY_DSN. Errors and transactions
arrive in the project associated with DEFAULT_DSN.

Actual Result

Replay events are not arriving in the dedicated replay project. They appear to be going to
DEFAULT_DSN instead. window.Sentry.makeMultiplexedTransport is available at runtime (no
warnings), and the matcher function is invoked, but replays still reach the wrong project.

Additional Context

No response

Priority

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Metadata

Metadata

Assignees

No fields configured for issues without a type.

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions