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
- Observations — add targeted spans, events and metrics to running Python services without redeploying.
- Create a monitor — backtest and tune alerts over traces, logs, metrics and Observations.
- Connect Slack or configure notification groups — route and test alert delivery.
- Set up Struct Agent — add ongoing alert triage, investigations and PR fixes.
- Prepare a persistent agent for Slack with the portable observability skill and its own bot identity.
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 Confirm the expected service names, timestamps and signals. A Run top-N queries (Inspect both Relay Attach the group to your monitors via Confirm
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:- Install or update the Struct CLI:
- 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 orddtraceis 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_*orOTEL_*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.
- 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_TOKENenvironment variable overrides saved logins; switching profiles does not override it. - If you target a non-default server, set
STRUCT_API_URLexplicitly in every non-interactive shell/subshell (shell profile variables often do not load in non-interactive shells) and pair it withSTRUCT_INGEST_URLin the application runtime.
- 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 returnsaccount_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--adminfor 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. Repeatstruct initto resume; pass--newonly when deliberately creating another workspace. - If
struct initreturnsagent_signup_unavailable, send the person to app.struct.ai to create or join a workspace, then runstruct login --device --admin --json. - If the person wants Observations, Slack or cloud connections right away, claim early (
struct init --no-browser --json, relayingurlanduserCodeimmediately from thewaiting_for_humanJSON 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) andenvironment(deployment.environment.name, e.g.,productionorstaging; the Python SDK defaults todevelopmentif unset).
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 runningstruct-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.- 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.
- 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. - Validate, draft, diff and publish:
- 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 forheadRevision.processHealthIssues/healthIssues— active unresolvedstruct.observations.healtherrors from running SDKs (for exampleincompatible,target_pending,configuration_forbidden).statusper observation —delivering(real captured traces/logs or declaredmetricsSeenarrived, excluding health events),unhealthy,no_data_yet,artifact_pendingorstopped.
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
endOverlaydraft (or promote any useful long-term signal into the permanentbaseline). See Short-lived Observations for triage.
Phase 4 — Clean up noisy signals
Keep telemetry focused and within budget from the start: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
whenfilters to SIL definitions so Observations emit only meaningful outcomes or errors. - Excluding noisy routes/instrumentors via
instrumentation_optionsorOTEL_PYTHON_DISABLED_INSTRUMENTATIONS. - Stopping noisy or obsolete baseline Observations cleanly:
Phase 5 — Write, backtest and tune monitors
Usestruct 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:- Request / job error rate (with a
havingvolume floor so low-traffic blips do not page). - p95 latency on critical routes or worker steps.
- Error-log spike (
severity_number >= 17). - Silent-service heartbeat — use the
heartbeatpattern (aggregation: "count()"withdetect: {"kind": "threshold", "on": "A", "op": "<", "value": 1}) so an empty count reads0and reliably fires when a service stops reporting. (Wait until a brand-new signal has reported at least one full window before creating a< floormonitor.) - Observation health — use the
observation_healthpreset or pattern (struct telemetry guide observation_health) so broken Observation bindings or SDK config failures surface immediately.
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: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):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):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 viastruct automations create or their own agent scheduler):- Hourly health and alert pulse — inspect
struct monitors firings --open --jsonand 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. - Nightly (or post-deploy) coverage and Observation update — inspect
struct deploys listand newly merged code; add Observations for new critical paths, self-confirm them withstruct observations verify, add or re-tune monitors as traffic baselines mature, and flag deploys that alter telemetry wiring. - Weekly signal and cost hygiene — inspect
struct telemetry usage --jsonand 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:- Configured & deployed: workspace ID, changed files / deploy template updates, and confirmed process rollout/restart.
- Base telemetry arriving: services, signals (
traces,logs,metrics) and recency fromstruct telemetry services. - Observations delivering: scope IDs, published revision,
struct observations verifycounts (delivering/unhealthy/no_data_yet), and any active health issues. - Monitors backtested & saved: monitor IDs, preview results (quiet on normal traffic), and chart/evaluation health (
queryError: null). - Alert delivery proved & cadences proposed: notification group ID,
struct notification-groups testper-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.mdand ask it to save the file as a skill namedstruct-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
- 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
- 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 - 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 --versionandstruct --helpin a fresh session. Use device login when the CLI needs its own workspace access. - Complete Devin Oncall setup, then create an Alerts responder for your alert channel. In its runbook, load
struct-observabilityand 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.