struct telemetry services | List each service with telemetry records in the window, with the age of its newest trace, log and metric (just now, 5m ago, 3h ago, 2d ago, or none). The window uses the records’ own timestamps (when the service produced them), not when Struct received them. Looks back 24 hours; --since <age, date or time> changes that, for example --since 7d (1 minute to 30 days). Exits 1 with no_telemetry when no records fall in the window, so a setup script can wait on it. Any member can run it; it needs observability on for the workspace (observability_not_enabled otherwise). |
struct telemetry usage | Workspace admins only. Show how much telemetry the workspace has sent Struct this calendar month (UTC), in metered bytes (each request’s body after decompression; 1 GB is 1,000,000,000 bytes), with wire bytes, requests and total records (the tables break metered and wire bytes and requests down by signal and encoding; --json prints everything), then the plan, this month’s usage against the included amount (near from 80%, over from 100%; only the free plan includes an amount), any monthly cap an admin set, and whether ingest is blocked, and why. --month YYYY-MM reads an earlier month (up to 24 months back); --since <when> (and --until) a range of up to 92 days. No prices. Exits 1 with telemetry_usage_unavailable or telemetry_usage_busy when usage can’t be read, never zeros; anyone but an admin gets admin_required. |
struct monitors list | List Struct’s own monitors (alert rules on the telemetry your services send to Struct, Alerts in the web app): id, name, state (disabled, silenced or the current state), severity, source (the template, or condition) and threshold. These commands need observability on for the workspace, not Auto Monitors (observability_not_enabled otherwise). |
struct monitors get <id> | Show a monitor’s summary; --json prints its full configuration exactly as Struct returns it (the CLI masks nothing itself). |
struct monitors templates | List the monitor templates with their category, default threshold and a one-sentence description; --json prints the full catalog with each template’s parameter schema. Start a monitor’s JSON from here. |
struct monitors preview --file <path> | Backtest a monitor before saving it, for example “Would have fired 3 times in the last 1h” (12 to 60 live checks at the cadence). The file (- for stdin) is the API’s monitor JSON: camelCase fields, with sourceConfig keeping template_id and params. Monitors saved in the web app are condition monitors ("sourceType": "condition", with the condition document in sourceConfig.condition); their threshold, window and cadence come from that document, so get and chart can show no top-level threshold. A template monitor previews as the condition its preset expands it into; raw_sql fails request validation. A file that is not a JSON object fails with invalid_json and nothing is sent. Query failures exit 1 with query_failed; with --json, the response includes query.error and exits 0. |
struct monitors create --file <path>, struct monitors update <id> --file <path> | Create a monitor from a JSON file, or change one; update changes only the fields in the file. Needs the configure permission. |
struct monitors delete <id> | Delete a monitor; its open alerts are closed and their channels told. Asks first; pass --yes without a terminal. Needs the configure permission. |
struct monitors silence <id>, struct monitors unsilence <id> | Mute a monitor for --for <30m|2h|1d> or --until <ISO 8601 time with a zone> (exactly one), such as 2026-11-01T09:00:00Z, with an optional --reason; or end every active silence now. Dates that do not exist are refused. |
struct monitors firings <id>, struct monitors resolve <monitor-id> <firing-id> | List the alerts a monitor raised, newest first (--limit <1-200>, default 50, and --page <n>); or close an open one now; channels get an all-clear only for an announced alert (--reason <text>). With no answer from Struct, find the firing in struct monitors firings <monitor-id> --json, continuing with --page while hasMore is true; resolved means it was closed. Check before trying again. |
struct monitors chart <id> | Show the monitor’s value over time with its threshold and firings. --window 6h, --bucket 5m. Exits 1 with query_failed when the monitor’s query fails; with --json, prints the response including queryError and exits 0. |
struct notification-groups list / get <id> | CLI 3.1.0 or newer. List notification groups (named sets of Slack channels and webhooks that monitors send to) with how many monitors use each, or show one. --query <text> matches name, description, Slack channel ID or webhook host, ignoring case. Reads mask webhook secrets, header values and URL paths. |
struct notification-groups create | --name <name>, optional --description <text>, one or more --channel <channel> (Slack ID, #name or link), --imessage <email>, --imessage-chat <chat-id> (with optional --investigate), --sms <E.164>, and --repeat <interval> (at least 1m, at least 15m for iMessage, at most 3 reminders), or --file <path> with the group as JSON (needed for webhooks), not both. A group reaches at most 20 receivers. Needs the configure permission. |
struct notification-groups update <id> | Change only what you pass: --name, --description ("" clears it), --add-channel (repeatable; accepts ID, #name or link; --repeat applies to added channels), --remove-channel (repeatable; use the canonical channel ID from get), --add-imessage / --remove-imessage, --sms / --no-sms, or --file <path>. Webhooks are kept unless the file replaces them. Channel flag edits check for concurrent changes automatically. For a file based on an earlier read, include that read’s updatedAt as expectedUpdatedAt; otherwise the file can overwrite changes made since. On group_changed, read the group again and reconcile before retrying. |
struct notification-groups test <id> (upcoming CLI release) | Request a clearly marked [Test] notification for every configured destination in the group (Slack, webhook, iMessage and SMS) and report per-destination ok and error details. Claimed workspaces only; needs the configure permission. Until that CLI release ships, call POST /api/notification-groups/{id}/test or use a disposable monitor. |
struct notification-groups delete <id> | Delete a group no monitor uses. Asks first; pass --yes without a terminal. Attach groups to a monitor with notificationGroupIds in struct monitors update --file; [] removes them all. |
struct telemetry query --document <json> / --file <path> | Run a document in the query language; use exactly one input (- reads stdin). An invalid document exits 1 with query_invalid. Requires CLI 5.0.0 or newer. |
struct telemetry describe <traces|logs|metrics> | List the services, fields and metrics a query can name. --search <words>, --service <name>, --field <name>, --lookback <1h|24h|7d>, --page <n>, --page-size <5-100>. Requires CLI 5.0.0 or newer. |
struct telemetry guide [topic] | Print the language guide, or one worked example such as top_n. Requires CLI 5.0.0 or newer. |
struct telemetry span <trace-id> <span-id> | Read every stored column of a span returned by a telemetry query. --since <when> (default 24 hours, at most 30 days). |
struct telemetry log <id> | Read every stored column of a log, by the id of a raw logs row. --at <timestamp> (the row’s timestamp) reads only the 2 seconds around it, at any age; otherwise --since <when> (default 1 hour). Requires CLI 6.0.0 or newer. |