Skip to content

feat(telemetry): Record sentry-for-ai plugin name and version - #1531

Open
wedamija wants to merge 2 commits into
mainfrom
danf/plugin-version-attribution
Open

wedamija wants to merge 2 commits into
mainfrom
danf/plugin-version-attribution

Conversation

@wedamija

Copy link
Copy Markdown
Member

sentry-for-ai plugins will send X-Sentry-Plugin and X-Sentry-Plugin-Version (getsentry/sentry-for-ai#372). Record them as app.plugin.name and app.plugin.version on the same spans and metrics as app.utm_source, so we can break plugin usage down by distribution and release.

Unknown names become other. Versions keep X.Y.Z; prereleases become dev, anything else other.

sentry-for-ai plugins will send `X-Sentry-Plugin` and `X-Sentry-Plugin-Version`
(getsentry/sentry-for-ai#372). Record them as `app.plugin.name` and
`app.plugin.version` on the same spans and metrics as `app.utm_source`, so we
can break plugin usage down by distribution and release.

Unknown names become `other`. Versions keep `X.Y.Z`; prereleases become `dev`,
anything else `other`.
@vercel

vercel Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
sentry-local Ready Ready Preview Oct 16, 2026 10:58pm UTC

Request Review

@wedamija
wedamija marked this pull request as ready for review October 19, 2026 19:32
@github-actions github-actions Bot added the risk: low PR risk score: low label Oct 19, 2026
joshuawayzwright pushed a commit to joshuawayzwright/sentry-mcp that referenced this pull request Nov 16, 2026
…, url-parser) (getsentry#1580)

## Summary

Fix 3 grandfathered silent catch blocks by adding `log.debug()` calls to
surface errors that were previously swallowed silently. Each fix follows
the project's established pattern from AGENTS.md and the
`no-silent-catch` Biome plugin (getsentry#1531).

## Changes

### 1. `src/lib/resolve-team.ts` — `fetchOrgListHint()`

**Root cause:** When `listOrganizations()` fails during team resolution
(used by `project create` and `init`), the error was silently swallowed.
Users got a generic fallback hint with no indication of what went wrong
(expired token, network issue, 403, etc.).

**Reproduction:** Any scenario where `listOrganizations()` fails during
team resolution — e.g., run `sentry project create` with an expired
token.

**Fix:** Add `log.debug("Failed to fetch org list for hint", error)` and
remove the `biome-ignore` comment.

### 2. `src/lib/trace-target.ts` — `recoveryContextFromTargetArg()`

**Root cause:** When `parseOrgProjectArg` threw on a malformed target
string during trace ID recovery, the error was silently swallowed and
recovery proceeded with empty context. This hid parse errors that could
help debug user input issues in `trace view`, `span view`, `span list`.

**Reproduction:** Run `sentry trace view --h/nothex` — the slug
validation error from `parseOrgProjectArg` is silently swallowed.

**Fix:** Add `log.debug("Failed to parse target arg for recovery
context", error)`, promote the logger to module scope, and rename the
shadowed local in `warnIfNormalized` to fix the `noShadow` lint error.

### 3. `src/lib/sentry-url-parser.ts` — `parseSentryUrl()`

**Root cause:** When a URL-looking string (starts with `http://` or
`https://`) failed to parse via `new URL()`, the error was silently
swallowed. This function is used by dashboard, event, trace, and other
commands to detect pasted Sentry URLs.

**Reproduction:** Pass a malformed URL like `https://[invalid` to any
command that accepts Sentry URLs.

**Fix:** Add `log.debug("Failed to parse URL", input, error)` and remove
the `biome-ignore` comment.

## Testing

- All existing tests pass (resolve-team: 1 test, trace-target: 19 tests,
sentry-url-parser: 84 tests)
- Lint passes clean (`biome check` — 0 errors)

<div><a
href="https://cursor.com/agents/bc-259f34b1-c9e3-4d43-a65c-4138f0f6d5ca?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/automations/95624600-485e-4461-829e-6b76f086c473"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/view-automation-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/view-automation-light.png"><img
alt="View Automation" width="141" height="28"
src="https://cursor.com/assets/images/view-automation-dark.png"></picture></a>&nbsp;</div>

---------

Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Miguel Betegón <[email protected]>
joshuawayzwright pushed a commit to joshuawayzwright/sentry-mcp that referenced this pull request Nov 16, 2026
…, url-parser) (getsentry#1580)

## Summary

Fix 3 grandfathered silent catch blocks by adding `log.debug()` calls to
surface errors that were previously swallowed silently. Each fix follows
the project's established pattern from AGENTS.md and the
`no-silent-catch` Biome plugin (getsentry#1531).

## Changes

### 1. `src/lib/resolve-team.ts` — `fetchOrgListHint()`

**Root cause:** When `listOrganizations()` fails during team resolution
(used by `project create` and `init`), the error was silently swallowed.
Users got a generic fallback hint with no indication of what went wrong
(expired token, network issue, 403, etc.).

**Reproduction:** Any scenario where `listOrganizations()` fails during
team resolution — e.g., run `sentry project create` with an expired
token.

**Fix:** Add `log.debug("Failed to fetch org list for hint", error)` and
remove the `biome-ignore` comment.

### 2. `src/lib/trace-target.ts` — `recoveryContextFromTargetArg()`

**Root cause:** When `parseOrgProjectArg` threw on a malformed target
string during trace ID recovery, the error was silently swallowed and
recovery proceeded with empty context. This hid parse errors that could
help debug user input issues in `trace view`, `span view`, `span list`.

**Reproduction:** Run `sentry trace view --h/nothex` — the slug
validation error from `parseOrgProjectArg` is silently swallowed.

**Fix:** Add `log.debug("Failed to parse target arg for recovery
context", error)`, promote the logger to module scope, and rename the
shadowed local in `warnIfNormalized` to fix the `noShadow` lint error.

### 3. `src/lib/sentry-url-parser.ts` — `parseSentryUrl()`

**Root cause:** When a URL-looking string (starts with `http://` or
`https://`) failed to parse via `new URL()`, the error was silently
swallowed. This function is used by dashboard, event, trace, and other
commands to detect pasted Sentry URLs.

**Reproduction:** Pass a malformed URL like `https://[invalid` to any
command that accepts Sentry URLs.

**Fix:** Add `log.debug("Failed to parse URL", input, error)` and remove
the `biome-ignore` comment.

## Testing

- All existing tests pass (resolve-team: 1 test, trace-target: 19 tests,
sentry-url-parser: 84 tests)
- Lint passes clean (`biome check` — 0 errors)

<div><a
href="https://cursor.com/agents/bc-259f34b1-c9e3-4d43-a65c-4138f0f6d5ca?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/automations/95624600-485e-4461-829e-6b76f086c473"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/view-automation-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/view-automation-light.png"><img
alt="View Automation" width="141" height="28"
src="https://cursor.com/assets/images/view-automation-dark.png"></picture></a>&nbsp;</div>

---------

Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Miguel Betegón <[email protected]>
joshuawayzwright pushed a commit to joshuawayzwright/sentry-mcp that referenced this pull request Nov 16, 2026
…, url-parser) (getsentry#1580)

## Summary

Fix 3 grandfathered silent catch blocks by adding `log.debug()` calls to
surface errors that were previously swallowed silently. Each fix follows
the project's established pattern from AGENTS.md and the
`no-silent-catch` Biome plugin (getsentry#1531).

## Changes

### 1. `src/lib/resolve-team.ts` — `fetchOrgListHint()`

**Root cause:** When `listOrganizations()` fails during team resolution
(used by `project create` and `init`), the error was silently swallowed.
Users got a generic fallback hint with no indication of what went wrong
(expired token, network issue, 403, etc.).

**Reproduction:** Any scenario where `listOrganizations()` fails during
team resolution — e.g., run `sentry project create` with an expired
token.

**Fix:** Add `log.debug("Failed to fetch org list for hint", error)` and
remove the `biome-ignore` comment.

### 2. `src/lib/trace-target.ts` — `recoveryContextFromTargetArg()`

**Root cause:** When `parseOrgProjectArg` threw on a malformed target
string during trace ID recovery, the error was silently swallowed and
recovery proceeded with empty context. This hid parse errors that could
help debug user input issues in `trace view`, `span view`, `span list`.

**Reproduction:** Run `sentry trace view --h/nothex` — the slug
validation error from `parseOrgProjectArg` is silently swallowed.

**Fix:** Add `log.debug("Failed to parse target arg for recovery
context", error)`, promote the logger to module scope, and rename the
shadowed local in `warnIfNormalized` to fix the `noShadow` lint error.

### 3. `src/lib/sentry-url-parser.ts` — `parseSentryUrl()`

**Root cause:** When a URL-looking string (starts with `http://` or
`https://`) failed to parse via `new URL()`, the error was silently
swallowed. This function is used by dashboard, event, trace, and other
commands to detect pasted Sentry URLs.

**Reproduction:** Pass a malformed URL like `https://[invalid` to any
command that accepts Sentry URLs.

**Fix:** Add `log.debug("Failed to parse URL", input, error)` and remove
the `biome-ignore` comment.

## Testing

- All existing tests pass (resolve-team: 1 test, trace-target: 19 tests,
sentry-url-parser: 84 tests)
- Lint passes clean (`biome check` — 0 errors)

<div><a
href="https://cursor.com/agents/bc-259f34b1-c9e3-4d43-a65c-4138f0f6d5ca?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/automations/95624600-485e-4461-829e-6b76f086c473"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/view-automation-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/view-automation-light.png"><img
alt="View Automation" width="141" height="28"
src="https://cursor.com/assets/images/view-automation-dark.png"></picture></a>&nbsp;</div>

---------

Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Miguel Betegón <[email protected]>

This branch was successfully deployed

1 active deployment
Preview — 0df9c7ca Deployed Oct 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: low PR risk score: low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant