mirror of
https://github.com/pydantic/skills.git
synced 2026-09-14 20:06:48 +08:00
1.9 KiB
1.9 KiB
name, description
| name | description |
|---|---|
| debug | Use Logfire traces to investigate errors and debug production issues |
/debug
Use the Logfire MCP server to investigate errors and debug issues using real trace data.
Prerequisites
The Logfire MCP server must be connected (this plugin configures it automatically). The user must have run logfire auth or set LOGFIRE_TOKEN for their project.
Workflow
When the user reports an error in a specific file
- Call the
find_exceptions_in_fileMCP tool with the file path to get the 10 most recent exceptions from that file. - Show the user the exceptions found - include the exception type, message, and when it occurred.
- If a specific exception is relevant, use
arbitrary_queryto dig deeper into the surrounding trace context. - Suggest a fix based on the exception details and trace data.
When the user asks about general issues or wants to explore
- Call
get_logfire_records_schemato understand the available columns and tables. - Use
arbitrary_queryto run SQL queries against the OpenTelemetry data. Common queries:- Recent errors:
SELECT start_timestamp, message, attributes FROM records WHERE level = 'error' ORDER BY start_timestamp DESC LIMIT 20 - Slow operations:
SELECT span_name, duration, start_timestamp FROM records WHERE duration > interval '1 second' ORDER BY duration DESC LIMIT 20 - Specific endpoint issues:
SELECT * FROM records WHERE attributes->>'http.route' = '/api/users' AND level = 'error' ORDER BY start_timestamp DESC LIMIT 10
- Recent errors:
- Present findings and suggest fixes.
When the user wants to share a trace
- Use the
logfire_linkMCP tool to generate a shareable URL for a specific trace. - Share the link with the user.
Output format
When presenting debug findings:
- Lead with the most likely root cause
- Include relevant trace/span data as evidence
- Suggest concrete code changes to fix the issue
- Offer a Logfire UI link if the user wants to explore further