honeycomb-query-patterns
Skill137 starsChanged 10 days agoApache-2.0View on GitHub
Load before building or reading a Honeycomb run_query on a trace, log or event dataset. Covers which operation to pick (percentiles and HEATMAP over AVG), relational fields (root., parent., any., none.), calculated fields, query math, and how to read results such as P99/P50 ratios, heatmap bands and TOTAL/OTHER rows. For datasets with dataset_type=metrics, use honeycomb-metrics-queries instead.
In this repository72 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- agentcore-observability-setupSkill
- agentcore-ops-reviewSkill
- aiml-access-diagnosticsSkill
- aiml-gpu-training-cluster-investigationSkill
- analytics-opensearch-expertiseSkill
- aws-backup-coverage-reviewSkill
- aws-eks-healthdashboardSkill
- aws-eks-operations-reviewSkill
- aws-fsxn-operations-reviewSkill
- aws-health-eventsSkill
- aws-natgw-traffic-analysisSkill
- aws-routingSkill
- aws-vpc-dns-investigationSkill
- bedrock-adoption-readinessSkill
- bedrock-operation-reviewSkill
- bronto-dataset-discoverySkill
- bronto-error-investigationSkill
- bronto-log-searchSkill
- cloudtrail-cost-optimizationSkill
- config-cost-optimizationSkill
- coralogix-ai-centerSkill
- coralogix-alertsSkill
- coralogix-case-analyticsSkill
- coralogix-case-managementSkill
- coralogix-casesSkill
- coralogix-dashboardsSkill
- coralogix-dataprimeSkill
- coralogix-datasetsSkill
- coralogix-data-usageSkill
- coralogix-docsSkill
- coralogix-infrastructureSkill
- coralogix-logsSkill
- coralogix-metrics-querySkill
- coralogix-ollySkill
- coralogix-rumSkill
- coralogix-service-catalogSkill
- coralogix-single-caseSkill
- coralogix-spansSkill
- coralogix-viewsSkill
- crm-production-investigation-guidelinesSkill
- database-migration-service-expertiseSkill
- database-rds-devopsSkill
- devops-agent-cost-insightsSkill
- ecs-operation-reviewSkill
- eks-upgrade-readinessSkill
- enrich-with-aws-security-agentSkill
- eos-cost-analysisSkill
- firehose-operation-reviewSkill
- grafana-cloud-investigationSkill
- guardduty-cost-optimizationSkill
- honeycomb-create-boardSkill
- honeycomb-metrics-queriesSkill
- honeycomb-observability-fundamentalsSkill
- honeycomb-production-investigationSkill
- honeycomb-slos-and-triggersSkill
- honeycomb-verify-recent-traceSkill
- investigation-cost-guardrailSkill
- live-streaming-event-readiness-reviewSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 44
Use relational prefixes to ask cross-span questions within a trace:
- Very specific: line 65
Exact-match classification: use SWITCH instead of IF(EQUALS(...)) chains — same expression, more efficient
- Very specific: line 79
Filter on
is_root: when measuring user-facing latency — without it, internal spans inflate the numbers - Very specific: line 85
After running a query, the MCP tool returns formatted markdown plus metadata.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Honeycomb Query Patterns
Requires the Honeycomb connector in the Agent Space, with its read tools enabled.
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
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
references/visualize-operations.md— Complete VISUALIZE operation reference with examplesreferences/relational-fields.md— Detailed relational field guide with cross-service patternsreferences/query-examples.md— Extensive query cookbook organized by use casereferences/result-interpretation.md— Guide to interpreting query results, raw JSON access, and statistical heuristicsreferences/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: honeycomb-production-investigation skill
- For SLO interpretation and burn alert design: honeycomb-slos-and-triggers skill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

