/last9:last9-emit-telemetryfrom last9
Emit 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.
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.
None: SKILL.md is the whole skill.
Emit a short, bounded burst of synthetic metrics, logs, and/or traces into an explicit Last9 org so agents can test alerts, investigations, service profiles, and correlation. Every signal carries a generated acceptance_run UUID. This skill never creates or mutates alerts, rules, dashboards, or deployments.
Operating principle: isolate, attribute, then prove queryability. OTLP client success is not Last9 acceptance. Do not claim the run landed until a readback query against the intended datasource finds the run ID.
Stop unless all of these are present:
Authorization values, or --otlp-header contents.telemetrygen on PATH (or an equivalent generator that honors the same attribute and endpoint rules). Install with go install github.com/open-telemetry/opentelemetry-collector-contrib/cmd/[email protected].prometheus_*, get_logs, get_traces). If those tools are missing, emit may still run, but you must not claim queryability.If the working tree is this repository, run the helper instead of hand-rolling telemetrygen (it normalizes endpoints, quotes attributes, and suppresses generator logs):
scripts/last9-emit-telemetry.sh \
--org <org-slug> \
--environment <environment> \
--credential-file <local-credential-file> \
--datasource <datasource-id> \
--signals metrics,logs,traces
--credential-env LAST9_OTLP_CREDENTIAL_FILE is also valid when that variable holds a path. Credential files stay local and untracked. Allowed keys only: OTEL_EXPORTER_OTLP_ENDPOINT / OTLP_ENDPOINT and OTEL_EXPORTER_OTLP_HEADERS / OTLP_HEADERS. Parse these keys as data; never source the file as shell code. Do not cat, echo, or commit the file. The authorized headers must override both generic and signal-specific OTLP header environment variables in the generator subprocess.
| # | Anti-pattern | Do this instead |
|---|---|---|
| 1 | Accepting a pasted token / --otlp-header / printing OTEL_EXPORTER_OTLP_HEADERS | Take a file path or env name; parse supported keys inside a subshell with set +x; never pass --otlp-header |
| 2 | telemetrygen --otlp-endpoint https://host:443/ (gRPC) | Normalize to host:port: strip https:// / http:// and trailing / before invoking |
| 3 | Showing telemetrygen config output (it logs exporter headers by default) | Suppress all generator stdout/stderr; bare or decoded secrets may have no recognizable marker; never set -x |
| 4 | Emitting without acceptance_run | Generate a UUID first; set resource service.name + acceptance_run and signal-level acceptance_run |
| 5 | Long/unbounded generate (--duration inf, --rate 0) | Default 5s, rate 1, workers 1; require positive values, capped at 60s, 100 per worker per second, 10 workers; enforce a per-child wall-clock deadline |
| 6 | Creating alerts, recording rules, dashboards, or deploy config as part of emit | Out of scope. Alert creation, rule mutation, and deployment need separate user authorization |
| 7 | "Export succeeded, so Last9 has it" | Distinguish OTLP client export from queryable in Last9; claim the latter only after readback finds the run ID |
| 8 | Retrying the write / duplicating resources when readback is empty | Classify the miss; do not emit again |
last9-emit-telemetry unless the user named one), credential path, and datasource. For a production target, get an extra explicit yes. Do not dump the credential file.acceptance_run. One UUID for the whole run. Refuse to emit if it is missing or not a UUID.s / ms), at most 60s; rate accepts a positive decimal up to 100; workers must be an integer from 1 to 10. Normalize the endpoint from the credential file (do not print headers) to host:port with a port from 1 to 65535; reject userinfo, queries, fragments, and line breaks.set +x, set OTEL_EXPORTER_OTLP_HEADERS and all three OTEL_EXPORTER_OTLP_{METRICS,LOGS,TRACES}_HEADERS to the authorized file value inside the subprocess, no --otlp-header, suppress all generator output. Repeat once per signal under a supervisor with a deadline of requested duration + 1s for normal shutdown. On expiry send TERM, wait at most 0.5s, then KILL if necessary and reap the child. Always record client_failed on expiry, even if the child exits 0 after TERM. The limit is per signal; signals run sequentially. The raw command below needs this supervision because telemetrygen’s duration timer cannot interrupt rate-token waits:telemetrygen <metrics|logs|traces> \
--otlp-endpoint '<host:port>' \
--duration 5s --rate 1 --workers 1 \
--service 'last9-emit-telemetry' \
--otlp-attributes 'service.name="last9-emit-telemetry"' \
--otlp-attributes 'acceptance_run="<uuid>"' \
--telemetry-attributes 'acceptance_run="<uuid>"'
For metrics, also set --otlp-metric-name last9.emit.telemetry. If overridden, the receipt must list the requested name and its possible Prometheus spelling, not the default; discover the actual stored name during readback. Use --otlp-insecure only for localhost plaintext; Last9 :443 endpoints stay on TLS.
acceptance_run, org, environment, signal types, metric names, service.name, start/end UTC, intended datasource, otlp_export (client_ok / client_failed), last9_queryable (no until readback). Never include headers, tokens, file contents, or raw generator config.otlp_export=client_ok means every generator process exited 0 before its wall-clock deadline. Queryable in Last9 requires a hit for acceptance_run on the intended datasource.
| Signal | Readback (same org, window covering the emit) |
|---|---|
| metrics | prometheus_instant_query / prometheus_range_query with datasource set, e.g. {acceptance_run="<uuid>"}. Discover __name__ if last9.emit.telemetry vs last9_emit_telemetry is unclear |
| logs | get_logs filter on attributes['acceptance_run'] or resources['acceptance_run'] (confirm via get_log_attributes_for_pipeline). Follow last9-logs |
| traces | get_traces filter on attributes['acceptance_run'] or resources['acceptance_run']. Follow last9-traces |
If MCP is connected to a different org than --org, treat that as routing, not propagation.
On empty or failed readback, pick one class and stop (no second emit):
| Class | When |
|---|---|
ingestion_propagation | Client export succeeded; the query itself succeeded; window covers the emit; datasource/org match; no series/rows yet |
wrong_datasource_or_routing | Query succeeded but org mismatch, datasource mismatch, or list_datasources shows a different intended TSDB/index than the one queried |
query_path_timeout | The read call timed out, 5xx'd, or the MCP tool failed — this does not prove absence |
Do not delete telemetry, datasources, alerts, or files automatically. Tell the user they can identify leftovers by acceptance_run / service.name=last9-emit-telemetry, that ingested points age out with retention, and that any local temp files the helper created can be removed by them. Leave credential files untouched.
last9-logs / last9-traces — query-side investigation after this run is queryable.Run scripts/last9-emit-telemetry-selftest.sh for validation, privacy, receipts, and deadline lifecycle checks. With the pinned telemetrygen installed, also run python3 scripts/last9-emit-telemetry-deadline-selftest.py --native: it uses a healthy local HTTP/protobuf receiver to exercise the native rate-limited workers for metrics, logs, and traces at 100ms, with rates 0.1 and 100. This loopback test does not establish Last9 ingestion or MCP readback.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub last9/ai-toolkit --plugin last96 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-cloudwatchInvestigate 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./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".