/last9:last9-cloudwatchfrom last9
Investigate AWS CloudWatch metrics in Last9 with read-only MCP queries. Covers Billing, RDS/Aurora, ElastiCache, MSK, DynamoDB, EC2, SQS, DMS, KMS, and S3. Discover resource metrics, interpret statistics and units, and distinguish sparse data from missing delivery.
Ships in last9. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Establish resource and statistic before calculating. CloudWatch needs no application service, environment label, or APM instrumentation.
Use the authenticated Last9 MCP server for read-only queries. AWS/collector changes, Terraform, and dashboards are separate tasks.
Establish the connected organization, selected datasource, AWS account, region, resource, and UTC bounds. Use list_datasources if unresolved; carry the selection into every call regardless of defaults. Resolve relative times once with an available clock. Datasource/integration configuration can establish account/region without labels; cite that evidence. Resolve ambiguous scope before combining data; never substitute an accessible organization for the intended one.
If tools are missing, use sufficient supplied observations or report the capability gap. Mark unexecuted queries; never invent results.
Before family-specific discovery or queries, read the matching reference. For a task spanning multiple families, load only those matching references. Namespace names below are discovery hints, not guaranteed ingested names or label spellings. Use the shared rules below for every source.
| Family | Namespace hint | Read when investigating |
|---|---|---|
| Billing | AWS/Billing or a verified cost exporter | Estimated charges, currency, service and linked-account cost scope |
| RDS / Aurora | AWS/RDS | Instance versus cluster/role metrics, CPU, latency, replication |
| ElastiCache | AWS/ElastiCache | Cache node identity, engine versus host CPU, hits, evictions, lag |
| MSK | AWS/Kafka | Broker versus topic/consumer-group metrics, throughput, consumer lag |
| DynamoDB | AWS/DynamoDB | Table/index/account scope, consumed capacity, throttling, latency |
| EC2 | AWS/EC2 | Instance CPU, period network bytes, status checks, credit balances |
| SQS | AWS/SQS | Approximate backlog and age, message-operation counts, inactive queues |
| DMS | AWS/DMS | Replication task versus instance, source/target CDC latency |
| KMS | AWS/KMS | Operation counts, key material expiration, metric applicability |
| S3 | AWS/S3 | Daily storage versus request metrics, last-known versus current |
Installed schemas take precedence over this reference:
| Tool | Relevant parameters |
|---|---|
list_datasources | Advertised schema |
prometheus_label_values | label, match_query, datasource, start_time_iso, end_time_iso |
prometheus_labels | match_query, datasource, start_time_iso, end_time_iso |
prometheus_instant_query | query, datasource, time_iso |
prometheus_range_query | query, datasource, start_time_iso, end_time_iso |
Discover names with label: "__name__". Do not invent a step parameter. Distinguish raw range selectors evaluated once from repeatedly evaluated charts. A selector carrying no range returns only the latest period, so any total, average, or coverage claim about a whole interval needs a range selector spanning that interval; before claiming one, check that the returned sample count matches the periods the interval should contain.
amazonaws_com_AWS for its stream path. Treat it as a discovery hint: exporters can use other names. Missing one prefix does not prove missing resource metrics. Discover dimensions, then execute a bounded selector. Catalog membership proves discoverability, not delivery. prometheus_labels may return generic keys even with match_query; state that limitation and use actual returned series labels. Do not invent service_name, env, namespace, or AWS dimensions from another metric's catalog.time_unix_nano is the CloudWatch period endTime, so a verified OpenTelemetry-format stream sample is stamped at period end. Cite that source together with the verified stream lineage when a coverage claim depends on it; for exporters or unverified lineage the mapping is unknown, so label period-boundary claims as assumptions. Use AWS definitions and ingestion mapping for units, not magnitude or an assumed unit label. Check the current guide and observed format/additional statistics rather than imposing a historical format version. If dimensions are opaque encoded values, report the resource-selection limitation; do not invent direct keys or recreate the stream.prometheus_label_values example: substitute datasource/UTC bounds and add verified resource filters.
{
"label": "__name__",
"match_query": "{__name__=~\"amazonaws_com_AWS_RDS_.+\"}",
"datasource": "<selected-datasource>",
"start_time_iso": "<start-utc>",
"end_time_iso": "<end-utc>"
}
A successful empty expression returned no values; an explicit numeric zero is a measurement. Describe an empty result as no matching samples returned for that selector and window. Do not call it not ingested, not delivered, not reported, or a data gap: those are causes that need separate evidence such as widened history, other statistics, or datasource configuration. An empty ratio does not prove missing raw observations. Inspect each raw operand at the same verified scope/window for absent samples, zero or invalid denominators, and vector-matching differences. Invalid queries, authentication failures, and timeouts establish neither zero nor absence. Repair invalid arguments/expressions using the actual schema and discovered names, retry the scoped read, or report the blocking error.
Metric Streams carry period Sum and SampleCount plus configurable statistics. Verify the series' summary mapping before using these recipes:
| Observed measurement | Calculation and guardrail |
|---|---|
Confirmed _sum / _count companions | Period Sum / SampleCount is the sample average when labels, period, and population match and count is positive. SampleCount counts observations, not automatically requests. |
| Disjoint period summaries | Window average = total Sum / total SampleCount. Averaging period averages is wrong when counts differ. Whole-window claims require matching coverage and boundaries. |
| Metric whose Sum counts events | Add disjoint period Sums; divide by elapsed seconds for average events/sec only with complete coverage. Establish event semantics from the metric definition, not its suffix. |
| Gauge: storage or utilization | Report the requested level or defined aggregate. Adding observations over time is not total storage or utilization. |
| Verified cumulative exporter counter | rate() / increase() may apply with sufficient history and reset handling. Never apply them to period summaries merely because of _sum / _count suffixes. |
| Minimum, maximum, percentile | Select the actual statistic label (quantile if present). In the documented OpenTelemetry stream translation, summary quantile 0 carries the period Minimum and quantile 1 the period Maximum; confirm the ingested format before relying on that mapping, because other formats and exporters expose Min/Max differently. A period Maximum is the largest value observed in that period, not the latest reading. Maximum period p99 is peak period p99, not whole-window p99. Do not apply histogram_quantile() to already-quantiled values. |
| Instance, cluster, role, or other rollups | Select one non-overlapping population; never add an aggregate and its constituents. |
For verified summaries, substitute observed names, selectors, and window:
<sum-metric>{<verified-scope>} / <count-metric>{<verified-scope>}
sum(sum_over_time(<sum-metric>{<verified-scope>}[<window>]))
/
sum(sum_over_time(<count-metric>{<verified-scope>}[<window>]))
The period ratio needs one-to-one companion matching. The window ratio additionally needs disjoint reports, matching populations/periods, and positive total SampleCount. Do not hide unexplained mismatches by dropping labels or convert a missing/zero denominator into zero latency or utilization.
Inspect raw times using <metric>{<verified-scope>}[<window>] through prometheus_instant_query at the fixed end. Use verified raw-selector bounds and sample timestamps for window membership; do not contradict them with unverified UTC conversions. Membership alone does not establish complete period coverage. Check result type and timestamp meaning: source observation times need original samples. Vector tuples and chart points can carry evaluation times or repeat earlier observations. Missing periods, duplicates, late data, misaligned boundaries, or unknown timestamp semantics limit totals/averages; report supported coverage instead of filling gaps with zero.
Keep last-known and current separate. A historical query interval is not a freshness requirement unless the user explicitly makes it one. Honor a user-specified freshness window; otherwise probe each raw companion at the requested end time, separately from widened history. Do not invent a production freshness threshold. Widened history or a historical last_over_time() result cannot establish currentness; its evaluation time is not source publication time. If the observations do not establish currentness, report current unavailable and the last-known value separately.
Preserve exact returned Unix seconds. Verify UTC conversion and any age calculation with a reliable available tool; otherwise report the epoch only and omit converted dates/times and computed ages. vector(epoch) merely echoes a number, not a verified time conversion. Never round a source timestamp to a date or midnight.
Keep requested output names. Give value/unit or unavailable, resource/dimension level, datasource/UTC interval, source/statistic, and executed queries with evidence/call references. Cite every operand actually used, including Sum and SampleCount for an average. State partial coverage, last-known times, unsupported statistics, and unresolved causes; check prose arithmetic against the samples and result.
A resource may have queryable metrics without a Discover row. Establish availability with a scoped metric query; investigate Discover identity and supported resource profiles separately using actual dimensions and current guidance. Missing traces or a Discover row does not prove ingestion failure. Link the metric explorer when useful.
Use available last9-logs or last9-traces for separate log/span tasks; neither is required.
references/billing.md (opens in a new tab)references/dms.md (opens in a new tab)references/dynamodb.md (opens in a new tab)references/ec2.md (opens in a new tab)references/elasticache.md (opens in a new tab)references/kms.md (opens in a new tab)references/msk.md (opens in a new tab)references/rds-aurora.md (opens in a new tab)references/s3.md (opens in a new tab)references/sqs.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
6 skills in this plugin
/go-agent-installInstall Last9 go-agent instrumentation into a Go service — base setup, chi router, database/sql tracing, and opt-in features like HTTP request/response body capture, with build and telemetry verification. Use when the user wants to add Last9 tracing to a Go app, "install go-agent", "instrument my Go service with Last9", "add Last9 tracing to chi", or "capture request/response bodies"./last9-apiCall the Last9 REST API from the command line with a stdlib Python helper that handles refresh-token exchange, access-token caching, and the X-LAST9-API-TOKEN header. Use when calling the Last9 REST API from scripts, CI, or an agent without the MCP server — exchanging refresh tokens for access tokens, sending change events, querying logs or traces over HTTP, migrating Alertmanager rules ("last9 api", "access token", "refresh token", "change events", "X-LAST9-API-TOKEN")./last9-emit-telemetryEmit isolated, attributable Last9 OTLP metrics, logs, and traces for testing alerts, investigations, service profiles, and correlation. Use when generating synthetic Last9 telemetry, running telemetrygen against a Last9 OTLP endpoint, seeding an acceptance_run, or verifying that test signals are queryable — not for creating alerts, rules, dashboards, or production instrumentation./last9-logsQuery Last9 logs effectively — service-first scoping, attribute filters over body search, aggregate-then-drill. Use when querying or searching Last9 logs, finding log errors, building a get_logs logjson pipeline, or debugging a symptom through logs ("query logs", "find logs", "search logs", "log errors")./last9-tracesGuided trace investigation and tracejson query reference for Last9. Interviews the user with 5 targeted questions (service, environment, time window, symptom, scope), fires the right tool call, and carries the reference card for get_traces tracejson pipelines. Use when investigating a trace issue, debugging a service, building or fixing a tracejson query, or when user says "diagnose" / "investigate" / "what's wrong with".npx claudepluginhub last9/ai-toolkit --plugin last9