Skip to content

feat(mcp): Link each search_logs result to its pinned log in Sentry - #1699

Merged
JoshuaKGoldberg merged 2 commits into
mainfrom
joshgoldberg/search-logs-pinned-links
Oct 30, 2026
Merged

JoshuaKGoldberg merged 2 commits into
mainfrom
joshgoldberg/search-logs-pinned-links

Conversation

@JoshuaKGoldberg

@JoshuaKGoldberg JoshuaKGoldberg commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Agents previously had to hand-build filter-and-time-range links to share a specific log, which break once a relative range moves past it. Pinned logs both focus on the log itself and resolve their own time window from the log ID.

Individual-log results from search_logs now include a Log URL that opens the logs explorer with that log pinned via logsPinned.

@vercel

vercel Bot commented Oct 28, 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 30, 2026 5:08pm UTC

Request Review

@JoshuaKGoldberg

Copy link
Copy Markdown
Member Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 5a9b3a3. Configure here.

@JoshuaKGoldberg
JoshuaKGoldberg marked this pull request as ready for review October 28, 2026 16:26
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Oct 28, 2026
…ogs-pinned-links

# Conflicts:
#	packages/mcp-core/src/tools/support/search-events/search.ts
Comment on lines +135 to +137
if (dataset === "logs") {
return [...new Set([...fields, "id"])];
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Log pin URLs request/read id instead of sentry.item_id

Non-aggregate logs searches append id, but Explore/Events log rows identify logs as sentry.item_id; formatLogResults also builds Log URLs from event.id, so pinned links are missing (or validation may reject the field). Request and read sentry.item_id instead.

Evidence
  • buildRequestFields() appends "id" for non-aggregate dataset === "logs" before validate/search.
  • This monorepo’s Explore/Events logs contract uses sentry.item_id as the unique log ID: CLI SentryLogSchema, LOG_FIELDS/DETAILED_LOG_FIELDS, e2e data[0]["sentry.item_id"], and logs attribute fixtures ("The unique ID of the log item.").
  • CLI documents id as the trace-logs endpoint field, not Explore/Events (id instead of sentry.item_id).
  • MCP logs field catalog and formatLogResults priority fields list sentry.item_id, but Log URLs are emitted only when typeof event.id === "string".
  • Default recommended logs fields omit id (unlike spans/metrics), and unit tests mock id: "log1" rather than the production response shape.

Identified by Warden · code-review · 4QK-MVJ

@JoshuaKGoldberg
JoshuaKGoldberg merged commit cf2a16c into main Oct 30, 2026
36 checks passed
@JoshuaKGoldberg
JoshuaKGoldberg deleted the joshgoldberg/search-logs-pinned-links branch October 30, 2026 17:19

This branch was successfully deployed

2 active deployments
Preview — 8bea8029 Deployed Oct 30, 2026 by vercel[bot]
Actions — 8bea8029 Deployed Oct 30, 2026 by JoshuaKGoldberg via eval #1419
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants