spans-query
MUST load BEFORE writing any Better Stack spans/traces SQL query. Contains required syntax for span queries - without this, queries will fail.
Install
With your agent
Install OMGSkills skill "betterstackhq/claude-plugin:skills/spans-query" into this agent's normal skills directory: call the OMGSkills MCP get_install_plan tool for your agent and run the script it returns (it installs only the pinned commit and verifies SKILL.md), and stop if MCP or the pin is unavailable. Do not overwrite or change existing skills without asking me.
Manual command
git clone https://github.com/BetterStackHQ/claude-plugin /tmp/claude-plugin && ln -s /tmp/claude-plugin/skills/spans-query ~/.claude/skills/spans-query
From README
Spans Query Building Guide Where the query runs These queries read raw events, so they run ad hoc through query and renderchart; dashboard charts only read the metrics collection (see dashboard-builder for log and span volumes there). query and renderchart take no template variables. First call queryhelp with the source ID: it names the source's collections and the table to pass. Put the collection where {{source}} stands (e.g. remote(t123myapplogs) for the last 30 minutes, s3Cluster(primary, t123myapps3) with its row-type filter for older rows), a bucket such as toStartOfInterval(dt, INTERVAL 5 MINUTE) where {{time}} stands, and concrete bounds such as dt > now() - INTERVAL 3 HOUR for {{starttime}} and {{endtime}}. Add a LIMIT, and call querywindows before an s3Cluster(...) query over more than a few hours.
More from this repo
chart-alerts
Guide for creating and managing Better Stack chart alerts.
chart-generation
Complete reference for chart types, units, and settings on Better Stack dashboards.
chart-styling
Better Stack chart styling and advanced settings reference - series colors and order, number chart coloring thresholds,...
