Skip to main content
Give your coding or on-call agent the prompt below. Your agent will inspect your stack, propose a tailored setup plan from what Struct supports, set up instrumentation, Observations, tuned monitors and alert delivery, verify every layer end to end, and ask you only when approval, credentials or a product decision is needed.

Claim your workspace

If your agent created a new workspace, it will give you a claim link and code. Sign in, check the workspace name and claim it. If you already use a workspace, approve its sign-in link instead.

What to do next

Lead this observability setup end to end. Do not wait for the person to tell you every step or guess what Struct supports. Inspect their codebase, infrastructure and existing telemetry first, recommend a tailored plan based on their stack, execute everything your access allows, verify every layer independently, and ask the person only for approvals, credentials or explicit choices.You can also read these guides offline with struct quickstart and struct docs [topic] once the upcoming CLI release ships; until then, read the canonical .md exports on docs.struct.ai (for example https://docs.struct.ai/quickstart.md).

What Struct supports (tailor your plan from this)

Use this menu when proposing a setup plan to the person:

Phase 0 — Pre-flight discovery and tailored onboarding plan

Before writing code, creating a workspace or editing live infrastructure:
  1. Install or update the Struct CLI:
  1. Inspect the repository and deployment config:
    • Identify services, languages, entrypoints and frameworks (web APIs, workers, scheduled jobs, AI agents).
    • Check whether struct-sdk, @struct-ai/sdk, OpenTelemetry or ddtrace is already wired. Never open a duplicate instrumentation PR when the SDK is already installed and only needs configuration or keys.
    • Check deployment templates / IaC (Azure Container Apps Bicep/YAML, Kubernetes manifests, Terraform, GitHub Actions, Docker Compose) for existing STRUCT_* or OTEL_* variables and secret references. Changes made only to a running cloud service get overwritten on the next deploy unless they also land in the deploy template.
  2. Check existing Struct CLI state:
  • Reuse an existing login when it matches the requested workspace. Ask the person only when the target workspace is ambiguous.
  • A STRUCT_TOKEN environment variable overrides saved logins; switching profiles does not override it.
  • If you target a non-default server, set STRUCT_API_URL explicitly in every non-interactive shell/subshell (shell profile variables often do not load in non-interactive shells) and pair it with STRUCT_INGEST_URL in the application runtime.
  1. Present a concise, tailored plan and confirm choices once:
    • Summarize what you found in their stack (services, existing SDK/OTel wiring, deploy mechanism).
    • Propose the concrete setup steps for their stack: base telemetry, initial Observations on key code paths, starter monitors, alert channels and suggested recurring cadences.
    • Ask the person for any choices up front (which alert channels they want — Slack channel, webhook, SMS, iMessage — and whether to reuse an existing workspace or create a new one).

Phase 1 — Workspace setup and claim strategy

Both columns below assume workspace activation and the required permissions and feature access. If a command returns account_not_activated, relay its activation instructions and bookingUrl to the person; claiming or signing in does not activate the workspace. Batch the available work and interrupt the person at most once for claiming:
  • Existing workspace: sign in with struct login --device --admin --json (an admin must approve --admin for key management).
  • New workspace: run struct init --name "My application" --no-wait --json. The temporary credential is saved locally; do not read or copy it into the repository. Repeat struct init to resume; pass --new only when deliberately creating another workspace.
  • If struct init returns agent_signup_unavailable, send the person to app.struct.ai to create or join a workspace, then run struct login --device --admin --json.
  • If the person wants Observations, Slack or cloud connections right away, claim early (struct init --no-browser --json, relaying url and userCode immediately from the waiting_for_human JSON line). Otherwise, finish Phase 2 and initial monitor previews first, then claim once before Phases 3 and 6.

Phase 2 — Instrument, deploy/restart and verify base telemetry

Follow Instrument with Struct to create an ingest key (STRUCT_INGEST_KEY="$(struct keys ingest create --name <service>)") and wire the SDK or OTLP exporter.Critical deployment checks:
  • Keep keys out of source control and chat transcripts. Store them in the secret manager referenced by the deployment template.
  • Saved is not running: updating a secret or env var on platforms such as Azure Container Apps, Kubernetes or ECS does not take effect until the service rolls out or restarts. Trigger or confirm a rollout before expecting telemetry.
  • Set a clear service_name (OTEL_SERVICE_NAME) and environment (deployment.environment.name, e.g., production or staging; the Python SDK defaults to development if unset).
Verify real base telemetry arrived:
Confirm the expected service names, timestamps and signals. A 202 from ingest or a saved secret is not proof of queryable telemetry; traces alone do not prove logs or metrics arrived.

Phase 3 — Observations first: add signals and self-confirm

For Python services running struct-sdk (a signed pk- ingest key from struct keys ingest create reads Observation configuration for every service and environment by default, or only the --grant <service:environment> pairs you scope it to), publish targeted Observations before finalizing your monitors so alerts can watch business-critical outcomes, exceptions and internal latency — not only coarse HTTP status codes.
  1. Read the codebase to pick 3–5 high-value code paths (webhook/request handlers, worker job dispatch, external API calls, billing/auth checks, error handlers). Read the exact module path, symbol name and parameter names; never guess them.
  2. Author valid SIL using SIL reference (or struct observations guide [topic] in the upcoming CLI release: event_on_return, failure_event, paired_events, span_with_duration, conditional_metric, async_after_await). Prefer events or spans before metrics for monitors because monitors over events/spans can be created before the first sample arrives.
  3. Validate, draft, diff and publish:
  1. Self-confirm Observations end to end (do not stop at status: ready):
struct observations status reports only whether Struct built the downloadable artifact (ready). struct observations verify (or direct struct telemetry query checks against struct.observations.health and struct.observation.id until that CLI release ships) checks all three layers separately:
  • artifactReady — control-plane artifact built for headRevision.
  • processHealthIssues / healthIssues — active unresolved struct.observations.health errors from running SDKs (for example incompatible, target_pending, configuration_forbidden).
  • status per observation — delivering (real captured traces/logs or declared metricsSeen arrived, excluding health events), unhealthy, no_data_yet, artifact_pending or stopped.
If an observation reports unhealthy, inspect its reason and code, fix the SIL target/reads (for example, missing parameter names or unsupported interior points), republish and re-verify. After updating an existing observation with setVersions, confirm the changed definition itself is capturing (query for the updated event/span name, changed attributes, or new metric samples after publication — historical counts and fresh lastSeenAt timestamps do not distinguish versions).

Short-lived Observations for triage and investigation (overlays)

When triaging an active alert, chasing a flaky failure, or investigating a production incident where existing traces and logs do not show the internal arguments, locals, return values, or exception details you need, create a short-lived overlay Observation instead of editing permanent baseline captures or shipping debug logging PRs:
  • Use "target": {"kind": "overlay", "id": "triage-<issue>"} with "completion": {"expiresAfterSeconds": 1800} (for example 15–60 minutes) and "expectedTargetRevision": 0.
  • Overlays auto-expire automatically on the SDK’s clock even if your session ends, so temporary debug captures never linger in production.
  • Once root cause is confirmed, end the overlay early with an endOverlay draft (or promote any useful long-term signal into the permanent baseline). See Short-lived Observations for triage.

Phase 4 — Clean up noisy signals

Keep telemetry focused and within budget from the start:
Run top-N queries (struct telemetry guide top_n) grouped by service.name, span.name or log.event_name to spot noisy healthchecks, chatty logs or over-firing Observations. Clean them up by:
  • Adding when filters to SIL definitions so Observations emit only meaningful outcomes or errors.
  • Excluding noisy routes/instrumentors via instrumentation_options or OTEL_PYTHON_DISABLED_INSTRUMENTATIONS.
  • Stopping noisy or obsolete baseline Observations cleanly:

Phase 5 — Write, backtest and tune monitors

Use struct telemetry guide (especially heartbeat, freshness, slo_burn, anomaly, observation_health and observation_health_reports) and Create a monitor to build a balanced starter suite over both base telemetry and your published Observations:
  1. Request / job error rate (with a having volume floor so low-traffic blips do not page).
  2. p95 latency on critical routes or worker steps.
  3. Error-log spike (severity_number >= 17).
  4. Silent-service heartbeat — use the heartbeat pattern (aggregation: "count()" with detect: {"kind": "threshold", "on": "A", "op": "<", "value": 1}) so an empty count reads 0 and reliably fires when a service stops reporting. (Wait until a brand-new signal has reported at least one full window before creating a < floor monitor.)
  5. Observation health — use the observation_health preset or pattern (struct telemetry guide observation_health) so broken Observation bindings or SDK config failures surface immediately.
Mandatory backtest before every save:
Inspect both query.error and historical firing count. Tune thresholds so every monitor stays quiet on healthy traffic before calling struct monitors create --file monitor.json --json.Tune noisy or flapping monitors: inspect struct monitors firings --all --since 24h --json and struct monitors chart <id> --window 6h --bucket 5m --json. Exclude known non-actionable failures, add having volume floors, or adjust thresholds / forSeconds with struct monitors update <id> --file changes.json --json.

Phase 6 — Claim, connect alert channels and prove delivery

If the workspace is still unclaimed, ask the person once to claim it:
Relay url and userCode immediately when status: "waiting_for_human" prints. After claimed: true, connect the requested destinations (for example struct connect slack, struct connect github or cloud providers via struct connections catalog).Create or reuse a notification group (Slack accepts #channel, Slack links or channel IDs; you can also configure webhooks, iMessage and verified SMS numbers):
Attach the group to your monitors via notificationGroupIds in struct monitors update <id> --file groups.json --json, then prove delivery end to end (upcoming CLI release; until then, verify with a controlled disposable monitor):
Confirm ok: true for every receiver in results, then confirm the actual test notification arrived at each destination before calling alert routing complete. For iMessage, ok: true means the alert was handed to the teammate; for SMS, it means the provider accepted the message. If any destination fails (for example, the Struct bot has not been invited to a private Slack channel, or an SMS number is not verified), fix it and re-run test until every configured destination passes.

Phase 7 — Proactively propose ongoing operating cadences

Do not stop at one-time setup. At the end of onboarding, propose concrete recurring operating cadences tailored to the team’s stack for the person to approve and enable (either via struct automations create or their own agent scheduler):
  1. Hourly health and alert pulse — inspect struct monitors firings --open --json and the team’s alert channel; triage real unhandled alerts (spinning up short-lived, auto-expiring overlay Observations for 15–30 minutes when live function inputs, locals, or exception details are needed to confirm root cause, then ending them cleanly), detect silent services, and tune noisy or flapping monitors. Stay silent when everything is healthy.
  2. Nightly (or post-deploy) coverage and Observation update — inspect struct deploys list and newly merged code; add Observations for new critical paths, self-confirm them with struct observations verify, add or re-tune monitors as traffic baselines mature, and flag deploys that alter telemetry wiring.
  3. Weekly signal and cost hygiene — inspect struct telemetry usage --json and high-volume signals; prune noisy Observations/logs and review monitor signal-to-noise ratio.

5-stage verification checklist (report each separately)

Never conflate an earlier stage with a later one in your final report:
  1. Configured & deployed: workspace ID, changed files / deploy template updates, and confirmed process rollout/restart.
  2. Base telemetry arriving: services, signals (traces, logs, metrics) and recency from struct telemetry services.
  3. Observations delivering: scope IDs, published revision, struct observations verify counts (delivering / unhealthy / no_data_yet), and any active health issues.
  4. Monitors backtested & saved: monitor IDs, preview results (quiet on normal traffic), and chart/evaluation health (queryError: null).
  5. Alert delivery proved & cadences proposed: notification group ID, struct notification-groups test per-destination results, and the proposed ongoing cadences awaiting approval.

Reuse the observability skill

When a persistent agent works in Slack, give it its own stable Slack app identity. Verify that its posts and replies use the same app across sessions before turning on delivery. Download the Struct observability skill for onboarding a service, investigating alerts with temporary Observations, covering merged pull requests, and reviewing observability health. Give the agent the workspace, service, environment, and permissions for each job.
  • In an Agent Skills-compatible repository, extract skills/struct-observability/ into .agents/skills/.
  • In Devin, upload the ZIP under Customize → Plugins → Add plugin → Upload .zip. Choose organization scope to share it across sessions and invoke @skills:struct-observability. Devin plugins
  • In Grok Bot, give the bot the extracted skills/struct-observability/SKILL.md and ask it to save the file as a skill named struct-observability. Call the skill by name from a chat or routine. Grok Bot skills
  • In Capy, connect Struct and Slack and save the skill in the project. The guide includes prompts for the connection check, alert investigation, and merged-PR coverage.

Devin quickstart

  1. Confirm the Devin organization that handles your Slack channels and install the skill there. For a persistent Devin Bot, configure the app under the Bot’s Settings → Slack. For an Oncall responder, choose the service identity for Devin’s Slack app under Run as. Invite the selected app to the channels it will use. Devin Bot Slack setup · Responder settings
  2. Add Struct as a custom HTTP MCP in Customize → MCPs. Get the endpoint with struct mcp url, complete sign-in for the intended workspace, and select the connector in the session or responder. Have a fresh session read a known monitor and its firings. Connect Struct MCP
  3. For shell workflows, use an organization blueprint to put the Struct CLI in the cloud snapshot. If the setup shell uses nvm, load its Node runtime and make the installed command available to new shells. Build the snapshot and verify struct --version and struct --help in a fresh session. Use device login when the CLI needs its own workspace access.
  4. Complete Devin Oncall setup, then create an Alerts responder for your alert channel. In its runbook, load struct-observability and select Investigate an alert. Verify that one controlled firing starts an investigation and Devin replies as its Slack app. To audit new coverage, have a scheduled session select deployed PRs and use Cover a merged PR.