跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
搜索与研究

signoz-generating-queries

Generate, write, or run an ad-hoc query against SigNoz observability data — metrics, logs, or traces — without wrapping it in a dashboard panel or alert. Make sure to use this skill whenever the user asks "show me error rates", "query logs for timeout errors", "what's the p99 latency for the cart service", "how many requests hit the payment endpoint", "find slow traces", "errors in the last hour", or otherwise asks an exploratory question that needs live observability data — even if they don't say "query" or "search" explicitly.

SigNoz · 已有 AI 审核记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add SigNoz/agent-skills --skill signoz-generating-queries

技能说明


name: signoz-generating-queries description: > Generate, write, or run an ad-hoc query against SigNoz observability data (metrics, logs, or traces) without wrapping it in a dashboard panel or alert. Make sure to use this skill whenever the user asks "show me error rates", "query logs for timeout errors", "what's the p99 latency for the cart service", "how many requests hit the payment endpoint", "find slow traces", "errors in the last hour", or otherwise asks an exploratory question that needs live observability data, even if they don't say "query" or "search" explicitly.

Query Generate

Prerequisites

This skill calls SigNoz MCP server tools heavily (signoz_execute_builder_query, signoz_query_metrics, signoz_search_logs, signoz_search_traces, signoz_aggregate_logs, signoz_aggregate_traces, signoz_get_field_keys, signoz_get_field_values, signoz_list_metrics, signoz_list_services, signoz_get_service_top_operations, signoz_get_trace_details). Before running the workflow, confirm the signoz_* tools are available. If they are not, run signoz-mcp-setup first to initialize or repair the MCP connection. Do not fall back to raw HTTP calls or fabricate query results without the MCP tools.

When to use

Use this skill when the user asks to:

  • Query, search, or look up observability data (traces, logs, metrics)
  • Compute aggregations (error rate, p99 latency, request count, throughput)
  • Find specific log entries, traces, or metric values
  • Investigate patterns (spikes, drops, trends over time)

Do NOT use when:

  • User wants raw ClickHouse SQL for a dashboard panel (custom joins, window functions, regex over log bodies); that's a separate dashboard-panel SQL workflow, not this skill.
  • User needs the Exceptions Explorer as an exception-specific signal: the current MCP contract has no exception query tool. Explain that limitation and offer an equivalent error-trace or error-log query only if it answers their underlying question.

Instructions

Step 1: Determine the signal type

Map the user's intent to the right signal:

User intentSignalWhy
Error rate, latency, throughput, request countmetrics (preferred) or tracesMetrics are pre-aggregated and fastest. Use traces if the user needs per-request detail or no matching metric exists.
p50/p75/p90/p95/p99 latencymetrics (histogram) or traces (aggregate on duration_nano)Prefer metrics if a histogram metric exists (e.g., signoz_latency_bucket). Fall back to trace aggregation.
Find specific log entries, error messages, stack traceslogsText search, pattern matching, severity filtering.
Find specific traces, slow requests, error spanstracesPer-request detail, span attributes, duration filtering.
Infrastructure metrics (CPU, memory, disk, network)metricsAlways metrics for resource utilization.
Ingestion volume (bytes or count), cost, or billing usagemetrics with source=meter (Cost Meter)signoz.meter.* ingestion metrics (logs/spans/datapoints by count and bytes) live only in the meter store; bytes are unavailable on the raw signals. Dollar cost is not a metric; derive it from volume × per-unit price (see Step 2). groupBy/filter work like a normal metric, but only over the limited attribute set the meter retains (not arbitrary log/trace fields). For a count sliced by an attribute the meter doesn't carry, aggregate logs/traces directly instead.
"How many X per Y" (count/rate grouped by dimension)traces or logs (aggregate)Use signoz_aggregate_traces or signoz_aggregate_logs for grouped counts.

Traces have no unqualified full-text search; use CONTAINS against a discovered structured trace field. searchText-style body search is logs-only.

If the signal is genuinely ambiguous, ask the user before proceeding. The host application decides how the question is surfaced (e.g. a structured clarification tool or an inline <assistant_question> tag); follow the host's UI rendering rules.

Step 2: Discover available data

Always discover before querying. Use only names returned by tools, never guess from training knowledge.

Run discovery calls in parallel where possible:

  • For metrics: Call signoz_list_metrics with a searchText substring matching the user's intent (e.g., searchText: "http", searchText: "latency"). The response includes metric type, temporality, and isMonotonic; pass these to signoz_query_metrics to avoid extra lookups. Before filtering or grouping, discover labels with signoz_get_field_keys(signal: "metrics", metricName: <discovered-name>); metric labels are not trace/log attributes (db.system, for example, is a span attribute unless discovery also returns it for metrics).

    Choose timeAggregation from the discovered metric metadata:

    Metric typeValid timeAggregation
    gaugelatest, sum, avg, min, max, count, count_distinct
    monotonic counter/sumrate, increase
    non-monotonic sumavg, sum, min, max, count, count_distinct; never latest or rate
    histogram / exponential histogramomit; aggregation is automatic
  • For Cost Meter (ingestion volume, cost, billing): pass source=meter to signoz_list_metrics to discover the metrics (signoz.meter.*); they're invisible in the default store and the set evolves, so don't hardcode it. groupBy/filters/aggregations then work like any metric, with three caveats: bytes exist only here (count is also available via direct signoz_aggregate_logs/_traces); the meter retains only a limited attribute set, so discover groupable keys via signoz_get_field_keys(signal: "metrics", source: "meter"), and fall back to a direct count (no bytes) to slice by an attribute it lacks; and dollar cost is not a meter metric: the store holds only vol

阅读完整来源 ↗