Skip to content

Add support for looking up traces by trace ID #421

@dcramer

Description

@dcramer

Feature Request

Add the ability to look up a trace by its trace ID to get a high-level overview and link to view trace details in Sentry.

Use Case

Users often have a trace ID from logs or error reports and need to quickly:

  1. Get a high-level overview of the trace (duration, services involved, error status)
  2. Get a direct link to view the full trace details in Sentry

Proposed Solution

Create a new MCP tool (e.g., get_trace_details) that:

  • Accepts a trace ID as input
  • Queries the Sentry API to fetch trace information
  • Returns:
    • Trace overview (start time, duration, number of spans)
    • Services/projects involved
    • Error status
    • Direct link to view the trace in Sentry UI

Example Usage

User: "Show me trace abc123def456"
Assistant: [calls get_trace_details with trace_id="abc123def456"]
Returns: 
- Started: 2025-01-22 10:30:15
- Duration: 2.3s
- Spans: 15
- Services: frontend, api, database
- Status: Error in api service
- View details: https://sentry.io/organizations/my-org/performance/trace/abc123def456/

Implementation Notes

  • The Sentry API endpoint for traces is: /api/0/organizations/{org}/events-trace/{trace_id}/
  • Should handle cases where trace ID is not found
  • Consider adding support for partial trace IDs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions