Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
m1heng avatar

Signoz Cli

  • 5 installs
  • Updated June 2, 2026
  • m1heng/just-cli-it

Helps with ai & agent building tasks.

About

signoz-cli is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted development.

  • signoz-cli
  • AI & Agent Building
  • AI-coding skill

Signoz Cli by the numbers

  • 5 all-time installs (skills.sh)
  • Ranked #13,035 of 16,556 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 2, 2026 (Skillselion catalog sync)
npx skills add https://github.com/m1heng/just-cli-it --skill signoz-cli

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs5
Last updatedJune 2, 2026
Repositorym1heng/just-cli-it

What it does

Helps with ai & agent building tasks.

Files

SKILL.mdMarkdownGitHub ↗

signoz CLI

Query traces, logs, and metrics from SigNoz directly in your terminal.

Install

npm i -g @jcit/signoz

Authentication

Credentials are resolved in this order: CLI flag → environment variable → system keychain → default.

Option 1: System keychain (recommended)

signoz auth login
# Interactive prompts for URL and token

signoz auth login --url https://signoz.example.com --token sk-xxx
# Non-interactive

Credentials are stored securely in macOS Keychain (security) or Linux libsecret (secret-tool).

Option 2: Environment variables

export SIGNOZ_URL=https://signoz.example.com
export SIGNOZ_TOKEN=sk-xxx

Option 3: Per-command flags

Every command accepts --url and --token to override credentials for that invocation.

signoz query --url https://signoz.example.com --token sk-xxx --promql 'up'

Logout

signoz auth logout

Commands

query — Unified query API

Query traces, logs, and metrics. Supports three input modes (mutually exclusive):

FlagDescription
--promql <expr>PromQL expression
--sql <query>ClickHouse SQL query (must include timestamp WHERE clause — see below)
-f, --file <path>Load full query_range JSON body from file

Time range, output, and auth options:

FlagDefaultDescription
--since <time>1hStart time — duration ago (1h, 30m, 7d) or ISO date
--until <time>nowEnd time — now, duration ago, or ISO date
--step <seconds>60Step interval in seconds (PromQL only, must be a positive number)
--format <format>jsonOutput: json, table, or text
--url <url>SigNoz API base URL override
--token <token>SigNoz API token override
Duration = "ago": --since 1h means "1 hour ago". --until 1d means "1 day ago" (not "for 1 day"). So --since 7d --until 1d queries from 7 days ago to 1 day ago.
`--since`/`--until` only affect PromQL and file mode. For --sql, you must write your own timestamp WHERE clause in the SQL — the start/end values are set in the request body but SigNoz does not auto-inject time filters into raw ClickHouse SQL.
PromQL examples
# Request rate over the last hour
signoz query --promql 'rate(http_requests_total[5m])' --since 1h

# Table output for quick scan
signoz query --promql 'up' --format table

# From a specific start date to now
signoz query --promql 'process_cpu_seconds_total' --since 2024-01-15T00:00:00Z
ClickHouse SQL examples
# Count logs from the last 24 hours (note: timestamp filter is IN the SQL)
signoz query --sql "
  SELECT toStartOfInterval(fromUnixTimestamp64Nano(timestamp), INTERVAL 1 HOUR) AS ts,
         count(*) AS value
  FROM signoz_logs.distributed_logs_v2
  WHERE timestamp >= $(date -d '24 hours ago' +%s)000000000
    AND timestamp <= $(date +%s)000000000
  GROUP BY ts ORDER BY ts
"

# Load a saved query from file with custom time range
signoz query -f my-query.json --since 7d --until 1d
File format for -f

The JSON file should follow the SigNoz v5 query_range body format. The start and end fields are overridden by --since/--until:

{
  "requestType": "time_series",
  "compositeQuery": {
    "queries": [
      {
        "type": "promql",
        "spec": { "name": "A", "query": "rate(http_requests_total[5m])", "step": 60, "disabled": false }
      }
    ]
  }
}

alerts — List alert rules

signoz alerts                  # Human-readable text output
signoz alerts --format json    # Machine-readable JSON
signoz alerts --url https://signoz.example.com --token sk-xxx

services — List services

signoz services                # Human-readable text output
signoz services --format json  # Machine-readable JSON

API Endpoints

The CLI talks to these SigNoz API endpoints:

CommandMethodEndpoint
queryPOST/api/v5/query_range
alertsGET/api/v1/rules
servicesGET/api/v1/services/list

Default base URL: http://localhost:3301 (SigNoz local dev).

Auth Header

SigNoz uses a custom auth header SIGNOZ-API-KEY (not Authorization: Bearer). This is handled automatically by the CLI.

Duration Format

Relative durations for --since and --until always mean "X ago from now":

UnitExampleMeaning
s30s30 seconds ago
m15m15 minutes ago
h2h2 hours ago
d7d7 days ago

ISO 8601 dates are also accepted: 2024-01-15T00:00:00Z.

ClickHouse SQL Reference for SigNoz

