logfire-query
БесплатноБез исполняемых скриптовНе проверенQuery and analyze Logfire telemetry data — traces, logs, spans, metrics, summaries, and SQL results. Use this skill when the user asks to "query logfire"…
от pydantic★ 162 звезды на GitHubОб этом скилле
Query Logfire Data
User-Facing Progress
Keep progress updates terse. Do not narrate route classification, local skill instructions, schema selection, or routine query setup. If an update is needed, use one short sentence focused on the action, such as "Querying recent Logfire errors."
Critical Routing: One Workflow Per Request
Before using any query tool, classify the request.
- Query route: "analyze", "query", "count", "summarize", "compare", "find root cause", "find slowest", "look up errors", "get metrics", or "add query capabilities".
- UI route: "open", "show in browser", "show in Codex", "show in Logfire", "live view", "open Explore", "open the UI", "give me a link", or GUI/browser presentation. Use
logfire-ui; do not callquery_runjust to make a URL. - Ambiguous route: prompts like "show recent errors", "view logs", or "show spans" do not specify whether the user wants chat analysis or the Logfire UI. Ask the user to choose query analysis or UI view.
- Combined route: if the user explicitly asks for both analysis and a link, query only for the requested analysis or to identify the requested item, then provide the relevant Logfire link. Do not add UI/browser work unless the user asked for it.
Only query before opening Logfire UI when the user asks to open a specific unknown item that must be found first, such as "find the slowest trace and open it" or "open the latest error trace".
CLI and Application Queries
| Aspect | MCP query_run |
REST API /v2/query |
|---|---|---|
| Best for | Interactive analysis through native MCP or the CLI | Adding query code to a project |
| Auth | Saved OAuth or an explicit project API key | Bearer read token |
| Setup | Connected MCP session, CLI login, or an explicitly configured headless API key | Need a read token |
| Formats | JSON rows | JSON, CSV, Apache Arrow |
| Default window | Last 30 min | Explicit min_timestamp required |
| Max range | 14 days | 14 days |
| Row limit | Must be in SQL | Default 100, max 10,000 |
Quick Schema Reference
records table (spans and logs)
Key columns for querying:
| Column | Type | Description |
|---|---|---|
start_timestamp |
timestamp (UTC) | When span/log was created |
end_timestamp |
timestamp (UTC) | When span/log completed |
duration |
double (seconds) | Time between start and end; NULL for logs |
trace_id |
string (32 hex) | Unique trace identifier |
span_id |
string (16 hex) | Unique span identifier |
parent_span_id |
string (16 hex) | Parent span; NULL for root spans |
span_name |
string | Low-cardinality label for similar records |
message |
string | Human-readable description with arguments filled in |
level |
integer | Severity (supports level = 'error' string comparison) |
kind |
string | span, log, span_event, or pending_span |
service_name |
string | Service identifier |
is_exception |
boolean | Whether an exception was recorded |
exception_type |
string | Exception class name |
exception_message |
string | Exception message |
exception_stacktrace |
string | Full traceback |
attributes |
JSON | Structured data; query with ->>'key' |
tags |
string[] | Grouping labels; query with array_has(tags, 'x') |
http_response_status_code |
integer | HTTP status code |
http_method |
string | HTTP method |
http_route |
string | HTTP route pattern |
otel_status_code |
string | Span status |
metrics table
| Column | Type | Description |
|---|---|---|
recorded_timestamp |
timestamp (UTC) | When metric was recorded |
metric_name |
string | Metric name |
metric_type |
string | Type (gauge, sum, histogram, exponential_histogram) |
unit |
string | Unit of measurement |
scalar_value |
double | Metric value |
service_name |
string | Service identifier |
attributes |
JSON | Metric dimensions |
Full schema: references/schema.md
SQL Syntax
Logfire uses Apache DataFusion (Postgres-like). Key patterns:
-- Time filtering
WHERE start_timestamp > now() - interval '1 hour'
-- JSON attribute access
WHERE attributes->>'user_id' = '123'
SELECT attributes->>'http.url' as url FROM records
-- Nested JSON
attributes->'request'->>'method'
-- Array filtering
WHERE array_has(tags, 'production')
-- Level filtering (string comparison works)
WHERE level = 'error'
-- Case-insensitive matching
WHERE message ILIKE '%timeout%'
-- Time bucketing for aggregation
SELECT time_bucket(interval '5 minutes', start_timestamp) as bucket,
count(*) FROM records GROUP BY bucket ORDER BY bucket
MCP Approach (Interactive)
Call the query_run MCP tool:
query(required): SQL query stringproject(optional): target project (default: user's current project)- For a bounded time window, inspect the connected tool's schema for its timestam
Установить logfire-query в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл logfire-query?
Query and analyze Logfire telemetry data — traces, logs, spans, metrics, summaries, and SQL results. Use this skill when the user asks to "query logfire", "search traces", "find logs", "query data", "search spans", "look up errors in logfire", "get metrics from logfire", "analyze telemetry", "summarize errors", "find root cause", or add Logfire querying capabilities to code. Do not use this skill for direct Logfire UI, browser, live-view, Explore-page, or link-opening requests; use logfire-ui instead. If "show" or "view" wording is ambiguous, ask whether the user wants a UI view or query analysis.
Как установить скилл logfire-query?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл logfire-query запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic