Skip to content

feat: add Sentry metric for Copy Prompt button clicks#18264

Merged
sfanahata merged 1 commit into
masterfrom
feat/copy-prompt-metric
Jun 4, 2026
Merged

feat: add Sentry metric for Copy Prompt button clicks#18264
sfanahata merged 1 commit into
masterfrom
feat/copy-prompt-metric

Conversation

@sfanahata
Copy link
Copy Markdown
Contributor

@sfanahata sfanahata commented Jun 4, 2026

DESCRIBE YOUR PR

  • Preview has been validated
  • Sentry data has been validated (see vercel preview in Sentry!)**

Track "Copy Prompt" button clicks in the Agent Skills Callout as a Sentry application metric (docs.copy_ai_prompt counter).

Metric attributes:

  • page_path -- first 3 URL segments (privacy-safe, matches existing metrics)
  • skill -- skill name (e.g. sentry-nextjs-sdk) or generic if no skill specified
  • success -- whether the clipboard copy succeeded

Changes (2 files):

  • src/metrics.ts -- Add copyAIPrompt method to DocMetrics, following the same pattern as existing metrics (copyPage, snippetCopy, etc.)
  • src/components/agentSkillsCallout/index.tsx -- Import DocMetrics and call copyAIPrompt on success/failure in the click handler. Also fixes useCallback dependency array to include skill.

IS YOUR CHANGE URGENT?

  • None: Not urgent, can wait up to 1 week+

PRE-MERGE CHECKLIST

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

Track 'Copy Prompt' button clicks in the Agent Skills Callout as a
Sentry application metric (docs.copy_ai_prompt counter).

Attributes: page_path, skill name, and success/failure status.

Changes:
- Add copyAIPrompt method to DocMetrics in src/metrics.ts
- Wire metric into AgentSkillsCallout click handler
- Fix useCallback dependency array to include skill
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 4, 2026

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

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview, Comment Jun 4, 2026 9:42pm
sentry-docs Ready Ready Preview, Comment Jun 4, 2026 9:42pm

Request Review

Copy link
Copy Markdown
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.

🎉

@sfanahata sfanahata merged commit 85615d5 into master Jun 4, 2026
23 checks passed
@sfanahata sfanahata deleted the feat/copy-prompt-metric branch June 4, 2026 21:53
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.

2 participants