1. Habit
  2. Skills
  3. Logfire Query skill
pydantic · 2K installs

Logfire Query skill
Runs by itself, every morning.

Daily summary of new errors.

Install the Logfire Query skill and make it a habit: follow https://gethabit.dev/skills/pydantic/logfire-query.md

  1. 1Copy
  2. 2Paste into Claude Code, Codex or Cursor
  3. 3It runs by itself

2K installs144 starsMIT licenceSource on GitHub ↗

Logfire Query

by pydantic · 2K installs

The skill

Logfire query is a skill for developers who query and analyse Logfire telemetry with SQL: traces, logs, spans and metrics, through the MCP query_run tool or the REST /v1/query API.

Only when you ask.

The habit

Daily summary of new errors.

↻ Runs by itselfevery morning

How the habit works.
You don't have to.

Three questionsWhen does it start? How does it check its work? What does it remember?

One run, step by step.
Then it stops.

Stop ruleStops after five queries per run.

  1. 01

    Classify the route

    Treat the run as query analysis, not a Logfire UI view.

  2. 02

    Query errors

    Call query_run on the records table for rows where is_exception is true, with a LIMIT.

  3. 03

    Group by service

    Count errors per service_name and list top exception_type values.

  4. 04

    Find slow spans

    Query spans with long duration, ordered by duration, with a LIMIT.

  5. 05

    Compare and log

    Compare with yesterday's digest and write new or growing errors to the log.

What it may do.
Nothing more.

Safe by defaultIt writes only in its own folder and asks you before anything goes out.

Is it for you?
Use it when it fits.

Quick checkRead both lists. If the left one sounds like you, the Logfire Query skill helps.

Use it when

  • ✓ You look up errors in Logfire
  • ✓ You find the slowest spans
  • ✓ You add query code to a project

Skip it when

  • – You want to open the Logfire UI
  • – You do not use Logfire

Questions

Logfire Query skill, answered.

MCP or REST API?

MCP query_run fits interactive analysis; the REST endpoint /v1/query fits code in a project with a read token.

Can it open the Logfire UI?

No. UI and link requests go to the logfire-ui skill.

How do I install the Logfire Query skill?

Copy the prompt at the top into your agent. It installs the skill from pydantic/skills and sets up the habit. Or run npx skills add pydantic/skills --skill logfire-query.

Is the Logfire Query skill free?

Yes. It is published under MIT. Habit is free too.

Logfire Query. Now as a habit.

Install the Logfire Query skill and make it a habit: follow https://gethabit.dev/skills/pydantic/logfire-query.md

  • Free
  • No account
  • Undo in one line

All pydantic skills →More ops skills →

Works in

  • Claude Code
  • Codex
  • Cursor
  • ChatGPT
  • Claude app

Made by pydantic, published under MIT. Habit links to the original and never changes it. Is this your skill?

Copying didn't work here. Select the line and copy it by hand.