Debug Mode doesn't work together with Azure Application Insights

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Azure Application Insights adds a header (I think when distributedTracingMode is set to DistributedTracingModes.W3C) called “traceparent” and this causes the OPTIONS call to http://127.0.0.1:7242/ingest/ fail because that header is not allowed by the CORS policy.

Steps to Reproduce

  1. Enable Application Insights with distributed tracing:
const appInsights = new ApplicationInsights({
    config: {
        connectionString: key,
        distributedTracingMode: DistributedTracingModes.W3C,
        enableCorsCorrelation: true,
        enableAjaxErrorStatusText: false,
        enableAutoRouteTracking: false,
        disableFetchTracking: false,
        autoTrackPageVisitTime: true,
    },
})

appInsights.loadAppInsights()
  1. Attempt to debug something with Debug Mode.

Expected Behavior

It should be able to make a call to the ingest endpoint. Probably the CORS should allow any header.

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.2.20 (user setup)
VSCode Version: 1.105.1
Commit: b3573281c4775bfc6bba466bf6563d3d498d1070
Date: 2025-12-12T06:29:26.017Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26200

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report.

This looks like a valid issue with the CORS configuration of the local debug ingest endpoint. The “traceparent” header from Azure Application Insights isn’t allowed by the current CORS policy at http://127.0.0.1:7242/ingest/.

I’ll create a ticket for the engineering team to update the Debug Mode CORS policy to support standard W3C tracing headers.

1 Like

Ran into the same issue with OpenTelemetry browser instrumentation:

Root cause: FetchInstrumentation adds traceparent headers to all fetch requests, including debug logs to ``http://127.0.0.1:7242``. That server doesn't allow traceparent in CORS, so the browser blocks the request.

The workaround for me was to add ignore patterns to my instrumentation config:

  registerInstrumentations({

      instrumentations: [

new FetchInstrumentation({

// Propagate trace context in fetch requests

propagateTraceHeaderCorsUrls: [

// Allow CORS trace propagation to backend

/.*/,

          ],

// Exclude debug logging endpoint from instrumentation to avoid CORS issues

// The debug endpoint doesn't support traceparent headers

ignoreUrls: [

/^http:\/\/127\.0\.0\.1:7242\/.*/,

/^http:\/\/localhost:7242\/.*/,

          ],

}),

new XMLHttpRequestInstrumentation({

// Propagate trace context in XMLHttpRequest (used by EventSource/SSE)

propagateTraceHeaderCorsUrls: [

/.*/,

          ],

// Exclude debug logging endpoint from instrumentation

ignoreUrls: [

/^http:\/\/127\.0\.0\.1:7242\/.*/,

/^http:\/\/localhost:7242\/.*/,

          ],

}),

new UserInteractionInstrumentation({

// Automatically instrument user interactions (clicks, form submissions, etc.)

}),

      ],

});