Is it possible to capture outgoing HTTP request & response bodies inside breadcrumbs or spans using the Node SDK? #7347
|
Hi, import * as Sentry from '@sentry/node';
// NOTE: @sentry/tracing needs to be imported before @sentry/profiling-node
import '@sentry/tracing';
import { ProfilingIntegration } from '@sentry/profiling-node';
import { Integrations } from '@sentry/tracing';
Sentry.init({
beforeBreadcrumb(breadcrumb, hint) {
if (breadcrumb.category === 'http') {
// here is where I'm attempting to capture the bodies
}
return breadcrumb;
},
integrations: [
new ProfilingIntegration(),
new Sentry.Integrations.Http({ tracing: true }),
new Integrations.GraphQL(),
],
// ...rest of config (dsn, etc) omitted for brevity
}); |
Answered by
AbhiPrasad
Mar 6, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


We're looking to do this for the browser side in #7287 - perhaps we can do the same for Node as a opt-in.
Important to note there is possible PII issues with this though.
@mydea what to do you think?