This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Assumption for this script: | |
// All backend requests happen without an active client-side span. Meaning, depending on the values stored | |
// PropagationContext, server side transactions are either sampled with a server-side sample rate or | |
// force-sampled by continuing the trace from the client. | |
const serverSampleRate = 0.05; | |
const clientSampleRate = 0.2; | |
const serverTxnsPerPage = 10; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function svelteKitRoutingInstrumentation<T extends Transaction>( | |
customStartTransaction: (context: TransactionContext) => T | undefined, | |
startTransactionOnPageLoad?: boolean, | |
startTransactionOnLocationChange?: boolean | |
): void { | |
if (!browser) { | |
return; | |
} | |
function createPageloadTxn(): Transaction | undefined { |