Send payload data with POST/PUT/PATCH requests to Sentry.io

Discussão em 'Angular' iniciado por Snæbjørn, Novembro 25, 2024.

  1. Snæbjørn

    Snæbjørn Guest

    I'm trying to add the payload data to the breadcrumbs sent to Sentry.io.

    It just looks like this.

    [​IMG]

    I found out how to add the response.

    const sentryConfig: BrowserOptions = {
    beforeBreadcrumb: (breadcrumb, hint) => {
    if (breadcrumb.category === 'xhr') {
    // hint.xhr is a whole XHR object that you can use to modify breadcrumb
    breadcrumb.data = (hint.xhr as XMLHttpRequest).response;
    }

    return breadcrumb;
    }
    };


    But I cannot seem to find a way to add the payload. XMLHttpRequest doesn't have this info.

    Continue reading...

Compartilhe esta Página