一键导入
seq-search-and-query
Query metrics stored in Seq. Use this when monitoring data or diagnostic metric information is required.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Query metrics stored in Seq. Use this when monitoring data or diagnostic metric information is required.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | seq-search-and-query |
| description | Query metrics stored in Seq. Use this when monitoring data or diagnostic metric information is required. |
| license | Apache-2.0 |
| metadata | {"author":"Datalust and Contributors"} |
Seq stores OpenTelemetry metric samples in the series data source, which is a columnar data store.
Metrics are accessed strictly using the following workflow:
NEVER query the series data source for metric definitions directly. ALWAYS use the dedicated definition search tools instead.
NEVER query the series data source directly for available dimensions. ALWAYS use the dedicated dimension listing tools instead.
NEVER list dimension values using the distinct aggregation. ALWAYS use the dedicated dimension value listing tools instead.
NEVER evaluate projection queries against the series data source. This risks impacting the performance of Seq for other
users and workloads.
Metric samples carry an @Definitions object where metric names are keys into the object. Under each metric name key,
a description property is available.
Search for metrics with cpu in their name or description (case-insensitive):
Keys(@Definitions)[?] like '%cpu%' ci or @Definitions[?].description like '%cpu%' ci
Search for metrics reported by a specific service:
@Resource.service.name = 'accounting'
If metrics searches report syntax errors, you MUST load the seq-search-and-query skill.
Determine the dimensions that apply to a metric using the dimensions MCP tool or the seqcli metrics dimensions CLI
command.
DO NOT use distinct to query for the values of a metric dimension like @Resource.service.name. Always use the
dimension values MCP tool or seqcli metrics dimensionvalues CLI command.
Metrics returned from definition searches are tagged with a kind:
Sum - counter with delta aggregation temporalityGauge - gauge or counter with cumulative aggregation temporalityFixed - histogram with fixed bucketsExponential - histogram with exponential bucketsCorrectly querying metric sample data from series relies on knowing the metric kind.
Sum Query Exampleselect sum(app_product_review_counter) as reviews_submitted
from series
where Has(app_product_review_counter)
and @Timestamp >= now() - 15m
group by time(1m)
Gauge Query Examplesselect max(dotnet.gc.last_collection.heap.size) as heap_size_bytes
from series
where (Has(dotnet.gc.last_collection.heap.size))
and @Resource.service.name = 'accounting'
and @Timestamp >= now() - 15m
group by time(1m), @Resource.service.instance.id
having heap_size_bytes > 5000000
limit 100
Fixed Query ExamplesHTTP request timing percentiles:
select
phist(coalesce((bucket.from + bucket.to) / 2, bucket.from, bucket.to), bucket.count, 95) as p95,
phist(coalesce((bucket.from + bucket.to) / 2, bucket.from, bucket.to), bucket.count, 99) as p99
from series
lateral unnest(http.server.request.duration.buckets) as bucket
where Has(http.server.request.duration.buckets)
and @Resource.service.name = 'cart'
and @Scope.name = 'Microsoft.AspNetCore.Hosting'
and @Timestamp >= now() - 15m
group by time(1m)
limit 100
HTTP request througput (counts):
select sum(http.server.request.duration.count) as request_throughput
from series
where Has(http.server.request.duration.buckets)
and @Resource.service.name = 'cart'
and @Scope.name = 'Microsoft.AspNetCore.Hosting'
and @Timestamp >= now() - 15m
group by time(1m)
limit 100
Maximium HTTP request body size:
select max(http.server.request.body.size.max) as max_body_size
from series
where Has(http.server.request.body.size.buckets)
and @Resource.service.name = 'shipping'
and @Scope.name = 'opentelemetry-instrumentation-actix-web'
and @Timestamp >= now() - 15m
group by time(1m)
limit 100
Exponential Query ExamplesCommit timing percentiles:
select
phist(bucket.midpoint, bucket.count, 95) as p95,
phist(bucket.midpoint, bucket.count, 99) as p99
from series
lateral unnest(commit_duration.buckets) as bucket
where Has(commit_duration.buckets)
and @Timestamp >= now() - 15m
group by time(1m)
limit 100
where Has(<metric name>) must always be included to avoid row count skew.select disctint(<dimension>) with metric dimensions: aways use the optimized dimension value searches exposed by seqcli or the MCP tools.select list.group by <expr> as <alias> and use order by <alias>. Never add the group key to the select list, this will fail.