Tell your agent what would count as a problem. It can suggest a threshold based on available data and ask you to decide before enabling notifications.
Native monitors evaluate the traces, logs and metrics you instrument with Struct. Use Use the service name returned by the first command. Check for an existing monitor before creating another: Inspect the returned query result and any Keep the returned monitor ID. Substitute it for Check the configuration, chart values and any
struct monitors to configure them. Auto Monitors, configured with struct automonitors, uses pull requests and deploys to manage monitors.You need telemetry arriving in the workspace and permission to configure monitors. A temporary login from struct init can do this while its workspace is active; observability and workspace activation must also be enabled.1. Choose a signal
create is not an update. Use struct telemetry guide [topic] for worked condition documents you can adapt directly:heartbeat— detect silent or stopped services (aggregation: "count()"withop: "<", value: 1; an empty count evaluates to0, so silence reliably fires without depending onnoDataBehavior).freshness— alert when a periodic job has not succeeded recently (combinesmax(timestamp)withcount() < 1).observation_health— alert when a configured Observation fails to bind or poll on any running SDK stream (setnoDataBehavior: "ignore").slo_burn,anomaly,time_to_full,shift,each_new_row,per_entity,presentation.
< floor or heartbeat monitor, or it will fire immediately on the empty history before capture began.2. Define and preview the monitor
This example measures the 95th percentile of span duration forcheckout-api over five minutes, evaluated every minute. Replace the service name and the illustrative 1,000 ms threshold with values appropriate for your application. It covers all spans for that service; add to the query’s filter (for example AND span.name = 'POST /checkout') if you want one operation. Monitors are written as conditions in the query language; they hold no SQL.Save as monitor.json:query.error. With --json, preview can return an error in the document while the command exits successfully. If the filter matches no recent spans, exercise the service or correct the filter before continuing. Preview is a historical calculation, not evidence that a scheduled evaluation or notification has happened.3. Save and inspect
MONITOR_ID below:queryError. A firing is recorded only when the condition is met; an empty firing history is not proof that it evaluated successfully. Allow for the evaluation cadence and use a controlled test workload if you need to prove a threshold crossing. Record what happened rather than lowering a production threshold just to make an alert.This example has no delivery destinations and does not send Slack or email. An unclaimed workspace also blocks outbound notifications and background AI. After claim, configure the desired destination separately and verify delivery before calling alert routing complete.Update or remove
Usestruct monitors update MONITOR_ID --file changes.json to change only the fields in that file. Before retrying a create after a lost response, inspect struct monitors list --json to avoid duplicates. Delete a disposable test monitor with struct monitors delete MONITOR_ID --yes when it is no longer needed; this also closes its open firings.An unclaimed workspace permits ten non-deleted monitors, including disabled ones. workspace_paused means a person must claim the workspace before queries, previews or new configuration changes can continue. Existing configuration and firing history remain readable.