Skip to content

See frontend replays in backend graphql requests #9122

Answered by AbhiPrasad
adityasingh773 asked this question in Q&A
Discussion options

You must be logged in to vote

try using the tracing headers directly with the tracingContextFromHeaders util. We're gonna make this easier to use in a future version of the SDK.

you might also want to check out https://docs.sentry.io/platforms/node/configuration/async-context/

import * as Sentry from '@sentry/node';
import { Transaction } from '@sentry/node';
import { tracingContextFromHeaders } from '@sentry/utils';
import { ContextFunction } from 'apollo-server-core/src/types';

export interface SentryContext {
  transaction: Transaction;
}

export const addSentryContext: ContextFunction = (context) => {
  const { req } = context;

  const sentryTraceHeader = req.headers['sentry-trace'];
  const baggageHeader = req.h…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@AbhiPrasad
Comment options

Answer selected by adityasingh773
@alvis
Comment options

@mikan3rd
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants