From ceda1e8c1c94205e2d3b6617f048d018a3113451 Mon Sep 17 00:00:00 2001 From: Tony Yang Date: Thu, 17 Apr 2025 01:25:48 +0800 Subject: [PATCH] update: trace only api calls --- functions/{ => api}/_middleware.js | 2 +- wrangler.toml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) rename functions/{ => api}/_middleware.js (75%) diff --git a/functions/_middleware.js b/functions/api/_middleware.js similarity index 75% rename from functions/_middleware.js rename to functions/api/_middleware.js index 19fed5c..2597574 100644 --- a/functions/_middleware.js +++ b/functions/api/_middleware.js @@ -2,7 +2,7 @@ import * as Sentry from "@sentry/cloudflare"; export const onRequest = [ Sentry.sentryPagesPlugin((context) => ({ - dsn: "https://9d2c460f5e6bca67a47fa821860dceef@o4506857623453696.ingest.us.sentry.io/4509163928944640", + dsn: context.env.SENTRY_DSN, // Set tracesSampleRate to 1.0 to capture 100% of spans for tracing. // Learn more at // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate diff --git a/wrangler.toml b/wrangler.toml index e4a5db2..4954619 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -10,6 +10,7 @@ turnstile_site_key = "0x4AAAAAABL64iQLO7IcpeAL" turnstile_secret_key = "0x4AAAAAABL64iEN4VrGqNbSF9AvtUiDgr0" recaptcha_site_key = "6LdTSxkrAAAAAOWt1LWFd9HYt8IRXyT0PaJXouC3" recaptcha_secret_key = "6LdTSxkrAAAAAJSaQNfWeediIrFTITejA9cRqiCR" +SENTRY_DSN = "https://9d2c460f5e6bca67a47fa821860dceef@o4506857623453696.ingest.us.sentry.io/4509163928944640" [[d1_databases]] binding = "DB"