This section documents SigNoz-specific ClickHouse SQL conventions that differ from standard SQL. You must follow these conventions when using `--sql`.

Tables and Timestamp Formats

Each signal type uses different tables and timestamp formats:

SignalDatabase.TableTimestamp ColumnFormatFilter Example
Logssignoz_logs.distributed_logs_v2timestampUInt64 nanosecondstimestamp >= 1711234567000000000
Tracessignoz_traces.distributed_signoz_index_v3timestampDateTime64(9), must quotetimestamp >= '1711234567000000000'
Metricssignoz_metrics.distributed_samples_v4unix_milliInt64 millisecondsunix_milli >= 1711234567000
Always use distributed_* tables (not local tables like logs_v2 or signoz_index_v3).

Required: ts_bucket_start Filter (Logs & Traces)

Logs and Traces tables have ts_bucket_start (UInt64, epoch seconds) in their primary key. Always include it for query performance — without it, queries may be extremely slow or time out.

WHERE timestamp >= {startNano} AND timestamp <= {endNano}
  AND ts_bucket_start >= {startSeconds - 1800} AND ts_bucket_start <= {endSeconds}

The -1800 (30 min) buffer on ts_bucket_start ensures edge-case rows aren't missed.

Result Column Naming Convention

SigNoz expects specific column names in ClickHouse SQL results:

ColumnRequirement
TimeMust be named `ts`, type DateTime/DateTime64
ValueNamed value, __result, __value, result, or res (auto-detected if only one numeric column)
LabelsAll String columns become series labels (used for groupBy)

Complete Query Templates

Logs — Count by severity (last 1 hour)
SELECT toStartOfInterval(fromUnixTimestamp64Nano(timestamp), INTERVAL 1 MINUTE) AS ts,
       severity_text,
       count(*) AS value
FROM signoz_logs.distributed_logs_v2
WHERE timestamp >= {startNano} AND timestamp <= {endNano}
  AND ts_bucket_start >= {startSec - 1800} AND ts_bucket_start <= {endSec}
GROUP BY ts, severity_text
ORDER BY ts

Key log columns: severity_text (INFO/ERROR/...), severity_number, body (message), trace_id, span_id, scope_name.

Traces — P99 latency by service (last 1 hour)
SELECT toStartOfInterval(timestamp, INTERVAL 1 MINUTE) AS ts,
       resource_string_service$$name AS service,
       quantile(0.99)(duration_nano) / 1e6 AS value
FROM signoz_traces.distributed_signoz_index_v3
WHERE timestamp >= '{startNano}' AND timestamp <= '{endNano}'
  AND ts_bucket_start >= {startSec - 1800} AND ts_bucket_start <= {endSec}
GROUP BY ts, service
ORDER BY ts

Key trace columns: name (span name), kind_string, duration_nano (Float64, nanoseconds), status_code (0=unset, 1=ok, 2=error), has_error (Bool), resource_string_service$$name (service name — note $$ encodes .).

Metrics — Average metric value (last 1 hour)
SELECT toStartOfInterval(toDateTime(intDiv(unix_milli, 1000)), INTERVAL 1 MINUTE) AS ts,
       avg(value) AS value
FROM signoz_metrics.distributed_samples_v4
WHERE metric_name = 'http_requests_total'
  AND unix_milli >= {startMs} AND unix_milli < {endMs}
GROUP BY ts
ORDER BY ts

Attribute Access (Map Columns)

Non-materialized attributes are stored in Map columns, not regular columns:

-- String attributes
attributes_string['http.method']
resources_string['service.name']
scope_string['otel.library.name']

-- Numeric / Boolean attributes
attributes_number['http.status_code']
attributes_bool['error']

-- Check existence
mapContains(attributes_string, 'http.method')
`$$` encoding: Materialized columns encode . as $$. For example, service.nameresource_string_service$$name. Use materialized columns when available for better performance.

Additional Tables

DatabaseTablePurpose
signoz_logsdistributed_logs_v2_resourceLog resource attributes (join via resource_fingerprint)
signoz_tracesdistributed_traces_v3_resourceTrace resource attributes
signoz_tracesdistributed_top_level_operationsTop-level operation lookup
signoz_metricsdistributed_time_series_v4Metric time series metadata
signoz_metricsdistributed_samples_v4_agg_5m5-minute pre-aggregated metrics
signoz_metricsdistributed_samples_v4_agg_30m30-minute pre-aggregated metrics

Use GLOBAL IN (not IN) when joining with resource tables in distributed queries.

Troubleshooting

ErrorFix
"No API token configured"Run signoz auth login or set SIGNOZ_TOKEN
Connection refusedCheck that SigNoz is running at the configured URL
401 UnauthorizedVerify your API token is valid
Query timeoutAdd ts_bucket_start filter to your SQL WHERE clause
Empty results with --sqlEnsure your SQL has timestamp WHERE clause — --since/--until don't filter SQL
invalid --step value--step must be a positive number in seconds (e.g., 60, not 1m)

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.