cx-infra
Original:🇺🇸 English
Translated
Query Coralogix infrastructure resources with the `cx infra` CLI — discover monitored resource types, list resources, check per-resource data. Use when the user asks to "show resource types", "list infrastructure resources", "what resources of this kind are monitored", "list resources of this kind", "is this resource healthy", "resource health history", "when did this resource go critical", "get raw resource data", "infrastructure inventory", "find resources by name", "filter resources by service or environment", or wants to explore infrastructure resources and their data.
2installs
Sourcecoralogix/cx-cli
Added on
NPX Install
npx skill4agent add coralogix/cx-cli cx-infraTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Infrastructure Resources Skill
Use this skill to discover and inspect infrastructure resources — what exists, whether it
is healthy, and what its raw data contains.
CLI Commands
| Command | Purpose | Key flags |
|---|---|---|
| List available resource types (category/type pairs) | - |
| List resources of one category/type | |
| Daily health samples for one resource, oldest first | - |
| Raw resource document as JSON | - |
- All commands are read-only and support /
-o jsonfor structured output.-o agents - Multi-profile fan-out applies to and
typesonly. Repeatliston those to compare fleets across accounts.-p <profile>andhealth-historytake a resource id, which is scoped to one team, so they reject more than oneraw-data— run them once per profile instead.-p - is repeatable across different keys; allowed keys are
--scope,service,environment(e.g.team). Multiple keys combine with AND — a resource must match all of them. Each key accepts a single value and may be given at most once; repeating one (e.g.--scope environment=prod --scope service=checkout) is rejected. To cover several values for one key, run one query per value and combine the results.--scope service=a --scope service=b - Pagination: /
--start-rowdefine a row window (--end-rowis exclusive); the default is the first 100 rows, and omitting only--end-rowgives 100 rows from--end-row. Page through large fleets in windows (0-100, 100-200, …).--start-rownever pages for you — fleets can run to hundreds of thousands of resources, so it returns one window and reports the total.list - The window cannot reach past row 10,000. The API rejects any request whose
exceeds 10,000, so paging cannot enumerate a fleet larger than that even though
start-row + rowsreports its true size. In any case, narrow withtotal_countor--name-filterand page within each subset rather than trying to walk the whole list.--scope - wraps its rows in an envelope (
list,total_count,returned_count) — the other subcommands return bare arrays.resourcesis the fleet-wide match count, always present and independent of the window, so use it as the stop condition: keep paging whiletotal_count, subject to the 10,000-row ceiling above.start_row + returned_count < total_count - Pass resource IDs exactly as returned by (quote them — they contain
listand:); the CLI percent-encodes them for you.=
Inspection Workflow
Three steps, and only because each one supplies an input the next one requires:
gives the mandatory /, gives the .
Answering "is healthy?" is these three calls — nothing more.
types--category--typelistresource_idweb-server-1-
Discover what exists — categories and types are dynamic, so never guess:bash
cx infra resources types -o json -
List resources of that category/type, narrowing with name and scope filters:bash
cx infra resources list --category Hosts --type EC2_Instances \ --name-filter web --scope environment=prod -o json -
Inspect one resource using afrom step 2. Statuses are
resource_id,Healthy, orCritical, one sample per day, oldest first:Unmonitoredbashcx infra resources health-history "1001234:host_id=i-abc123" -o jsonis the alternative to this step, not a follow-on — use it instead when you need source-specific detail rather than health.raw-data
Examples
Just the ids and names
bash
# Rows live under .resources — `list` returns an envelope
cx infra resources list --category Hosts --type EC2_Instances -o json \
| jq '[.resources[] | {resource_id, name}]'Check fleet size, and whether one window covered it
bash
cx infra resources list --category Hosts --type EC2_Instances -o json \
| jq '{total_count, returned_count}'
# Next window, if there is one
cx infra resources list --category Hosts --type EC2_Instances \
--start-row 100 --end-row 200 -o jsonFind when a resource went critical
bash
# health-history returns a bare array, so no .resources here
cx infra resources health-history "1001234:host_id=i-abc123" -o json \
| jq '[.[] | select(.status == "Critical")]'Read the raw resource document
bash
# Source-specific detail: tags, instance metadata, configuration
cx infra resources raw-data "1001234:host_id=i-abc123" -o jsonKey Principles
- Discover before listing — and
--categoryare required; always start from--type.cx infra resources types - Quote resource IDs and pass them verbatim — they embed ,
:, and|; the CLI handles URL encoding.= - Scope keys are a fixed set (,
service,environment) — unknown keys are rejected client-side before any request is made.team - A missing raw document is not an error — exits 0 and emits an empty result on stdout:
raw-datain[],jsonin[0]:, andagentsin text. Only the noteNo raw data found.goes to stderr. Parse the empty stdout result as a cleanly absent document, not a failure — and do not expect stdout to be blank.no raw data for this resource - Use with
-o jsonfor filtering; usejqfor token-efficient output in agent contexts.-o agents - Multi-profile fan-out is for and
typesonly — repeatinglisttags each row with its profile so fleets can be compared across accounts. The row window applies per profile, so-p <profile>adds alistbreakdown — page each profile against its owncounts_by_profile, not the aggregate.total_countandhealth-historyerror on a secondraw-data.-p - A resource id never crosses profiles — it embeds the team id
(), so an id from one account cannot resolve in another. When a multi-profile
1001234:host_id=…turns up something worth inspecting, note itslistfield and query that single profile for its health or raw data.profile - Infra health is its own concept — the /
Healthy/Criticalstatuses are computed by the infrastructure domain and are not the same as Service Catalog health. Correlate them with telemetry signals; do not treat them as interchangeable.Unmonitored - never leaves this skill — pass it only to
resource_idandhealth-history. For every other command, pivot on the resourceraw-dataor thenamescope value.service
Related Skills
Bridge to these skills using the resource name or the service scope
value — never the resource id, which only this skill understands:
- —
cx-telemetry-queryingdiscovers which log/span fields contain the resource name;cx search-fields "<name>" -s valuequeries the service's telemetry. Correlate acx logs "filter $l.subsystemname == '<service>'"health day with error logs or CPU metrics.Critical - —
cx-alertsfinds alert definitions matching the resource or its service by substring.cx alerts list --name "<name-or-service>" - —
cx-dashboardsandcx dashboards search "<name-or-service> ..."find dashboards semantically; pair withcx dashboards query-search --description "..."to thensearch-fields -s valuethe exact field holding the resource name.query-search --field