From 69b263fffa0c4e6c89523a6ca9a9784f836a9340 Mon Sep 17 00:00:00 2001 From: Evan Purkhiser Date: Mon, 23 Sep 2024 14:22:51 -0400 Subject: [PATCH] feat(uptime): Allow-list SentryUptimeBot in crawlers We don't want to disallow our own bot from producing traces --- CHANGELOG.md | 1 + relay-filter/src/web_crawlers.rs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5599d8bf010..8f142d1362d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ **Internal:** - Add the dynamic sampling rate to standalone spans as a measurement so that it can be stored, queried, and used for extrapolation. ([#4063](https://github.com/getsentry/relay/pull/4063)) +- Allowlist the SentryUptimeBot user-agent. ([#4068](https://github.com/getsentry/relay/pull/4068)) ## 24.9.0 diff --git a/relay-filter/src/web_crawlers.rs b/relay-filter/src/web_crawlers.rs index 60cf49d28e9..0d16e5da6b4 100644 --- a/relay-filter/src/web_crawlers.rs +++ b/relay-filter/src/web_crawlers.rs @@ -41,7 +41,8 @@ static WEB_CRAWLERS: Lazy = Lazy::new(|| { static ALLOWED_WEB_CRAWLERS: Lazy = Lazy::new(|| { Regex::new( r"(?ix) - Slackbot\s1\.\d+ # Slack - see https://api.slack.com/robots + Slackbot\s1\.\d+| # Slack - see https://api.slack.com/robots + SentryUptimeBot # Uptime Checker https://docs.sentry.io/product/alerts/uptime-monitoring/ ", ) .expect("Invalid allowed web crawlers filter Regex") @@ -145,6 +146,7 @@ mod tests { "APIs-Google (+https://developers.google.com/webmasters/APIs-Google.html)", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36", "Slackbot 1.0(+https://api.slack.com/robots)", + "SentryUptimeBot/1.0 (+http://docs.sentry.io/product/alerts/uptime-monitoring/)", ]; for user_agent in &normal_user_agents { let event = testutils::get_event_with_user_agent(user_agent);