AWS Observability
AWSOfficialPublished by AWS
- Skill
- Tool integration
- Cloud and DevOps
- Apache-2.0
- Low risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides comprehensive domain expertise for AWS observability, covering both classic CloudWatch and CloudWatch Omni. It assists users in investigating service health, querying logs and traces, configuring alerts, and managing dashboards. The skill is designed to help operators distinguish between the two services, navigate their respective APIs, and perform advanced tasks like agent quality evaluation and context graph analysis. It does not handle initial service setup or onboarding, which are managed by a separate dedicated skill.
What it does
- Investigates root causes using Omni context graphs and intelligence insights.
- Queries logs, traces, and metrics using SQL, PromQL, and Log Insights.
- Configures and tunes alerts, dashboards, and alarms for both CloudWatch and Omni.
- Evaluates AI agent quality through trace scoring and online evaluation.
- Provides methodology for service-health investigations and dependency analysis.
- Supports programmatic access via AWS CLI, SDKs, and CloudFormation.
When to use it
- When you need to investigate a service performance issue or root cause.
- When you need to write or debug queries for logs, traces, or metrics.
- When you need to create or update alerts and dashboards in CloudWatch or Omni.
- When you need to evaluate the quality of an AI agent using trace telemetry.
- When you need to understand service dependencies and blast radius.
Advantages
- Provides clear routing between CloudWatch and Omni based on service signals.
- Offers structured methodologies for complex observability tasks.
- Includes specific checklists to ensure all required configuration facts are surfaced.
- Maintains a strict scope to ensure accurate and relevant technical guidance.
- Supports advanced observability features like dynamic instrumentation and agent evaluation.
Usage examples
- “Why is my service experiencing high latency?”
- The agent will guide you through a service-health investigation, starting with relevant telemetry signals and checking for configuration issues like timeouts.
- “Create an Omni alert for high error rates.”
- The agent will provide the necessary authoring guidance, ask for your specific threshold and evaluation period, and confirm the configuration before proceeding.
- “How do I query my traces in Omni?”
- The agent will explain the SQL syntax for traces.default and provide the necessary fields to identify slow or failed spans.
- “Evaluate the quality of my AI agent's recent sessions.”
- The agent will help you select an appropriate evaluator and guide you through the process of scoring traces to assess agent performance.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/aws/aws-observability/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip aws-observability.zip -d .agents/skills
Documentation by AWS
AWS Observability
Overview
Domain expertise for AWS observability across metrics, logs, and traces, for two products that share the CloudWatch name but are separate services with separate control planes, data models, and APIs:
| CloudWatch | CloudWatch Omni | |
|---|---|---|
| What it is | Log groups, metric namespaces, alarms, Log Insights, X-Ray, Application Signals | Application Observability / Agent Observability. A Space per account per Region is the access boundary over the account's CloudWatch Dataset (OpenTelemetry logs, traces, and metrics); the Dataset is a CloudWatch resource the Space reads, not something the Space contains |
| Control plane | aws cloudwatch, aws logs, aws xray, aws application-signals | aws cloudwatchomni (endpoint prefix cloudwatch-omni, signing name cloudwatch) |
| Query | Log Insights query language; GetMetricData | SQL over logs.default / traces.default; PromQL over metrics; named views |
| Notify | Alarms (metric, composite, anomaly) | Alerts (SQL/PromQL rule, contributors, OK/WARNING/CRITICAL/NODATA) |
| Topology | Application Signals service map | Context graph (GetContextGraph) |
| Access | IAM only | Domain → Space → access grants and access profiles (set up in setting-up-cloudwatch-observability) |
| Only here | Dynamic Instrumentation, Synthetics canaries, CloudTrail auditing, EMF | Agent-quality evaluation, views, context graph |
| First-time setup | Application Signals onboarding — ADOT auto-instrumentation, the amazon-cloudwatch-observability add-on, ServiceEvents, CI/CD metadata | Domain → Space → grants → telemetry in → plain-ADOT instrumentation |
| References | references/cloudwatch/ | references/cloudwatch-omni/ |
This skill covers using both products, never setting either one up. Both first-time
setup paths above live in setting-up-cloudwatch-observability (same two-folder split);
route there rather than describing an onboarding procedure from memory.
Enabling Omni does not replace CloudWatch; log groups, metrics, and alarms keep working, and most customers use both.
Works best with the AWS MCP server — enables running CLI commands, querying CloudWatch, and validating configurations directly. All guidance also works with standard AWS CLI access.
Note: Reference files contain specific runtime versions, quota values, and feature matrices that may change. When precision matters (e.g. deploying to production, choosing a runtime, or checking a quota), confirm values against current AWS documentation rather than relying solely on the values in these files.
Scope guard — is this an observability request?
This skill owns the scope decision for every request routed to it, and this section is its sole home.
If a request is NOT about AWS observability with CloudWatch or CloudWatch Omni (weather, trivia, general chit-chat, non-observability coding), decline it in one sentence: state plainly that it is out of scope, never fabricate an answer, and never claim a false capability limitation (no "no internet access", no "no weather data") — the reason is simply that it is out of scope. Then redirect by naming what this skill does cover: querying CloudWatch and CloudWatch Omni logs, traces, and metrics, building dashboards, configuring alerts, investigating a service, or agent evaluation.
Do not attempt the off-topic task, and do not call a tool or run a query in pursuit of it. Keep it brief: no lecture, no long refusal.
Step 0 — CloudWatch or CloudWatch Omni?
Decide this before routing. The natural wording ("set up an alert for high latency", "build a dashboard", "query my logs") does not say which product the customer means.
The customer names the product — "Omni", "Application Observability", "Agent Observability", a Space, Domain, Dataset, access grant,
spaceId,cloudwatch-omni, Omni SQL, PromQL, views, context graph, evaluators, agent evaluation / scoring traces / online or continuous evaluation /gen_ai.evaluation, and OTel span vocabulary (traces.default,logs.default, spans,durationNano,status.code, resource attributes,service.name) → Omni. "Log Insights", "log group", "metric namespace", "CloudWatch alarm", "metric alarm", "composite alarm", "anomaly alarm", "X-Ray", "Application Signals", "canary", "CloudTrail", "Dynamic Instrumentation" → CloudWatch. A "log group" named inside an agent-evaluation request is the online-evaluation data source to verify, not a CloudWatch signal. A bare "alarm" (or "alert") with no other product signal is ambiguous — fall through to rule 3 and probe: a Space → Omni alert (alerts.md); no Space → CloudWatch alarm (cloudwatch/alarms.md). Exception: a "PromQL alarm" is a CloudWatch alarm on OTel metrics (cloudwatch/alarms.md) — "alarm" wins over "PromQL".Knowledge or how-to question ("what is an Omni alert", "does Omni have an API", "how do alerts differ from alarms") → answer from the reference files directly. Do not probe the account, and do not divert to the other product. Whether a capability exists is a fact about the product, not the account. concepts.md carries the full feature-equivalence matrix. 2a. Authoring / how-to alert request — "create / set up / write an Omni alert that fires when X", "how should I alert on Y" — with no Space or Region supplied and no go-ahead to actually create it, is a HOW-TO request. Deliver the authoring guidance (the alert row of "Must-state checklists" below, then alerts.md) FIRST, from the reference files. Do NOT stall on a Region/Space clarifying question and do NOT fall back to a CloudWatch alarm for a request that explicitly says "Omni alert". Probe the account only once the user supplies a Space/Region or asks you to create it. 2b. A telemetry object is already in the prompt — the user pastes, or the UI passes as context, a span, trace, log record, or query result and asks what it means, what errors it has, or how long it took. This is not a live-data request: do not probe the account, run a query, or ask the user to fetch it again. Read it in place per the "Reading a span or trace you already have" section of query/sql-logs-traces.md and state every item in its must-state list. 2c. A query request whose live result is empty or unreachable ("show me the slowest spans", "which traces failed") is still answered with the methodology — the exact query and the field rules that make it correct (see the must-state callouts in query/sql-logs-traces.md). Zero rows, a wrong-Region Space, or an unreachable endpoint is reported as a finding alongside the query, never as the whole answer.
Request that must act on live data, and the wording is ambiguous (not a Step 0.5 content question, which is answered from the catalog) → probe the target Region first:
aws cloudwatchomni list-domains aws cloudwatchomni list-spaces --region <target-region> --query "items[?region=='<target-region>']" # account-global; filter to the Regionlist-spacesis account-global (the--regionflag only selects the endpoint), so filter its result to the target Region as shown rather than reading a non-empty list as proof; a Space is one per account per Region. Seereferences/cloudwatch-omni/concepts.mdfor the full Region-probe rationale.A Domain and a Space in that Region (a non-empty filtered list) → Omni.
No Space in that Region (an empty filtered list) → CloudWatch: alarms → cloudwatch/alarms.md, dashboards → cloudwatch/dashboards.md, queries → cloudwatch/log-insights.md, metrics → cloudwatch/metrics.md. If the customer explicitly asked for Omni and has no Space, that is a first-time setup — see step 4.
The probe itself errors ("not yet supported", unknown service, endpoint does not resolve) → the CLI/SDK model in use lacks
cloudwatchomni. That is not evidence Omni is absent and must not be reported as "Omni is unavailable". The customer's installed AWS CLI/SDK most likely predates the service. If the request carried any Omni signal, give the customer the upgrade command to run (AWS CLI v2 reinstall orbrew upgrade awscli;pip install -U boto3 botocore) and have them re-runaws cloudwatchomni list-domains— exact steps in programmatic-access.md. Never run a package-manager upgrade or installer on the host yourself (brew,pip install -U,.pkg/MSI); it mutates the customer's machine beyond the request and can break unrelated tooling — hand over the command and continue with the guidance. Never substitute a CloudWatch or X-Ray command for an Omni request. If the request carried no Omni signal, do not block on the upgrade. When you are already going back to the customer for missing inputs (for example an alert's threshold and period), ask which product they want in that same question: say the Space probe could not run on this CLI, describe both options, and build neither until they answer. When the request is fully specified or says not to ask, proceed on the CloudWatch path (the pre-Omni default) and mention the upgrade only in passing.Still inconclusive → ask the customer.
First-time setup, on EITHER product → STOP and route to the
setting-up-cloudwatch-observabilityskill. This skill covers a service or Space that already reports and holds no onboarding procedure for either product, so there is nothing here to fall back on: not Omni setup (creating a Domain or Space, granting access, ingestion, forwarding, Slack, instrumenting an app or AI agent for a Space) and not CloudWatch setup (onboarding a service to Application Signals — ADOT auto-instrumentation, theamazon-cloudwatch-observabilityadd-on, monitored service, ServiceEvents, CI/CD metadata, the per-platform enablement guides). Any instrumentation / ADOT / collector request is a setup request either way; the setup skill owns the product decision too, so hand the whole request over rather than probinglist-spacesyourself. Application Signals once it is reporting — service map, alarms on its metrics, Dynamic Instrumentation debugging — belongs here.
Under-specified alert requests: When an alert or alarm request names what to watch (a symptom or a service) but not the inputs it needs — the threshold value and the evaluation period — ask for those rather than inventing them. Notifications are optional (per alerts.md), so ask for a notification destination only if the user wants to be notified. This holds on both paths (an Omni alert or a CloudWatch alarm).
Under-specified dashboard requests: When a dashboard request names what to show but not which metrics, panels, or layout, ground those against the data and confirm the panel set rather than inventing panels; a dashboard has no threshold, period, or notification. For ANY dashboard authoring/save request, also open dashboards.md and surface its "Facts you MUST surface when building or saving an Omni dashboard" checklist (see "Must-state checklists" below). Which signals or panels a named resource type needs is a Step 0.5 catalog question, not a dashboards-file question.
Step 0.5 — Service-health investigation (routing)
A large share of real questions are phrased as an operator symptom, not as a tool: "is my
<service> throttled / slow / erroring / unhealthy," "which of my <service>s are
<symptom>," "what's the health of my <service>," "what does <service> depend on and
which is broken," "what signals / what should be on a dashboard or view for <service>."
These are observability-data questions. Start from the telemetry, and answer with the
methodology (the correct signals, aggregation, scoping, and caveats) even when you also
pull live numbers and even when no matching resource exists in the account.
Telemetry shows the symptom. The cause is often a configured value, so when the question is
why something fails, also read the configuration of the resources involved, for example an
API Gateway integration timeout, an SQS visibility timeout, or a Lambda timeout or event
source mapping. A read-only or "logs only" role can usually still call these Get and
Describe APIs. Make the call and report AccessDenied if it happens.
Route by the symptom, then open the reference and surface every applicable item in its "facts you MUST surface" checklist — the checklist is the output contract, and it lives in the reference file, not here:
A metric symptom about one AWS service (throttling, latency, error rate, restarts, saturation, "what signals should it get", which signals or panels a named resource type needs on a dashboard or view) → query/promql-metrics.md. Open its "Service-health question — facts you MUST surface" section and surface every applicable item. Dashboard or view wording does not send this to either dashboards file (neither carries the signal facts) nor to rule 3's probe — it is a content question.
"What does
<service>depend on / what's broken downstream" / blast radius / who is affected / which direction do I walk the graph / what doCALLS,ACCESSES,RUNS_ONmean → context-graph.md. Open its "Dependency / blast-radius question — facts you MUST surface" section and surface every applicable item. A slowness or error symptom phrased in terms of the graph, dependencies, or edge types routes here, not to the metric bullet above.A health VERDICT for a service ("is
<service>healthy", "health summary of<service>") or a dependency map WITH ROLES ("what does<service>depend on and what role does each play", "which services call<service>") → service-health.md. Open its "Service health & dependency question — facts you MUST surface" section and surface every applicable item — it owns the combined verdict and the role-labelled dependency map, and defers the per-resource signal catalog and blast radius elsewhere. A bare single-service metric symptom, or a "what signals / panels does<resource type>need" or fleet-health-view ask, routes to the promql-metrics bullet above; a pure blast-radius / direction / edge-semantics question routes to the context-graph bullet.System status, a root-cause / triage symptom, or a past incident — "is anything wrong right now?", "what's wrong with
<service>", "why is<service>slow or erroring", "what changed since<time>", "users reported errors between X and Y — which service is the single most likely root cause", or any mention of insights, observations, or anomalies (a cause ask, not a single-signal health verdict or a dependency list) → intelligence.md: start from Omni Intelligence insights and observations, then use the context graph and queries to confirm. Its own "Scope and neighbours" section states which asks it hands back to the bullets above.Individual slow or failing spans / traces ("slowest spans for
<service>", "which traces failed") are trace SQL, not a metric aggregate → query/sql-logs-traces.md. Open its "Span Duration" and "Finding failed spans" sections and state every item in their must-state callouts — a request about a service's latency or error rate (an aggregate signal) is the PromQL bullet above instead.A failure being investigated from logs ("is this only failing for X?", "how many errors?", "what is the root cause?") → load the
aws-investigationskill and read itsreferences/completeness-and-root-cause.md. Read every page and every scope before counting, and check the root cause against every fact before reporting it.
Must-state checklists — the output contract
Four Omni tasks carry a checklist the answer text must carry, not just the plan. Open the reference and surface every item relevant to the request; the reference holds the per-item detail and is the source of truth, so do not restate it here.
| Task | Open | Section to surface |
|---|---|---|
| Authoring or advising on an Omni alert | alerts.md | "Facts you MUST surface when authoring an alert" |
| Scoring traces, choosing an evaluator, reading stored scores, online/continuous evaluation, evaluation datasets, turning scores into agent changes | agent-evaluation.md | every "tell the user ALL of this" callout |
| Exploring traces — one trace by id, comparing runs, finding traces by their spans, slowest traces, trace fields, agent sessions, token cost, what changed between two windows | query/trace-exploration.md | every "state … in the answer" callout |
| Authoring, saving, reading back, or debugging an Omni dashboard | dashboards.md | "Facts you MUST surface when building or saving an Omni dashboard" |
Routing — CloudWatch (references/cloudwatch/)
| User need | Action |
|---|---|
Enabling/onboarding a service to Application Signals (auto-instrumentation, the amazon-cloudwatch-observability add-on, monitored service), propagating ServiceEvents git/deployment metadata through CI/CD, or the per-platform × per-language enablement steps | STOP — this is first-time CloudWatch setup and no reference here covers it. Route to the setting-up-cloudwatch-observability skill |
| Writing Log Insights queries (pipe-delimited syntax: fields, filter, stats, sort, parse, display) | Read log-insights.md. If StartQuery rejects the window as before the log group's creation time, read the same window with FilterLogEvents. See Known issues 11 there |
| Configuring alarms (metric, composite, anomaly) | Read alarms.md. For an Omni alert, see the Omni table |
| Publishing custom metrics or using EMF | Read metrics.md |
| X-Ray / ADOT tracing behaviour — X-Ray-SDK-vs-ADOT choice, trace and segment structure, annotations vs metadata, sampling rules, collector pipeline config, X-Ray→OTel migration traps | Read tracing.md. Onboarding an un-instrumented service is the setup skill's job (see the first row) |
| Building CloudWatch dashboards (widget mechanics; which signals a given AWS service needs is Step 0.5) | Read dashboards.md |
| Debugging observability issues | Read troubleshooting.md — starts with the 5 most common fixes |
| Investigating a failure from logs: whether it affects one entity or the whole fleet, counts/totals/"no evidence of X", or deciding and reporting the root cause | Load the aws-investigation skill — completeness and scope first (references/completeness-and-root-cause.md), then root-cause analysis and the closing checklist |
| Debugging canary failures | Read synthetics.md — see Common failures table |
| CloudTrail operational auditing | Read cloudtrail.md |
| Setting up Lambda monitoring with CDK | Use alarm-template.ts as a starting point |
| Creating synthetic canaries | Read synthetics.md |
| Configuring ADOT collector | Use otel-config.yaml as a starting point |
| Debugging a running service with breakpoints/snapshots — Dynamic Instrumentation (modifies live services and captures live data) | Read dynamic-instrumentation.md in full before acting. Confirm with the user before any create/delete, and narrate before significant actions: observation → hypothesis → proposed action → expected result. Source inspection alone identifies hypotheses, not confirmed root causes; keep suspected causes tentative until runtime evidence confirms them. |
Routing — CloudWatch Omni (references/cloudwatch-omni/)
Rows that act on live Space data assume Step 0 found a Space. Knowledge questions are answered from the file directly.
| User need | Action |
|---|---|
| Concepts. What Omni is, what a Domain / Space / Dataset / grant / profile / view / alert / context graph is, whether a feature is Omni or CloudWatch, where setup starts | Read concepts.md |
Query logs or traces — SQL (SELECT … FROM logs.default / traces.default / default), field access, schema discovery, slowest / failed spans (durationNano, status.code), TABLESAMPLE | Read query/sql-logs-traces.md. For slowest or failed spans, state every item in its "Span Duration" / "Finding failed spans" must-state callouts, even when the live result is empty |
| Explore traces — open one trace by id (where the time went, why it failed, span tree, inputs/outputs, tokens), compare two runs, why a trace scored badly, find traces by their spans (tool calls per trace, a repeated tool, failed tool calls), the slowest traces today, what fields a trace carries, list or walk an agent's sessions (a looping session), token cost, guardrail or deploy questions, what changed (agent, model or downstream) | Read query/trace-exploration.md for the trace recipes and agent-span attributes, with query/sql-logs-traces.md for the SQL itself |
| A span, trace, or log record supplied in the prompt — "I have this span open, what errors are in it", a pasted telemetry object | Read the "Reading a span or trace you already have" section of query/sql-logs-traces.md. Answer from the object's own fields; do not probe, query, or ask the user to fetch it |
| Query metrics — PromQL, which metric answers which symptom per AWS service, why a metric is missing, gauge vs counter | Read query/promql-metrics.md. Metrics are PromQL, never SQL; run them directly through the CloudWatch Prometheus-compatible API (monitoring endpoint) or the CloudWatch MCP server's PromQL tools, not through StartTelemetryQuery |
Views — create, manage, or query named reusable SQL (FROM view.<name>) | Read query/views.md |
Dashboards in Omni — compose, ground panel queries, author panels[], lay out the grid, the API save semantics (an unknown root- or panel-level key, a missing type/layout, or a bad variant is REJECTED at save with a 400 ValidationException; a bad enum VALUE, x+w>60, or an unknown key inside config saves 200 and fails or is ignored at render; validate before save), fix an empty or blank panel, the *OmniDashboard APIs | Read dashboards.md |
Alerts in Omni — any mention of an Omni alert, CreateAlert / GetAlert / ListAlerts / UpdateAlert / DeleteAlert, a profileId, an alert ARN, or how alerts differ from alarms; create, tune, tag, list, delete; notifications | Read alerts.md. The alert API is real and first-class — do NOT redirect to CloudWatch alarms. For CloudWatch alarms when Omni is not enabled, read cloudwatch/alarms.md |
Omni Intelligence — is anything wrong right now, status of a service, why is a service slow or erroring, what caused an incident between two times, root cause, past incidents, insights, observations, anomalies, ListInsights, ListObservations | Read intelligence.md; it links to the context graph for cause-vs-impact questions. ListInsights, ListObservations, and GetContextGraph are the public CloudWatch Omni operations it teaches (aws cloudwatchomni list-insights / list-observations / get-context-graph), with the Intelligence console view as a human-readable cross-check. It consults the intelligence layer, localizes on the context graph, confirms with telemetry, and names one root-cause service. For a health verdict or dependency roles with no single-cause ask, use service-health.md; for pure dependency / blast-radius topology and graph traversal, use context-graph.md |
Context graph — why is service X slow or failing, what depends on it, upstream/downstream, which direction to walk, edge types CALLS / ACCESSES / RUNS_ON, blast radius, walking from an insight or anomaly to a root cause, GetContextGraph | Read context-graph.md and state every applicable item in its "facts you MUST surface" section |
Service health & dependency analysis — is <service> healthy, health summary, what does <service> depend on and what ROLE does each play (caller / callee / datastore / runs-on), which services call it | Read service-health.md and state every applicable item in its "facts you MUST surface" section. It grounds the verdict in the context graph + RED/USE metrics + alarm state; for the resource-specific signal catalog and query mechanics it defers to query/promql-metrics.md (§5 per-service catalog), query/sql-logs-traces.md, and alerts.md, for traversal and blast radius to context-graph.md. A "what signals / panels does <resource type> need" or fleet-health-view ask goes to promql-metrics.md, not here |
Agent evaluation — score traces on demand, choose an evaluator, read back stored gen_ai.evaluation.* scores ("which evaluators are doing worst", "which online evaluators are unhealthy / underperforming"), build datasets from traces, set up online evaluation, author a custom evaluator, audit whether an agent's traces are flowing, monitor quality, root-cause a quality regression, recommend prompt or tool-description changes from scores, verify a change against a baseline | Read agent-evaluation.md and state every applicable item in its "tell the user ALL of this" callouts |
| Programmatic access — "is there an API or SDK for Omni", calling Omni from code, CI, IaC, or an AI coding agent | Read programmatic-access.md. Omni has a real public SigV4 API; never answer that it has none, never substitute the CloudWatch or X-Ray CLI/SDK, and answer without probing for a Space. Endpoint cloudwatch-omni.<region>.api.aws, never .amazonaws.com; client cloudwatchomni, no hyphen. Give both authorization classes: a grant-mediated caller needs a matching grant or is denied; a direct IAM caller with none is not denied by the Space — its own IAM policy decides |
| AWS DevOps Agent — Investigations reports it is not connected, connecting it to a Space, or running, following, or chatting with an investigation | Connecting is first-time setup: route to the setting-up-cloudwatch-observability skill. In the Omni web app an investigation starts from a thread, /investigation new <description>, or a firing alert's Investigate action. Driving the DevOps Agent itself (starting, following, or chatting with investigations from a coding agent) belongs to its dedicated aws-agents-for-devsecops plugin; point there and do not reconstruct that workflow or invent aidevops calls |
| Who has access to a Space, granting or revoking access, access profiles, creating a Space or Domain, ingestion, forwarding, Slack, Azure, instrumenting an app or AI agent — and, on the CloudWatch side, onboarding a service to Application Signals | Route to the setting-up-cloudwatch-observability skill. If it is not installed locally, load it with the AWS MCP retrieve_skill tool (skill_name: setting-up-cloudwatch-observability; pass file for a reference it cites) |
| Spans multiple areas | Read the most specific reference first, then consult others as needed |
Files
references/cloudwatch/
| File | Content |
|---|---|
| alarms.md | Metric, composite, anomaly detection alarms — configuration, constraints, recommended defaults |
| log-insights.md | Complete query syntax, commands, functions, known issues, reusable query library |
| metrics.md | Custom metrics, EMF spec, metric filters, high-resolution, retention |
| tracing.md | X-Ray → ADOT migration, sampling rules, annotations vs metadata, collector config |
| dashboards.md | Widget types, cross-account/region, dynamic labels, sharing |
| troubleshooting.md | Error → cause → fix for all observability services |
| cloudtrail.md | Operational auditing, event types, S3+Athena queries |
| synthetics.md | Canary runtime/blueprint constraints, VPC networking, common failures |
| dynamic-instrumentation.md | Dynamic Instrumentation debugging loop — breakpoints/probes on live code, snapshot capture + correlation analysis, create/delete gating, snapshot PII handling. Runs via scripts/cloudwatch/di_instrumentation.py + scripts/cloudwatch/di_snapshots.py; details in dynamic-instrumentation/ |
| alarm-template.ts | Best-practice CDK Lambda monitoring (alarms + dashboard) |
| otel-config.yaml | ADOT collector config for X-Ray traces + CloudWatch EMF metrics |
Not here, by design: Application Signals onboarding (the enablement procedure, the
ServiceEvents CI/CD chain, the 16 per-platform guides) is first-time setup and lives in
setting-up-cloudwatch-observability. Do not reconstruct it here from memory; route.
references/cloudwatch-omni/
| File | Content |
|---|---|
| concepts.md | What Omni is and is not; glossary (Domain, Space, Dataset, grant, profile, view, alert, dashboard, context graph, evaluator); Omni-vs-CloudWatch feature-equivalence matrix; how to tell which product the customer means; the setup sequence and where it lives |
| context-graph.md | The service/resource topology Omni builds from traces and metrics; GetContextGraph request/response and CLI; reading upstream vs downstream and blast radius; walking from an insight or anomaly hop-by-hop to a root cause, then pivoting to queries |
| intelligence.md | Omni Intelligence — the insight and observation operations and data model, ListInsights / ListObservations inputs and filters, GetContextGraph with insights, answering status, troubleshooting, root-cause and past-incident questions, the 404-vs-403-vs-local error rule (owned by context-graph.md), cost and performance guardrails, and the empty-result/stale-insight gotchas |
| service-health.md | Service health verdict and dependency analysis — dependency map with roles (caller/callee/datastore/runs-on), the multi-signal HEALTHY/DEGRADED/DOWN verdict (RED for services, USE for resources, alarm state), and how to build the checks from a node's includeMetadata selectors. Ties together context-graph, promql-metrics, sql-logs-traces, and alerts rather than duplicating them — defers traversal and blast radius to context-graph and the resource-specific signal catalog to promql-metrics §5 |
| programmatic-access.md | The public SigV4 API (cloudwatch-omni endpoint prefix, cloudwatch signing name), how access grants authorize a programmatic caller, CLI/SDK access (and why an unsupported-service error is a client-version issue), CloudFormation/CDK, AI coding agents, and the wrong answers to avoid |
| query/sql-logs-traces.md | SQL over logs and traces — table addressing, required time range, system fields, field access and quoting, schema discovery, supported operations, functions, common patterns (including durationNano span duration), constraints, TABLESAMPLE |
| query/promql-metrics.md | Metrics in Omni are PromQL — what is queryable (OTLP, span RED, OTel-enriched vended metrics) and what is not, label conventions, __name__ matcher, rate() on counters, per-AWS-service metric catalog with derived formulas and dimension traps, and running queries and discovering names through the Prometheus-compatible HTTP API and MCP tools |
| query/trace-exploration.md | Working with whole traces on traces.default — span fields and AI-agent span attributes (span role, tool name, input/output, token usage), fetching one trace in the right window, time breakdown and self-time, failure analysis with exception events, comparing runs, tying a bad evaluation score to spans, tool-call and repeated-tool patterns, trace-level latency and "today", field discovery for traces, reporting, agent sessions, walking a session, token cost, signals the spans may not record, before/after comparison by layer |
| query/views.md | Named SQL views: CreateView / UpdateView / DeleteView / ListViews, FROM view.<name>, naming and definition rules, composition patterns |
| dashboards.md | Omni dashboards — composition recipes, grounding panel queries, the panels[] body and panel types, visualizations, the 60-column grid, the API save semantics (unknown root/panel keys are rejected 400; unknown keys inside config save 200 and are ignored at render; validate before save), troubleshooting empty/blank panels, the Create/Get/List/Update/DeleteOmniDashboard APIs, archetype templates |
| alerts.md | Omni alerts — alert vs alarm, evaluation (FIELD_VALUE / COUNT_OF_RESULTS, contributors), states and no-data treatment, notification rules, step-by-step create / update / delete / tag / fetch, and the alert APIs |
| agent-evaluation.md | Agent-quality evaluation on OTel traces — instrumentation health audit, evaluator selection, on-demand scoring, online evaluation, custom evaluators, datasets from traces, reading back stored gen_ai.evaluation.* scores (retrieval plan + SQL mechanics), and turning scores into changes (monitoring, regressions, evaluator drills, golden datasets, change and re-run). Uses scripts/cloudwatch-omni/evaluate_traces.py and scripts/cloudwatch-omni/capture_dataset_from_traces.py |
Files
- ATTRIBUTION.mdAdded by AutoGineer899 B
- LICENSELicence file added by AutoGineer9.9 KiB
- NOTICELicence file added by AutoGineer67 B
- SKILL.md37.0 KiB
- assets/cloudwatch/alarm-template.tsScript3.9 KiB
- assets/cloudwatch/otel-config.yaml1.9 KiB
- references/cloudwatch-omni/agent-evaluation.md114.9 KiB
- references/cloudwatch-omni/alerts.md108.5 KiB
- references/cloudwatch-omni/concepts.md29.3 KiB
- references/cloudwatch-omni/context-graph.md32.6 KiB
- references/cloudwatch-omni/dashboards.md79.4 KiB
- references/cloudwatch-omni/intelligence.md16.9 KiB
- references/cloudwatch-omni/programmatic-access.md15.5 KiB
- references/cloudwatch-omni/query/promql-metrics.md66.8 KiB
- references/cloudwatch-omni/query/sql-logs-traces.md45.1 KiB
- references/cloudwatch-omni/query/trace-exploration.md26.1 KiB
- references/cloudwatch-omni/query/views.md12.8 KiB
- references/cloudwatch-omni/service-health.md17.5 KiB
- references/cloudwatch/alarms.md11.6 KiB
- references/cloudwatch/cloudtrail.md5.4 KiB
- references/cloudwatch/dashboards.md5.8 KiB
- references/cloudwatch/dynamic-instrumentation.md39.3 KiB
- references/cloudwatch/dynamic-instrumentation/breakpoint-creation.md16.3 KiB
- references/cloudwatch/dynamic-instrumentation/call-tree-and-directions.md5.7 KiB
- references/cloudwatch/dynamic-instrumentation/snapshot-parsing.md4.2 KiB
- references/cloudwatch/log-insights.md8.3 KiB
- references/cloudwatch/metrics.md7.5 KiB
- references/cloudwatch/synthetics.md6.5 KiB
- references/cloudwatch/tracing.md9.4 KiB
- references/cloudwatch/troubleshooting.md7.5 KiB
- scripts/cloudwatch-omni/capture_dataset_from_traces.pyScript25.2 KiB
- scripts/cloudwatch-omni/evaluate_traces.pyScript42.7 KiB
- scripts/cloudwatch-omni/test_evaluate_traces.pyScript12.6 KiB
- scripts/cloudwatch/di_app_signals_client.pyScript3.3 KiB
- scripts/cloudwatch/di_capture.pyScript8.5 KiB
- scripts/cloudwatch/di_constants.pyScript560 B
- scripts/cloudwatch/di_crud_rendering.pyScript13.1 KiB
- scripts/cloudwatch/di_crud_tools.pyScript28.8 KiB
- scripts/cloudwatch/di_error_translation.pyScript5.6 KiB
- scripts/cloudwatch/di_formatting.pyScript992 B
- scripts/cloudwatch/di_gateway.pyScript7.0 KiB
- scripts/cloudwatch/di_instrumentation.pyScript13.0 KiB
- scripts/cloudwatch/di_location.pyScript15.3 KiB
- scripts/cloudwatch/di_logs_client.pyScript4.2 KiB
- scripts/cloudwatch/di_region.pyScript2.0 KiB
- scripts/cloudwatch/di_result.pyScript2.0 KiB
- scripts/cloudwatch/di_session.pyScript2.0 KiB
- scripts/cloudwatch/di_snapshot_parsing.pyScript11.4 KiB
- scripts/cloudwatch/di_snapshot_queries.pyScript2.4 KiB
- scripts/cloudwatch/di_snapshot_rendering.pyScript12.5 KiB
- scripts/cloudwatch/di_snapshot_tools.pyScript12.0 KiB
- scripts/cloudwatch/di_snapshots.pyScript12.8 KiB
- scripts/cloudwatch/di_status_assessment.pyScript4.7 KiB
- scripts/cloudwatch/di_status_rendering.pyScript11.8 KiB
- scripts/cloudwatch/di_status_tools.pyScript13.0 KiB
- scripts/cloudwatch/di_validation.pyScript11.2 KiB
references/cloudwatch-omni/query/trace-exploration.md
Exploring Traces in Omni
Recipes for working with whole traces and AI-agent spans on traces.default: fetching one
trace, reading where its time went or why it failed, comparing runs, and finding traces by
the pattern of their spans. The SQL dialect, quoting, time bounds and schema discovery are in
sql-logs-traces.md; this file assumes them. Scoring traces and reading
stored evaluation scores are in agent-evaluation.md.
1. The span fields a trace is built from
These are the OTel span fields as Omni stores OTLP spans. Only the @-prefixed system fields
are guaranteed on every record (see sql-logs-traces.md); confirm the
rest with EXPLAIN (ANALYZE_FIELDS) before presenting them as present.
| Field | What it holds |
|---|---|
traceId, spanId | The trace and span ids. A trace id is 32 hex characters. |
parentSpanId | The parent span's id. The root span has none (NULL or empty). |
name | The operation name (a route, a tool, a model call). |
kind | The OTel SpanKind — the span's role on the wire: SERVER, CLIENT, INTERNAL, PRODUCER, CONSUMER (or the numeric / SPAN_KIND_* encodings). It is not a status and not the agent role; never read failure from it. |
status['code'] | The span status: ERROR (2 / ERROR / STATUS_CODE_ERROR), OK, or UNSET. See "Finding failed spans" in sql-logs-traces.md. |
startTimeUnixNano, endTimeUnixNano | Start and end in epoch nanoseconds. `@timestamp` is the end time. Order spans chronologically by startTimeUnixNano. |
durationNano | Duration in nanoseconds, string-typed: CAST(durationNano AS DOUBLE) / 1e9 is seconds. |
resource['attributes']['service.name'] | The service or agent that emitted the span. |
AI-agent span attributes
Agent frameworks record the agent role, tool, payloads and token usage as span attributes.
Two naming families are common — OpenInference and OTel GenAI semantic conventions — and an
agent usually emits one of them, so confirm which with EXPLAIN (ANALYZE_FIELDS) scoped to
that agent's spans before building a query on them.
| Meaning | OpenInference / AWS | OTel GenAI |
|---|---|---|
Agent role of the span (AGENT, LLM, TOOL, …) | attributes['openinference.span.kind'], attributes['aws.genai.span_kind'] | attributes['gen_ai.operation.name'] — invoke_agent, chat / text_completion / generate_content (an LLM call), execute_tool |
| Tool name | attributes['tool.name'] | attributes['gen_ai.tool.name'] |
| Input / output text | attributes['input.value'], attributes['output.value'] | attributes['gen_ai.input_value'], attributes['gen_ai.output_value']; message arrays gen_ai.input.messages / gen_ai.output.messages |
| Token usage (LLM spans) | attributes['llm.token_count.prompt'], attributes['llm.token_count.completion'] | attributes['gen_ai.usage.input_tokens'], attributes['gen_ai.usage.output_tokens'] |
| Model | — | attributes['gen_ai.request.model'], attributes['gen_ai.response.model'] |
| Session | attributes['session.id'] | attributes['session.id'] |
A tool span is any span whose role attribute says TOOL (openinference.span.kind or
aws.genai.span_kind = 'TOOL') or whose gen_ai.operation.name is 'execute_tool'; when
the agent's family is not yet known, match all three. Token counts may be ingested as
strings — TRY_CAST(... AS BIGINT) before summing. Report a span that has no input, output
or token attribute as having none; never fill one in.
2. Fetching one trace
Every trace query needs a `@timestamp` bound, and a span is stamped with its end
time, so choose the window deliberately:
The user gave a time ("around 14:05 today"): start a few minutes before it and end after it by at least the longest span duration you expect (a long agent run can last many minutes). Use absolute bounds with
to_timestamp_nanos.Only an id: start with a recent window (the last hour, then the last day) and widen step by step only if the trace is not found. Do not open with a multi-day scan.
Say which window you used, and when you widened it, the new range.
SELECT spanId, parentSpanId, name, kind, status['code'] AS status_code,
startTimeUnixNano, CAST(durationNano AS DOUBLE) / 1e9 AS duration_s,
resource['attributes']['service.name'] AS service
FROM traces.default
WHERE `@timestamp` BETWEEN to_timestamp_nanos('2026-08-20T14:00:00.000Z')
AND to_timestamp_nanos('2026-08-20T14:30:00.000Z')
AND traceId = '<32-hex trace id>'
ORDER BY startTimeUnixNano ASCRebuild the tree from spanId → parentSpanId (the root has no parent). If the trace is
not in the window, it is a window problem first: widen it before concluding the trace does
not exist.
Large payloads. Agent spans can carry long prompts and outputs. Show a short excerpt
(for example the first few hundred characters, with left(...) or substr(...)) and say it
is truncated, rather than pasting whole payloads.
Payloads can be sensitive. Inputs and outputs are the agent's real conversations and can
contain personal data, credentials or business content. Show only the part the question
needs, mask any value that looks like a secret or credential instead of echoing it, and do
not copy payloads into anything persistent (a dataset, a dashboard, a saved view) unless the
user asks.
When the user does ask to persist payloads, redact secrets and credentials before writing,
tell the user that the destination now holds conversation data with the same sensitivity
and the same readers as that store, and recommend encryption at rest with a customer-managed
KMS key where the destination offers one (for example --kms-key-id on the evaluation
results log group in agent-evaluation.md); AWS API calls are
already encrypted in transit with TLS.
One trace by id — state ALL of this in the answer, with the queries shown: the attribute check (
EXPLAIN (ANALYZE_FIELDS)on the agent's spans) when the answer relies on agent attributes; the fetch query with its window, and that the window runs past the request because`@timestamp`is a span's END time; the tree rebuilt fromspanId/parentSpanId; durations converted from nanoseconds; long payloads shown as short, truncated excerpts with secrets masked; and, for every span shown, which of its input, output or token fields are absent.
3. Reading one trace
Where the time went
The trace's total is the root span's duration.
Express each child's time as a share of the root's duration. Children nest and can run concurrently, so their shares do not add up to 100%; for a breakdown that does, use self-time — a span's duration minus the time covered by its children.
Name the longest child span and its service (
resource['attributes']['service.name']), and follow the critical path down: the slow step is usually the deepest long span, not the root that waited on it.
Where the time went — state in the answer: the fetch window and the end-time reason for its upper bound; the root span as the total; each child's share of the root, with the note that overlapping children do not sum to 100% (or self-time when a full breakdown is wanted); and the longest child with its service.
Why it failed
Find the failing spans by status (
status['code']ERROR, normalised as in sql-logs-traces.md), never bykind. UNSET is not a failure.Follow the error to the deepest failing span — the root of a failed request is usually ERROR only because a child failed, and blaming it hides the cause.
Read the reason: the failing span's status message, and any recorded exception. OTel records an exception as a span event named
exceptionwithexception.type,exception.messageandexception.stacktrace. Where those land in the record depends on how the spans were ingested, so find them withEXPLAIN (ANALYZE_FIELDS)or the span's`@record`rather than assuming a path. Corroborate withattributes['http.response.status_code']orattributes['rpc.grpc.status_code'].Give concrete next steps tied to what the failing span shows (the dependency that timed out, the input that was rejected, the code path that threw).
If no message or exception was recorded, say so, and recommend better error reporting in the code: record exceptions on the active span and set a descriptive status message, so the next failure explains itself. Do not invent a cause.
Why a trace failed — state ALL of this in the answer, including before any result is back: failure is read from
status['code'](neverkind; UNSET is not a failure); the deepest failing span is the origin; the reason comes from its status message and exception event (exception.type/.message/.stacktrace); the likely fixes for the common failure shapes you would look for (a downstream timeout, a rejected input, an unhandled exception); and the fallback for a trace that recorded no message or exception — recording exceptions on spans and setting a status message. When the spans show the cause, close with the fix for that cause: the code or configuration change at the failing span (a missing-value check and the right error status for bad input, a timeout or retry setting for a slow dependency), and how to confirm it. Give that fix from this trace's evidence now; checking more traces for scope is an offer to add after it, not a reason to hold it back.
Comparing two runs
Fetch both traces, each with its own window (section 2), and walk them side by side in
startTimeUnixNano order, aligning the LLM and tool calls. Compare:
Latency — the root durations, then which steps account for the difference (an extra tool call, a retried step, a slower model call).
Tokens — the LLM spans' token attributes (section 1), per call and in total, and what explains a change (more LLM calls, a longer context, a different model).
Quality — stored evaluation scores are records in
logs.defaultkeyed bytraceId, never span attributes; read them as in agent-evaluation.md section 7. If neither trace has a stored score, say so and offer to score both; do not grade the runs yourself.
Comparing runs — state ALL of this in the answer, with the queries shown: both fetches with their own windows; the step-by-step walk in start-time order with LLM and tool calls aligned; latency compared on the root spans (
durationNanoin nanoseconds, cast) and the difference attributed to specific steps; tokens compared from the LLM spans' usage attributes; and quality from the storedlogs.defaultscores, or an offer to score both when none exist.
Why a trace scored badly
Read the trace's evaluation records from logs.default (score, label, and the evaluator's
explanation; skip errored records; mind each evaluator's polarity — all in
agent-evaluation.md section 7). Then fetch the trace's spans and
tie each explanation to the span it describes: the LLM output that was unhelpful or wrong,
the tool that was chosen badly or not called, the retrieval that returned nothing useful.
Propose a change aimed at that span — the system prompt, a tool's description or schema,
retrieval, or the orchestration — and how to confirm it worked (re-score the trace, or run a
regression dataset).
Why a trace scored badly — state ALL of this in the answer: each evaluator's score, label and explanation as read from
logs.default(never a score of your own), with errored records set aside rather than read as low scores and each score read by its polarity; the specific span each explanation points to; the change proposed for that span (prompt, tool description or schema, retrieval, orchestration); and how to verify it — re-scoring the trace or a regression dataset.
4. Finding traces by their spans
These questions span many traces, so scope them to the agent
(resource['attributes']['service.name']) and a bounded window, and state the window.
Traces with several tool calls, or a tool repeated
Count tool spans per trace (and per tool, for repeats). Project nested attributes to plain aliases in a CTE first — then group and filter on the aliases:
WITH tool_spans AS (
SELECT traceId,
COALESCE(attributes['tool.name'], attributes['gen_ai.tool.name']) AS tool,
upper(TRY_CAST(status['code'] AS VARCHAR)) AS status_code
FROM traces.default
WHERE `@timestamp` BETWEEN NOW() - INTERVAL '12 HOURS' AND NOW()
AND resource['attributes']['service.name'] = '<agent service.name>'
AND (attributes['openinference.span.kind'] = 'TOOL'
OR attributes['aws.genai.span_kind'] = 'TOOL'
OR attributes['gen_ai.operation.name'] = 'execute_tool')
)
SELECT traceId, tool, COUNT(*) AS calls,
COUNT(*) FILTER (WHERE status_code IN ('2', 'ERROR', 'STATUS_CODE_ERROR')) AS failed_calls
FROM tool_spans
GROUP BY traceId, tool
HAVING COUNT(*) >= <N> -- N = the repeat count the user asked about
ORDER BY calls DESCThat query answers "the same tool called N or more times". For "traces with more than one tool call" (any tools), group by the trace alone over the same CTE:
SELECT traceId, COUNT(*) AS tool_calls
FROM tool_spans
GROUP BY traceId
HAVING COUNT(*) > 1
ORDER BY tool_calls DESCThe failed_calls column separates retries — a tool called again after its previous
call failed — from legitimate repeated calls with successful statuses; say which each
matching trace is.
Finding traces by their tool calls — state ALL of this in the answer: the agent scope and the window used; how tool spans are recognised (the role attribute the data carries); the grouping (per trace, or per trace and tool) and its threshold; that the result is reported as the number of matching traces with their trace ids (and, for repeats, the tool and its count, retry or not); that an empty result is followed by one wider window, named; and an offer to save the matching traces as an evaluation dataset or to score them — offered, not done.
Close every answer in this section (several tool calls, a repeated tool, failed tool calls, slowest traces) with both of these, even when no query could run: the result line —
N traces matched: <ids>, ornone matched in <window>; widened to <wider window>: <result>, or, when the query has not run, exactly what that line will report, including the wider window you will try if nothing matches — and the offer — save the matching traces as an evaluation dataset, or score them, on the user's go-ahead.
Traces where a tool call failed
Open with the schema caveat, as for any failed-span question ("Finding failed spans" in
sql-logs-traces.md): show the EXPLAIN (ANALYZE_FIELDS) check of the
status field and the tool-span attribute first, then the filter. Return one row per failing
call with the trace, the tool and the reason:
SELECT DISTINCT traceId,
COALESCE(attributes['tool.name'], attributes['gen_ai.tool.name']) AS tool,
status['message'] AS status_message
FROM traces.default
WHERE `@timestamp` BETWEEN NOW() - INTERVAL '1 HOUR' AND NOW()
AND (attributes['openinference.span.kind'] = 'TOOL'
OR attributes['aws.genai.span_kind'] = 'TOOL'
OR attributes['gen_ai.operation.name'] = 'execute_tool')
AND upper(TRY_CAST(status['code'] AS VARCHAR)) IN ('2', 'ERROR', 'STATUS_CODE_ERROR')Add the agent's resource['attributes']['service.name'] when the user named one. The same
reporting rules apply (section 5): an empty result means check the field names and status
encodings, then widen once and say so — and the answer closes with the result line and the
offer, as in the callout above.
Trace-level latency ("the slowest traces")
A trace's latency is its root span's duration (or the longest span per traceId when
the root is missing). Rank traces, not spans — ranking raw spans lets one slow trace fill
several places:
SELECT traceId, resource['attributes']['service.name'] AS service, name,
CAST(durationNano AS DOUBLE) / 1e9 AS duration_s
FROM traces.default
WHERE `@timestamp` BETWEEN date_trunc('day', NOW()) AND NOW()
AND (parentSpanId IS NULL OR parentSpanId = '')
AND durationNano IS NOT NULL
ORDER BY CAST(durationNano AS DOUBLE) DESC
LIMIT 10That query skips any trace whose root span was not ingested. When the root may be missing, or the result has fewer traces than expected, rank by the longest span per trace instead; for a well-formed trace the root is the longest span, so the two agree:
SELECT traceId, MAX(CAST(durationNano AS DOUBLE)) / 1e9 AS duration_s
FROM traces.default
WHERE `@timestamp` BETWEEN date_trunc('day', NOW()) AND NOW()
AND durationNano IS NOT NULL
GROUP BY traceId
ORDER BY duration_s DESC
LIMIT 10"Today" is a calendar day, not the last 24 hours. Bound it from the start of the day
(date_trunc('day', NOW()), which is midnight UTC, or an explicit
to_timestamp_nanos('<date>T00:00:00.000Z')), and state the timezone. If the user is in
another timezone, shift the bound to their midnight and say so.
Slowest traces — state in the answer: the start-of-day bound and its timezone; that traces are ranked by the root span (one row per trace); the cast and NULL exclusion; and the summary you give from the rows (section 5) — the latency range, where the slow traces concentrate, the recurring bottleneck and its share, and outliers kept apart — with an offer to dig into any of them.
Field discovery for traces
"What fields are on my traces" is answered per agent or service, because every application records different attributes and the union over a whole Space is noise:
Run
EXPLAIN (ANALYZE_FIELDS)overtraces.defaultwith aWHEREon the service and a bounded window.ListTelemetryFieldswithtelemetryTypeTRACESlists the Space's trace fields, but it takes no service filter, so it cannot narrow to one agent.If the user named no agent or service, ask which one, and offer to list the services that have recent spans.
Present the result grouped as span system fields (section 1), resource attributes (
resource['attributes'][...]), and span attributes (attributes[...]), with sample values, and say that the fields depend on what each application instrumented.
Fields on traces — state ALL of this in the answer: the scoped
EXPLAIN (ANALYZE_FIELDS)query (service filter and window); thatListTelemetryFieldscannot be scoped to one service; the three groups with sample values; that only the@fields are guaranteed and everything else depends on instrumentation; and a direct question asking which agent or service to look at, when none was named.
5. Reporting
Lead with the finding, not the rows. For a set of traces: the range (fastest to slowest), where they concentrate (which agent or service), the recurring bottleneck step or tool and its share of the time, and any one-off outliers (a cold start, a single retry) called out separately from the pattern. Offer to dig into a trace.
List the trace ids the user asked to see. When the request is to find or show traces, give the matching count and the ids. (When resolving ids only to hand them to an evaluation or dataset helper, follow agent-evaluation.md instead.)
An empty result is not an answer yet. Check the field names and the window, widen the window once, and say what you searched before reporting that nothing matched.
Offer the next step; do not take it. Matching traces can be saved as an evaluation dataset or scored — offer both, and do neither without the user's go-ahead (dataset writes need confirmation; see agent-evaluation.md).
When you cannot run the query, show it and say what you would read from the result. Never report spans, counts, durations or causes you did not get from the data.
6. Agent sessions, cost, and what changed
Questions about an agent's behaviour over many traces. Scope every query to the agent's
resource['attributes']['service.name'] and a bounded window, and state both. Quality scores
behind any of these live in logs.default and are read as in
agent-evaluation.md section 7; never grade the agent yourself.
Sessions
A session is the set of traces that share attributes['session.id']. Confirm the agent emits
it with EXPLAIN (ANALYZE_FIELDS) on its spans before grouping. One row per session:
SELECT attributes['session.id'] AS session_id,
COUNT(DISTINCT traceId) AS traces,
MIN(TRY_CAST(startTimeUnixNano AS BIGINT)) AS first_start_ns,
MAX(TRY_CAST(endTimeUnixNano AS BIGINT)) AS last_end_ns,
(MAX(TRY_CAST(endTimeUnixNano AS BIGINT)) - MIN(TRY_CAST(startTimeUnixNano AS BIGINT))) / 1e9 AS duration_s,
SUM(TRY_CAST(COALESCE(attributes['gen_ai.usage.input_tokens'], attributes['llm.token_count.prompt']) AS BIGINT))
FILTER (WHERE attributes['gen_ai.operation.name'] IN ('chat', 'text_completion', 'generate_content')
OR attributes['openinference.span.kind'] = 'LLM'
OR attributes['aws.genai.span_kind'] = 'LLM') AS input_tokens,
SUM(TRY_CAST(COALESCE(attributes['gen_ai.usage.output_tokens'], attributes['llm.token_count.completion']) AS BIGINT))
FILTER (WHERE attributes['gen_ai.operation.name'] IN ('chat', 'text_completion', 'generate_content')
OR attributes['openinference.span.kind'] = 'LLM'
OR attributes['aws.genai.span_kind'] = 'LLM') AS output_tokens,
COUNT(*) FILTER (WHERE upper(TRY_CAST(status['code'] AS VARCHAR)) IN ('2', 'ERROR', 'STATUS_CODE_ERROR')) AS error_spans
FROM traces.default
WHERE `@timestamp` BETWEEN NOW() - INTERVAL '1 HOUR' AND NOW()
AND resource['attributes']['service.name'] = '<agent service.name>'
AND attributes['session.id'] IS NOT NULL
GROUP BY attributes['session.id']
ORDER BY last_end_ns DESC
LIMIT 50Tokens are summed over LLM spans only: some frameworks also record a request's accumulated usage on the agent span, so summing every span counts the same tokens twice.
If the agent's spans carry no session.id, the telemetry cannot group by session: say so and
name the gap (the framework or the code has to set session.id on its spans). Do not
substitute the trace id, a user id, or a time bucket and call the result sessions.
Walking one session step by step
Fetch every span with that session.id in a bounded window, ordered by startTimeUnixNano,
and walk it as a sequence of LLM decisions, tool calls, and tool results (section 1 for the
role attributes). For a session that loops, report where the repetition starts, what repeats
(the same tool with the same arguments, or the same prompt), how many iterations ran, and
what kept it going: a tool that kept failing and was retried, or an observation that never
changed so the model never reached a stop condition. Tie the fix to that cause: a maximum
iteration or tool-call cap in the orchestration, handling of the tool's error so the model
sees a usable result, or a clearer tool description or stop instruction.
Token cost
The spans carry tokens, not money: what a token costs depends on the model, and hosting, memory and tool backends do not appear in them at all. Rank the agent's traces by the input and output tokens of their LLM spans, open the heaviest few, and match what you see to a fix:
| What the heavy trace shows | Change to propose |
|---|---|
| The prompt size climbs call after call | Cap or summarise conversation history |
| Tool results are pasted back to the model in full | Trim or summarise tool output before it returns |
| The same long system prompt rides on every call | Shorten it, or use prompt caching where the model supports it |
| More LLM calls than the task needs (re-planning, retries) | Tighten orchestration; fix the tool error that triggers retries |
| A large model doing routine steps | Route those steps to a smaller model |
Confirm a change by comparing token totals and the stored evaluation scores for the same kind of traffic before and after, so a saving does not hide a quality drop.
Signals the telemetry may not record
Guardrail interventions, deploys, prompt or knowledge-base updates, and agent versions are
visible only if something writes them onto the spans. Discover first, with
EXPLAIN (ANALYZE_FIELDS) on the agent's spans, looking for an attribute that records the
event (for example a guardrail action, service.version, or a deployment attribute).
Present: filter or split on it, roll up to sessions or evaluation scores as asked, and report the share ("N of M sessions in the window").
Absent: say the telemetry cannot answer the question and name what would need to be emitted. For change events, offer the fallback that needs no attribute: the user gives the change times and you compare equal windows before and after each. Never infer a guardrail block from response wording, and never claim a correlation with a change you cannot see.
What changed: before and after
Anchor on the time the user names (or the start of the regression) and compare two absolute windows of equal length, before and after, on the same service. Compare three layers and name the one the evidence supports:
The agent: span structure per trace (count and order of LLM and tool spans), the set of tools called, and any version or deployment attribute.
The model:
gen_ai.request.model/gen_ai.response.model, token usage per call, and LLM span latency.Downstream: tool and
CLIENTspan latency and error rate, grouped byattributes['peer.service']orattributes['server.address'].
Read quality for both windows from logs.default per evaluator (scored records only, both
service.name forms), as in agent-evaluation.md section 7. When the
layers move together or the evidence points outside the agent's telemetry (a dependency's own
health, infrastructure), say the agent telemetry cannot separate them and recommend a
full-stack investigation of that dependency instead of naming a cause.
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs an MCP server, Needs a command-line tool, Needs Python, Needs Node.js
Security
What our scanner noticed· Low risk
- Phrasing that asks for actions without confirmation
- Instructions that use the network
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- AWS
- Publisher
- AWS (Official)
- Source
- aws/agent-toolkit-for-aws · skills/core-skills/aws-observability · commit 0a218f8
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- NOTICE (added by AutoGineer from NOTICE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
- Also distributed in
- aws/agent-toolkit-for-aws
AutoGineer is not affiliated with or endorsed by AWS.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download aws-observability.zip