Skip to content

Conversation

@jaffrepaul
Copy link
Contributor

Add Sentry metrics to the tracesSampler to provide visibility into traffic
patterns hitting the docs site.

Each sampling decision now emits a docs.trace.sampled metric with attributes:

  • traffic_type: ai_agent, bot, user, or unknown
  • agent_match / bot_match: the specific pattern that matched (e.g., "claudebot", "googlebot")
  • sample_rate: the sampling rate applied (0, 0.3, or 1)

This builds on #16213 which added the tracesSampler for bot filtering. With
these metrics, we can now query in Sentry to understand volume breakdown by
traffic type, which bots hit the site most, and which AI agents are consuming
docs content.

Track sampling decisions with Sentry.metrics.count to provide visibility
into traffic patterns hitting the docs site. Each sampling decision now
emits a docs.trace.sampled metric with attributes for traffic_type
(ai_agent, bot, user, unknown), the specific bot/agent matched, and the
sample rate applied.

This enables querying in Sentry to understand:
- Volume breakdown by traffic type
- Which bots are hitting the site most frequently
- Which AI agents are consuming docs content
- How much traffic is being filtered vs sampled

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Feb 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview, Comment Feb 2, 2026 6:06pm
sentry-docs Ready Ready Preview, Comment Feb 2, 2026 6:06pm

Request Review

Copy link
Member

@sergical sergical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥🔥🔥

@jaffrepaul jaffrepaul merged commit 3be5405 into master Feb 2, 2026
16 checks passed
@jaffrepaul jaffrepaul deleted the feat/trace-sampler-metrics branch February 2, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants