Generates and runs ad-hoc queries against SigNoz observability data (metrics, logs, traces) for exploratory questions like error rates, latency, or slow traces.
Ships in signoz. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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_service_map,
signoz_get_trace_details,
signoz_get_ai_pricing, signoz_list_ai_attribute_mappings,
signoz_test_ai_attribute_mapping). 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.
Do NOT use when:
signoz-writing-clickhouse-queries.Map the user's intent to the right signal:
| User intent | Signal | Why |
|---|---|---|
| A service's request rate, error rate, or latency | traces, through signoz_list_services | It counts each service's requests at its entry spans. For a breakdown it does not return (by operation, over time), aggregate traces with the entry-span filter in Step 3. The span metrics signoz_calls_total and signoz_latency count every span, so they do not measure requests. |
| Other rate, count, or throughput questions | metrics (preferred) or traces | Metrics are pre-aggregated and fastest. Use traces if the user needs per-span detail or no matching metric exists. |
| p50/p75/p90/p95/p99 of a metric or of span duration | metrics (histogram) or traces (aggregate on duration_nano) | Use a histogram metric that discovery returns; fall back to trace aggregation. For a service's request latency, use the first row. |
| Find specific log entries, error messages, stack traces | logs | Text search, pattern matching, severity filtering. |
| Find specific traces, slow requests, error spans | traces | Per-request detail, span attributes, duration filtering. |
| Infrastructure metrics (CPU, memory, disk, network) | metrics | Always metrics for resource utilization. |
| Ingestion volume (bytes or count), cost, or billing usage | metrics 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. |
| LLM or AI-agent cost, tokens, models, or tool calls | traces (gen_ai.* span attributes) | See references/ai-queries.md. LLM token cost is a trace attribute, not SigNoz ingestion cost; never answer it from the Cost Meter. |
| "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. |
| Who created, changed, or deleted a SigNoz dashboard, alert rule, view, channel, user, or role | logs with source: "audit" | SigNoz audit events. See references/audit-queries.md. |
Traces have no unqualified full-text search; use CONTAINS against a discovered
structured trace field. searchText convenience 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.
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 for the question, from the discovered metric type.
Omit it for the type's default: avg for a gauge or a non-monotonic sum,
rate for a counter, none for a histogram percentile. On a counter, rate
is per second and increase is the count in each step; on a cumulative
counter latest, max, min, avg, and sum read its running total.
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 volume, so don't searchText: "cost" expecting a hit.
For a cost question, query the volume metric (bytes for logs/traces, count
for metric datapoints) and multiply by the per-unit price from Settings →
Billing; ask the user for the price if you don't have it.
For traces: Call signoz_list_services to confirm the service name exists,
following pagination.nextOffset while pagination.hasMore is true before
declaring it missing.
Optionally call signoz_get_service_top_operations for the service to find
operation names. Before any attribute filter or grouping, call
signoz_get_field_keys(signal: "traces").
For logs: Before any attribute filter or grouping, call
signoz_get_field_keys(signal: "logs"); use signoz_get_field_values only
after discovery to validate values. Filter on a body field (body.<path>)
freely, but group or select it only when signoz_get_field_keys(signal: "logs", fieldContext: "body") lists it; SigNoz rejects the others.
Field keys are signal-specific: service.name may be absent on logs, while
body is logs-only. Never carry a key across signals. Skip key discovery only
when live output in this conversation returned it for the same signal, never
for user text or memory. Use returned dot notation verbatim, not camelCase
guesses such as traceID or hostname. Never assume tenant keys (org.id,
orgId, organization_id, etc.); discover the actual key per signal. Call
signoz_get_field_keys before signoz_get_field_values; both require signal,
and values also require a non-empty discovered name.
An unknown filter key usually returns no rows plus a key ... not found in metadata warning instead of an error. That means the key is absent: rerun
discovery and retry with a returned key; never report "nothing matched".
Audit events (source: "audit") are the exception to the discovery rules in
this step. Field discovery does not list their fields, so take each name
from the audit section of signoz://logs/query-builder-guide, and check a
key SigNoz reports as not found against that section.
Use the simplest tool that answers the question:
| Question type | Tool | When to use |
|---|---|---|
| Metric time series, scalar, ratio, or formula | signoz_query_metrics | Ordinary metrics queries, Cost Meter trends/rates, and metric ratios via formula + formulaQueries. limit, orderBy (__result or a groupBy label), and having (for example __result > 0.5) shape grouped results. |
| Cost Meter total or grouped total attribution | signoz_execute_builder_query | Use the discovered meter metric with raw timeAggregation: "sum"; sum complete hourly buckets. Do not use signoz_query_metrics for totals. |
| Log search (find matching entries) | signoz_search_logs | Finding specific log lines. Use searchText for literal text (searchScope chooses where it matches; the default is the log body), filter for field filters, severity for level filtering. Rows carry a default set of columns (timestamp, id, body, severity_text, trace_id, span_id); add others with selectFields, and set orderBy (for example timestamp asc) to change the newest-first order. |
| Trace search (find matching spans) | signoz_search_traces | Finding specific traces/spans. Use service, operation, error, minDuration/maxDuration shortcuts plus filter for field filters. Give durations with a unit ('500ms', '2s'); a bare number is nanoseconds. |
| Log aggregation (count, avg, percentiles) | signoz_aggregate_logs | Plain totals, grouped counts, and top-N by one or more aggregations. |
| Trace aggregation (count, avg, percentiles) | signoz_aggregate_traces | Plain totals, grouped counts, and top-N by one or more aggregations. |
| Complex log/trace formula or shaping | signoz_execute_builder_query | Use when ratios, shaping, ordering, or cardinality control exceed the convenience tools; never hand-build a plain grouped count. |
| Which services call or depend on a service | signoz_get_service_map | Caller and callee edges between traced services in the window. |
| One service's operations with latency and call counts | signoz_get_service_top_operations | Ranked by p99, highest first. To rank operations by calls or errors, aggregate traces instead. |
A join on trace_id, or a value extracted from a log body, that no builder query expresses | signoz_execute_builder_query with a clickhouse_sql query | Only under the conditions in ClickHouse SQL below. |
Read the guide for the query before you write it. Do this once per
conversation for each guide, before the first filter, aggregation
expression, formula, or signoz_execute_builder_query payload of that kind.
A call that uses only shortcut parameters and searchText does not need it.
signoz://traces/query-builder-guide.signoz://logs/query-builder-guide.reduceTo: signoz://metrics-aggregation-guide.signoz://promql/instructions.signoz_execute_builder_query payload: signoz://query-builder/examples.signoz://ai/query-builder-guide.Two rules change the number without raising an error. They apply even when you skip the guides:
signoz_list_services, or filter the
trace aggregation on isEntryPoint = true OR isRoot = true. Keep the
service argument and set filter to that expression; with other
conditions, AND them with it in parentheses. Without it, count(),
rate(), and duration percentiles cover every span the service records,
and a request with a server span nested inside another counts twice.reduceTo: "avg" of a
percentile is not the window's percentile, and reduceTo: "sum" of a rate
is not a count. For a count, use timeAggregation: "increase" with
reduceTo: "sum".ClickHouse SQL. Query Builder tools are the default. Send a
clickhouse_sql query through signoz_execute_builder_query only when no
builder query answers the question in one call:
trace_id: two sets of logs, logs and traces, or spans of one
trace (child to parent on c.parent_span_id = p.span_id, or the first and
last span per trace or per key);JSONExtract*, then grouped or counted.Compare two time windows with timeShift (references/functions.md). Only
when the question already needs SQL for a case above, compare them in that
SQL, and first read "Compare windows in ClickHouse SQL" in that file: a
wrong window bound gives a wrong count with no error. Before the SQL:
signoz://dashboard/clickhouse-schema-for-logs or
signoz://dashboard/clickhouse-schema-for-traces for the tables, columns,
and column types.signoz://query-builder/examples for the clickhouse_sql request
shape. SigNoz fills $start_timestamp, $end_timestamp,
$start_timestamp_nano, $end_timestamp_nano, $start_datetime, and
$end_datetime from the request's start and end.timestamp, and
ts_bucket_start BETWEEN $start_timestamp - 1800 AND $end_timestamp (a
resource table: seen_at_ts_bucket_start). A millisecond literal fails
on the traces timestamp with a Decimal overflow; as a lower bound on
ts_bucket_start (seconds) it matches no rows and raises no error.GLOBAL IN for a subquery on a distributed table. When you
need columns from both, GLOBAL JOIN a small, time-bounded right side.LIMIT, and aggregate in SQL; do not pull raw rows to join or
count them yourself. Count each event once: a join returns a row per
matching pair, so extra logs or spans in a trace inflate count() with
no error. Make the side you take a value from one row per trace_id, and
count events with uniqExact on their key when one event has several rows.signoz-writing-clickhouse-queries has the query patterns and the type
errors to avoid. If SigNoz rejects the SQL, apply the suggestion in the error
and rerun; if a role or the host's instructions forbid ad-hoc SQL, say which
part of the question the builder tools could not answer.
AI agent and LLM questions: read references/ai-queries.md before the
first query about LLM calls or AI-agent runs. It covers when to set
queryType: "builder_ai_query", per-call versus per-run queries, the
aggregation rules SigNoz enforces, and checking attribute mappings when AI
Observability shows no data.
Change history: read references/audit-queries.md before the first
query about who created, changed, or deleted something in SigNoz.
Comparing windows and shaping a series: read references/functions.md
when the user compares a window with an earlier one (week over week, day over
day, before and after a deploy), or asks for a smoothed series, zeros for
missing steps, capped spikes, the change per step, or a running total.
Canonical log search contract:
signoz_search_logs accepts filter; the former query alias is
rejected.searchText matches only the log body unless searchScope says
otherwise. When a body search of application logs returns nothing and the
text could be an attribute value (an ID, an error message), rerun it with
searchScope: "attribute" or "all" before reporting no match. Those
scopes scan more, so narrow the time range or add a service filter if
SigNoz rejects the query. When you know which key holds the text, filter
on it instead (attribute.<key> CONTAINS 'text').filter: "search('timeout')".
The search() scopes documented by signoz://logs/query-builder-guide
support body, attribute, resource, log, or their allowed combinations.
Unscoped search() means all supported log fields; enumerate scopes when
the user requests only a subset.filter untouched; do not escape it
again.For signoz_aggregate_logs / signoz_aggregate_traces, the aggregations
parameter description lists the expressions; several come back as
__result_0, __result_1, and so on, in order. The tools reject the former
aggregation and aggregateOn inputs. Use having to keep only groups whose
aggregate passes a condition (for example count() > 100). Custom aliases or
formulas require signoz_execute_builder_query.
For every signoz_execute_builder_query payload, put a positive limit and
non-empty order on each builder_formula spec and on each builder_query
spec no formula references: 100 rows or groups unless the question needs
another bound. Order raw rows by timestamp desc (logs: then id desc),
metrics and formulas by __result desc, and other aggregates by the primary
aggregation desc. Leave limit and order unset on every builder_query that a
formula references: an input limit applies before the formula runs and cuts
each input to its own top N, which can drop a high-ratio group. To find those
inputs, inspect every formula expression, including formulas with
disabled: true, and follow formula references until all builder_query
leaves are found. This dependency walk sets bounds only; it does not prove
the order in which formulas evaluate, so validate the complete payload.
Time-series top-N ranks groups over the whole window, so a short-lived local
spike may fall outside the returned set.
signoz_query_metrics defaults to time_series, and a scalar metrics request
must set reduceTo on query A and every formulaQueries item: last for the
current value, max for the peak, avg for a typical value, or sum with
timeAggregation: "increase" for a total count over the window.
Aggregate tools accept only scalar or time_series. For builder-query
envelopes passed to signoz_execute_builder_query, an ad-hoc question needs one of:
| Signal | Valid requestType |
|---|---|
| metrics | time_series, scalar |
| traces | raw, trace, scalar, time_series |
| logs | raw, scalar, time_series |
Never invent aggregate, table, timeseries, or series. This matrix does
not apply to PromQL or ClickHouse SQL envelopes, or to a dashboard panel
dry-run such as heatmap.
searchContext: the user's original request, verbatim.timeRange
("1h", "24h"). For a fixed window pass start, and end only together
with it, in a form the tool's parameter description accepts; start
overrides timeRange. The query object of signoz_execute_builder_query
differs: it has no relative option and takes absolute start and end as
JSON integer Unix milliseconds.service, severity, operation, error) when they
match the user's filters; they are simpler and less error-prone than building
filter expressions.filter for additional constraints; they
are ANDed together.signoz_execute_builder_query, not signoz_query_metrics. Pass the full tool arguments with
an outer query object, Unix-millisecond start/end, requestType: "time_series",
formatOptions, and variables. The builder spec keeps signal: "metrics",
source: "meter", the discovered metricName and temporality, stepInterval: 3600,
and raw timeAggregation: "sum" plus spaceAggregation: "sum". For grouped totals,
discover the meter field with signoz_get_field_keys and copy its name,
fieldDataType, fieldContext, and signal into groupBy without dropping
or translating fields. Exclude datapoints marked partial: true, then sum the
complete buckets for each returned group. Over a long window SigNoz raises
the step above an hour; read the step it applied from
data.meta.stepIntervals.signoz_query_metrics remains appropriate for a Cost Meter trend or rate that is not a total
attribution. Carry source=meter, use stepInterval: 3600, use
timeAggregation: increase for a volume trend, and rate only for a per-second rate.Scope every claim to what the read returned. Before reporting, classify each result:
hasMore as true, any
response with a nextCursor or a note saying more results exist or may
exist, or a groupBy aggregate that returned exactly limit groups
(aggregate tools do not flag this, so treat it as truncated). Claims cover
only the returned rows ("the 100 most recent matching logs all come from
pod-a"). Never present a count of returned rows as a total, and never
claim "none" or "all" for the full scope or window from a partial result.hasMore as false. Read
pagination.hasMore in the JSON when the result has a pagination
object, otherwise the note's hasMore=false. Do not infer completeness
from the row count: a page can hold fewer rows than limit while more
exist. Only this supports "none", "all", or a
total over the full scope. For a total larger than one page, use
signoz_aggregate_logs or signoz_aggregate_traces with
aggregations: "count()".Data returned:
groupBy, highlight the top entries. If exactly
limit groups came back, say more groups may exist; the total group count
is not reported.No data returned. Report what was empty and its scope, and claim nothing beyond it:
Zero over the requested scope: a successful, complete query returned no
matches. Say so with the filter and window: "No error spans matched
service.name = 'checkout-service' in the last hour." Absence of errors or
traces does not establish that the service is healthy, that it was never
running, or why the data is missing. Offer such explanations only as
labeled possibilities.
No data in range: the field or metric was seen in discovery, but no data points fall in the requested window. Report the empty window and suggest a wider range. Older data seen in a wider window is outside the requested window, not recent activity.
Not found in discovery: the metric, field, or service is absent from discovery results. Discovery is scoped and capped, and a miss in a truncated list shows nothing:
signoz_list_services lists only services with traces (6h by default).
Follow pagination.nextOffset until hasMore=false. A service missing
here may still send logs or metrics.signoz_list_metrics lists metrics active in the window (1h by default)
and has no paging. If its note reports hasMore=true, narrow with
searchText.signoz_get_field_keys and signoz_get_field_values set
data.complete=false when they truncate. Narrow with searchText.From a complete list, report "not seen in " with the scope the tool searched (a time window for services and metrics, retained metadata for field keys) rather than "does not exist" or "not instrumented". Missing instrumentation is one possibility to check, alongside a wider window or a different name.
AI results. A null or 0 cost means an unpriced model, not zero spend.
An empty AI result is "no AI traces matched", not "no LLM calls"; check the
attribute mappings as references/ai-queries.md describes.
Audit results. An empty audit result does not show that nobody made a
change; report it as references/audit-queries.md describes.
Drill-down:
signoz_get_trace_details.signoz_aggregate_* requires aggregations; signoz_query_metrics requires a
metricName from signoz_list_metrics; signoz_get_trace_details requires a
traceId; signoz_get_service_top_operations requires a service from
signoz_list_services. Discover first, then call.LIMIT.signoz-creating-alerts.apply_filter on the final message. When the user asks you to
write, build, generate, or show a query, include an apply_filter action
on your final assistant message with the exact full v5 query object you
passed to a successful signoz_execute_builder_query call in this turn. The
chip carries the entire query-range envelope (schemaVersion: "v1", start,
end, requestType, compositeQuery), not just the inner
compositeQuery, and you must copy it verbatim rather than reconstructing
it. If you answered via simplified tools (signoz_search_logs,
signoz_search_traces, signoz_aggregate_*, signoz_query_metrics), run
one validating signoz_execute_builder_query with a small limit and copy
that exact query object, or skip the chip. Use the appropriate signal
field (metrics, logs, or traces). This signals to the SigNoz UI that
the user wants to apply the query to an explorer page. Only emit
apply_filter when the user's primary intent is to obtain a runnable query,
not when the user is asking a one-shot data question that the analysis text
already answers. For a Cost Meter query keep signal: metrics and ensure the
copied query spec carries source: meter. Never emit it for an audit query.User: "Show me the error rate for the checkout service in the last hour"
Agent:
signoz_list_services(timeRange: "1h") and follows
pagination.nextOffset while pagination.hasMore is true until it finds
checkout-service.errorRate (a percentage: 0.5 means 0.5%) and
numCalls (its requests, counted at entry spans).User: "Find timeout errors in logs"
Agent:
signoz_search_logs(searchText: "timeout", severity: "ERROR", timeRange: "1h").User: "How has p99 latency for the cart service changed over the last 6 hours?"
Agent:
signoz_aggregate_traces(aggregations: "p99(duration_nano)", service: "cart-service", filter: "isEntryPoint = true OR isRoot = true", requestType: "time_series", timeRange: "6h"). The filter keeps the
service's entry spans, so each point is a request latency.User: "Which agent runs cost the most in the last day?"
Agent:
signoz://ai/query-builder-guide.signoz_search_traces(queryType: "builder_ai_query", requestType: "trace", orderBy: "trace.estimated_total_cost desc", limit: 10, timeRange: "24h").estimated_total_cost, total_tokens,
llm_call_count, and root_span_name, and says cost is a USD estimate.
If some runs show a null cost, says their models are unpriced rather than
free.signoz_get_trace_details?"User: "How much log data is each service ingesting?"
Agent:
signoz_list_metrics(searchText: "log", source: "meter") and selects the returned log-volume metric from its live
name and unit, then discovers service.name with signoz_get_field_keys.signoz_execute_builder_query with the Cost Meter total payload
from Step 4, grouped by the discovered service.name field.partial: true datapoints, sums the complete buckets per service,
and presents per-service ingestion in the discovered unit. (If the meter
lacks a requested attribute, fall back to a direct count and note that
bytes remain meter-only.)evals/evals.json (opens in a new tab)evals/files/audit-empty-result.json (opens in a new tab)evals/files/capped-logs-failed-count.json (opens in a new tab)evals/files/service-absence-traces.json (opens in a new tab)references/ai-queries.md (opens in a new tab)references/audit-queries.md (opens in a new tab)references/functions.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
13 skills in this plugin
/signoz-creating-alertsCreate a new SigNoz alert rule from a natural-language intent: threshold, anomaly, log-volume, error-rate, latency, or absent-data alerts across metrics, logs, traces, and exceptions. Make sure to use this skill whenever the user says "alert me when…", "notify me if…", "set up monitoring for…", "page me on…", "create an alert for…", or asks for a new alert/notification rule, even if they don't say the word "alert" explicitly. Also use it when someone asks to be notified about error rates, latency spikes, log volume, CPU/memory pressure, or anomalous behavior on a service or host.
/signoz-creating-dashboardsCreate a new SigNoz dashboard from a natural-language intent: import a curated template (PostgreSQL, Redis, JVM, k8s, hostmetrics, APM, LLM, etc.) when one fits, or build a custom dashboard from scratch with metric / trace / log panels. Make sure to use this skill whenever the user says "create a dashboard for…", "set up monitoring for…", "build me a dashboard…", "I need observability for…", "import a dashboard template", or asks to track / visualize a service, database, cluster, or AI/LLM platform, even if they don't explicitly say "dashboard". Also use it when someone wants to "monitor", "watch", or "see metrics for" a technology and the natural answer is a dashboard.
/signoz:signoz-generating-queriesfrom signoz
signoz@otelyssey is listed by using-system/otelyssey — review the source before installing
npx claudepluginhub using-system/otelyssey --plugin signozOther plugins' skills for the same job