
query-patterns
Constructing and interpreting Honeycomb queries on trace, log and event datasets: operation selection (percentiles not AVG, HEATMAP for distributions), relational fields (root., parent., any., none.), calculated fields, query math, and reading results (P99/P50 ratios, heatmap bands, TOTAL/OTHER rows, raw JSON via queryresultjson). Trigger phrases: "show me latency", "error rate", "find slow requests", "find outliers", "interpret results", "relational fields", "calculated fields", "download raw results". For metrics datasets (datasettype=metrics) use metrics-queries.
- Installs
- 119
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/honeycombio/agent-skill --skill query-patterns- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads query-patterns automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Honeycomb Query Patterns
Opinionated guidance for writing effective Honeycomb queries. The MCP tools already document their parameters and schemas — this skill focuses on when and why to use each pattern, not how to call the tools.
Key Principles
- Never use AVG for latency — AVG hides tail latency. Use P99 (or P95/P90) to see what slow users experience. Reserve AVG for non-latency metrics like payload size.
- Use HEATMAP for distributions — Single-number aggregates hide bimodal patterns. HEATMAP reveals whether you have one population or two.
- Combine calculations in one query —
COUNT, P99(duration_ms), HEATMAP(duration_ms)in a single query reduces API calls and gives a complete picture. - Start broad, narrow with WHERE — Begin with a COUNT/GROUP BY to understand shape, then add filters to focus.
- Check for prior work — Call
find_queriesbefore writing new queries. Someone may have already answered the question.
Choosing the Right Operation
| Question | Use |
|---|---|
| How much traffic? | COUNT grouped by route or service |
| How many unique users/IPs? | COUNT_DISTINCT(field) |
| How fast for most users? | P50(duration_ms) |
| How fast for the worst-off users? | P99(duration_ms) |
| Is there a bimodal pattern? | HEATMAP(duration_ms) |
| What's the worst case? | MAX(duration_ms) |
| How many concurrent operations? | CONCURRENCY |
| Is it getting worse over time? | RATE_AVG(duration_ms) |
Relational Field Strategy
Use relational prefixes to ask cross-span questions within a trace:
- "Show me slow endpoints caused by a specific downstream": Filter with
any.service.nameto find traces where that service participates, group byroot.http.routeto see which user-facing endpoints are affected. - "What's different about errored traces?": Filter with
any.error = true, group byroot.nameto see which entry points have errors somewhere in their trace tree. - Exclude noise:
none.service.name = "health-check"removes traces containing health checks.
Calculated Fields
Calculated fields are per-event expressions evaluated at query time. They transform, classify, and combine existing fields without re-instrumenting code.
Three scopes — choose the narrowest that fits the need:
- Query-scoped (not saved): exploratory, one-off analysis
- Dataset-level (saved): reusable within one service's dataset
- Environment-level (saved): reusable across all datasets (e.g.,
error_pct)
Common patterns:
- Error rate:
MUL(IF($error, 1, 0), 100)→ useAVG(error_pct)to get percentage - Status classification:
IF(GTE($http.status_code, 500), "5xx", GTE($http.status_code, 400), "4xx", "ok") - Latency bucketing:
BUCKET($duration_ms, 500, 0, 3000) - Prefix routing:
IF(STARTS_WITH($url, "/admin"), "admin", STARTS_WITH($url, "/api"), "api", "other") - Exact-match classification: use
SWITCHinstead ofIF(EQUALS(...))chains — same expression, more efficient
Key guardrails:
- Don't create presentational (alias-only) fields — a field that just renames another field adds no analytical value and clutters the schema. Only save a calculated field when it does real computation (classification, extraction, math).
- Avoid regex on large/complex fields — running
REG_MATCH,REG_VALUE, orREG_COUNTonexception.stacktrace,db.statement, or full log lines can be very slow. Check whether a more targeted OTel field exists first (exception.type,exception.message,db.operation). If you must regex a long field, guard it with aCONTAINScheck first. EQUALShas strict type matching —EQUALS($http.status_code, 200)silently returns false if the field is stored as a string. Usefind_columnsto verify the field type before comparing.FORMAT_TIMEis expensive — avoid in high-volume queries.- Save query-scoped, not dataset-level, for one-off work — saved fields show up in everyone's schema.
For full syntax, operator reference, and extended anti-pattern examples, consult
${CLAUDE_PLUGIN_ROOT}/skills/query-patterns/references/calculated-fields.md.
Before Every Query
- Filter on
is_rootwhen measuring user-facing latency — without it, internal spans inflate the numbers - Use human-readable time ranges (
"24h","-6h") — epoch timestamps are error-prone and hard to review - Validate columns with
find_columnsbefore querying — confirms field names exist and prevents empty results
Interpreting Results
After running a query, the MCP tool returns formatted markdown plus metadata.
The most important metadata field is query_result_json — a signed URL to the raw
JSON result. For precise analysis, download it and parse with jq or python rather
than relying solely on the ASCII rendering.
Key interpretation rules:
- P99/P50 > 10x — bimodal distribution likely; run HEATMAP to confirm
- TOTAL row in breakdown results = aggregate across all groups
- OTHER row = groups beyond the query limit (increase limit if OTHER is large)
- ASCII heatmap
▁▂▃▄▅▆▇█= density from low to high; two bands = two populations - query_run_pk in metadata — feed directly to
run_bubbleupfor outlier analysis
Additional Resources
Reference Files
${CLAUDE_PLUGIN_ROOT}/skills/query-patterns/references/visualize-operations.md— Complete VISUALIZE operation reference with examples${CLAUDE_PLUGIN_ROOT}/skills/query-patterns/references/relational-fields.md— Detailed relational field guide with cross-service patterns${CLAUDE_PLUGIN_ROOT}/skills/query-patterns/references/query-examples.md— Extensive query cookbook organized by use case${CLAUDE_PLUGIN_ROOT}/skills/query-patterns/references/result-interpretation.md— Guide to interpreting query results, raw JSON access, and statistical heuristics${CLAUDE_PLUGIN_ROOT}/skills/query-patterns/references/calculated-fields.md— Calculated field syntax, full operator reference, common patterns, and anti-patterns (presentational fields, expensive string ops, type mismatches)
Cross-References
- For the structured investigation workflow that uses these query patterns: production-investigation skill
- For SLO interpretation and burn alert design: slos-and-triggers skill
FAQ
What does the query-patterns skill do?
Constructing and interpreting Honeycomb queries on trace, log and event datasets: operation selection (percentiles not AVG, HEATMAP for distributions), relational fields (root., parent., any., none.), calculated fields, query math, and reading results (P99/P50 ratios, heatmap bands, TOTAL/OTHER rows, raw JSON via queryresultjson). Trigger phrases: "show me latency", "error rate", "find slow requests", "find outliers", "interpret results", "relational fields", "calculated fields", "download raw results". For metrics datasets (datasettype=metrics) use metrics-queries.
How do I install query-patterns?
Run npx skills add https://github.com/honeycombio/agent-skill --skill query-patterns in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/query-patterns/ (personal) or .claude/skills/query-patterns/ (project).
Which AI agents can use query-patterns?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is query-patterns safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains query-patterns?
It is published by honeycombio in honeycombio/agent-skill. It has 119 recorded installs.
More from honeycombio/agent-skill
otel-instrumentation
honeycombio/agent-skill
OpenTelemetry SDK setup, custom instrumentation, and sending data to Honeycomb. Trigger phrases: "instrument my app", "add tracing", "set up OpenTelemetry", "configure OTel", "add custom spans", "add attributes to spans", "send traces to Honeycomb", "set up OTLP", "configure sampling", "add span events", "add span links", "set up tracing for [any language]", "configure the OTel Collector".
create-honeycomb-board
honeycombio/agent-skill
Design and create a Honeycomb board (dashboard) with queries and SLOs. Trigger phrases: "make a board", "build a dashboard", "create a Honeycomb board", "make a dashboard in Honeycomb", "set up a board", "dashboard for my service", "visualize service health", "golden signals dashboard", "set up monitoring board".
production-investigation
honeycombio/agent-skill
Workflows for investigating production issues in Honeycomb: context priming, broad query, BubbleUp, trace analysis, verification, and chaining results between steps to a root cause. Trigger phrases: "investigate production issue", "debug latency spike", "find root cause", "use BubbleUp", "analyze traces", "debug an outage", "why is my API slow", "errors are increasing", "health check", "SLO burning".
observability-fundamentals
honeycombio/agent-skill
Open the skill to read its SKILL.md instructions.
otel-migration
honeycombio/agent-skill
Open the skill to read its SKILL.md instructions.
Popular data & databases skills
supabase-postgres-best-practices
supabase/agent-skills
Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pgcron, pgmq), vector/semantic search (pgvector), and restoring dumps (pgrestore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.
prisma-client-api
prisma/skills
Prisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany", "create", "update", "delete", "$transaction".
prisma-database-setup
prisma/skills
Deprecated compatibility name for prisma-orm-setup. Use only when a user or existing integration explicitly invokes prisma-database-setup; otherwise select prisma-orm-setup.
prisma-cli
prisma/skills
Prisma ORM 7 CLI reference for existing Prisma 7 applications or explicitly selected Prisma 7 workflows. Covers prisma init, generate, migrate, db, dev, studio, and mcp. For setup, connection repair, or Prisma 8, use prisma-orm-setup; not the Prisma Platform CLI.
prisma-postgres
prisma/skills
Deprecated compatibility name for prisma-postgres-setup. Use only when a user or existing integration explicitly invokes prisma-postgres; otherwise select prisma-postgres-setup.
prisma-driver-adapter-implementation
prisma/skills
Required reference for Prisma ORM 7 SQL driver adapter work. Use when implementing or modifying adapters, adding database drivers, or touching SqlDriverAdapter, Transaction, savepoint, result mapping, or DriverAdapterError behavior. Covers current transaction lifecycle, optional savepoint hooks, original database-error preservation, and verification.