working-with-seq-metrics

Query OpenTelemetry metric samples stored in Seq's series data source.

167|30|Updated Feb 5, 2018
One-click install
npx skills add https://github.com/datalust/seqcli --skill working-with-seq-metrics-datalust
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: working-with-seq-metrics
Source: https://github.com/datalust/seqcli/tree/main/src/SeqCli/Skills/Resources/working-with-seq-metrics
Command: npx skills add https://github.com/datalust/seqcli --skill working-with-seq-metrics-datalust

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Querying metrics in Seq requires knowing metric names, kinds, and dimensions upfront, and querying the columnar series data source incorrectly can produce wrong results or degrade server performance. This Skill enforces the correct discovery-and-query workflow for Seq metrics. ## Core Features & Use Cases - Metric Discovery: Search metric definitions by name, description, or service using the @Definitions object instead of querying the series store directly. - Dimension Exploration: List applicable dimensions and their unique values using dedicated seqcli commands or MCP tools rather than distinct aggregations. - Kind-Aware Aggregation: Run correct aggregate queries for Sum, Gauge, Fixed histogram, and Exponential histogram metrics, including percentile calculations with phist and lateral unnest. - Use Case: An SRE investigating high latency in the 'cart' service can discover the http.server.request.duration metric, list its dimensions, and compute p95/p99 request timing percentiles grouped by one-minute intervals. ## Quick Start Ask the assistant to find CPU-related metrics in Seq and chart their values over the last 15 minutes.

Frequently Asked Questions about working-with-seq-metrics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query metrics stored in Seq?

First search metric definitions via the @Definitions object, then list dimensions with seqcli metrics dimensions, and finally run aggregate queries against the series data source. Always include where Has(<metric name>) to avoid row count skew.

How do I find which metrics exist in Seq?

Search the @Definitions object on metric samples, for example Keys(@Definitions)[?] like '%cpu%' ci, or filter by service with @Resource.service.name. Never query the series data source directly for metric definitions.

How do I list values of a metric dimension in Seq?

Use the dimension values MCP tool or the seqcli metrics dimensionvalues CLI command. Do not use select distinct on the series data source, as the dedicated tools are optimized for this purpose.

How do I calculate percentiles for histogram metrics in Seq?

Use the phist function with lateral unnest over the metric's buckets column, grouping by time intervals. For fixed histograms compute bucket midpoints with coalesce; exponential histograms expose bucket.midpoint directly.

Why do my Seq counter metrics show up as gauges?

Counters appearing as gauges indicate misconfigured aggregation temporality in the OpenTelemetry exporter. This can produce wildly inaccurate aggregation results and must be fixed at the instrumentation source.

Why does my Seq metrics query fail when grouping?

Group keys are automatically included in result rowsets and must not appear in the select list. To order by a group key, alias it with group by <expr> as <alias> and use order by <alias>.