/cpln:logql-observabilityfrom cpln
Queries workload logs with LogQL on Control Plane via MCP tool or CLI. Use for log search, troubleshooting, access/egress logs, cron run logs, retention, or Grafana integration.
Ships in cpln. 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.
Control Plane stores workload stdout/stderr in Loki and queries it with LogQL. The org is the Loki tenant — it comes from the endpoint path, so org is never a query label and queries cannot cross orgs. Reading logs requires the org-level readLogs permission, and the in-pod CPLN_TOKEN cannot authenticate to the logs endpoint — use a user or service-account token (see the workload skill). The recurring agent failure is passing a raw query to the MCP tool alongside structured params: a raw query replaces them entirely (the tool rejects the combination), so a raw query must embed every label itself.
mcp__cpln__get_workload_logs: structured params gvc, workload, container, location, filter (literal substring, LogQL |=, not regex); window since (default 1h) or from/to (ISO 8601, from inclusive, to exclusive); limit (default 30, max 999, single request: truncated: true means narrow the window or filter harder); order (oldest_first default, or newest_first). For regex, parsers, or the replica/stream/version labels, pass a raw query (max 500 chars) instead of the structured selectors.logs add-on): the same tool with cluster in place of gvc, narrowed by namespace, pod, container, node, and job (kubernetes-pods, kubelet, kernel, docker-containers, audit). These streams carry cluster_name and cluster_alias, never gvc; Control Plane workloads running on the cluster log under their GVC.cpln logs '<LOGQL>' — interactive debugging (live --tail), scripts, CI.# Defaults: --since 1h, --limit 30, --direction forward
cpln logs '{gvc="GVC", workload="WORKLOAD"}' --org ORG
cpln logs '{gvc="GVC", workload="WORKLOAD"} |= "error"' --limit 100
cpln logs '{gvc="GVC", workload="WORKLOAD", container="main"}' --since 7d
cpln logs '{gvc="GVC", workload="WORKLOAD"}' --tail # live follow; the server ends a tail session after 30m
cpln logs '{gvc="GVC", workload="WORKLOAD"}' \
--from 2026-06-01T00:00:00Z --to 2026-06-02T00:00:00Z # ISO 8601 or relative (7d, now-1M); from inclusive, to exclusive
cpln logs '{gvc="GVC", workload="WORKLOAD"} |= "error"' --since 24h --limit 0 # 0 = unlimited, auto-paginates
cpln logs '{gvc="GVC", workload="WORKLOAD"}' -o jsonl # one JSON object per line; -o raw = bare lines
--since takes relative durations (ms s m h d w mo y, compound like 1h30m). --from/--to (CLI) take an ISO 8601 timestamp or a relative duration meaning that long ago — --from 7d, --from now-1M, --to now-30m (the CLI accepts M for months; the mcp__cpln__get_workload_logs tool takes ISO 8601 only).cpln workload eventlog WORKLOAD (alias cpln workload log) is resource event history, not container output — for application logs always use cpln logs.| Label | Value |
|---|---|
gvc | GVC name |
workload | Workload name |
container | Container name, or a built-in stream below |
location | Deployment location, e.g. aws-us-east-1 |
provider | Cloud provider |
replica | Replica (pod) name — unique per cron execution |
stream | stdout or stderr |
version | Workload deployment version that wrote the line |
At least one non-empty matcher is required; regex matchers work — {gvc=~".+"} spans every GVC in the org.
| Operator | Meaning | Example |
|---|---|---|
|= "text" | contains | |= "error" |
!= "text" | does not contain | != "health" |
|~ "regex" | matches regex | |~ "timeout|crash" |
!~ "regex" | does not match | !~ "debug|trace" |
Loki is current (3.x), so full LogQL works: parsers (| json, | logfmt, | pattern, | regexp), post-parse label filters (| latency > 100), line_format, and metric queries (count_over_time, rate, sum ... by). The CLI and MCP tool print log lines only — run metric queries in Grafana: the Explore on Grafana link on the console Logs page opens it with the query prefilled (the org grafanaAdmin permission grants the Grafana Admin role; everyone else is Viewer).
{gvc="GVC", workload="WORKLOAD"} |= "error" != "health" # errors minus noise
{gvc="GVC", workload="WORKLOAD"} |~ "panic|fatal|exception" # crashes and stack traces
{gvc="GVC", workload="WORKLOAD", container="_accesslog"} |= "\" 50" # HTTP 5xx in access logs
sum(count_over_time({gvc="GVC", container="_accesslog"} |= "\" 50"[1m])) by (workload) # 5xx rate (Grafana)
| Selector | Contents |
|---|---|
container="_accesslog" | Inbound requests (Envoy access-log format) on the workload's ports |
container="_requestlog" | The workload's outbound (egress) requests through the sidecar, same format |
workload="_loadbalancer" | Access logs of the GVC's dedicated load balancer |
container="_alerts" | Threat-detection (Falco) alerts, with extra labels rule, priority, source |
Platform health probes and unroutable-request noise are filtered out of _accesslog by design, so probe traffic never shows up there. Sidecar and system containers (istio-init, istio-validation, cpln-*, debugger-*) are never collected.
... [truncated N bytes] suffix; empty lines are dropped.#### Replica logs were rate-limited: N lines in the last Xs were not collected ####.observability.logsRetentionDays, default 30 (0 turns log collection off entirely; the org-management skill owns org spec edits). Queries beyond retention return nothing, not an error.{gvc=, workload=} on a cron workload interleaves every past run. Each execution runs in its own replica, so scope to one run with the replica label plus the execution's time window.
1. List executions. mcp__cpln__list_deployments with location returns the full deployment JSON; status.jobExecutions[] holds the per-execution metadata (without location the tool returns only a readiness summary). CLI:
cpln workload get-deployments WORKLOAD --gvc GVC -o json | jq '
[(.items // .)[] as $d | $d.status.jobExecutions[]? | . + {location: $d.name}]
| sort_by(.startTime)[] | {location, name, status, startTime, completionTime, replica}'
Schema facts (nodelibs cronjob.ts) that bite scripts:
status is one of successful | failed | active | pending | invalid | removed (default pending). Running means status == "active" AND no completionTime; a missing completionTime alone proves nothing (the schema warns it is not an indication of success).completionTime: null is stripped server-side and startTime may be absent for never-started runs — each field is present-with-value or absent, so guard flags with ${VAR:+--from "$VAR"} and jq // empty.replica is optional: when missing, the run never got a pod and there are no logs; diagnose with the execution's containers map and message field (aggregated pod events) and mcp__cpln__diagnose_workload, which returns the newest events.2. Query that replica, time-bounded. MCP: raw query embedding ALL labels (structured params must be omitted) plus from/to. CLI:
cpln logs '{gvc="GVC", workload="WORKLOAD", location="LOCATION", replica="REPLICA-ID"}' \
--org ORG --from START_TIME --to COMPLETION_TIME
jobExecutions timestamps are ISO 8601 and pass straight through. Pad the window a minute or two on each side, and widen it before concluding logs do not exist. For a live run (active, no completionTime), drop --to and add --tail.
CI/CD and headless use: set CPLN_TOKEN and run cpln logs directly (no profile needed); the principal must hold org readLogs.
| Symptom | Cause and fix |
|---|---|
403 requires permission "readLogs" in org | Grant readLogs on the org via policy (it implies view) |
Invalid --from format: ... | --from/--to accept an ISO 8601 timestamp or a relative duration (7d, now-1M); correct the value |
| Empty result for known activity | Window outside retention (default 30d), span over 31 days, or filters too narrow; app may not write to stdout/stderr |
#### Replica logs were rate-limited ... #### marker | Per-replica cap was hit; lines in that interval are gone — reduce log volume |
Line ends with ... [truncated N bytes] | 16 KiB per-line cap — emit smaller lines |
Health checks absent from _accesslog | Filtered by design; probe failures surface in the events mcp__cpln__diagnose_workload returns |
MCP rejects raw query combined with workload etc. | A raw query replaces the structured params — embed all labels in the query itself |
cpln workload log shows no app output | That is the eventlog alias; use cpln logs |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
logql, loki, control-plane, log-observability, workload-logs
npx claudepluginhub controlplane-com/ai-plugin --plugin cpln32 skills in this plugin
/access-controlPrimary skill for access control, policies, and RBAC on Control Plane. Use when the user asks about permissions, policies, service accounts, user access, group membership, bindings, who can do what, least-privilege, or IAM./audit-complianceAudit trail and compliance on Control Plane. Use when the user asks about audit logs, who changed what, change tracking, audit contexts, writing custom audit events, security monitoring, SOC 2, HIPAA, or PCI compliance./autoscaling-capacityWorkload autoscaling and Capacity AI on Control Plane. Use when the user asks about scaling up/down, min/max replicas, scale-to-zero, concurrency/RPS/CPU/memory/latency scaling, KEDA, event-driven scaling, or right-sizing./cdn-rate-limitingCDN caching and request rate limiting for Control Plane workloads. Use when the user asks about CDN, Cloudflare, CloudFront, edge caching, rate limiting, request throttling, per-key or per-route limits, or DDoS protection./cplnWrites cpln CLI commands and workflows for Control Plane. Use when the user asks about cpln login, cpln apply, cpln workload, CLI or CI/CD deploys, container debugging with cpln exec/logs, or any cpln resource command./create-appWrites, builds, and deploys an app the user asks for in the chat, with no repository and no image yet. Use when the user asks to create, generate, write, vibe-code, prototype, or scaffold an app, API, site, bot, game, or service and run it on Control Plane, or to change an app made this way.Other plugins' skills for the same job