cx-service-catalog — скилл для Claude Code: метрики сервисов через CLI
Скилл учит агента вытаскивать метрики сервисов, баз данных, JVM и подов Kubernetes из Service Catalog Coralogix через cx service-catalog.
npx skills add coralogix/cx-cli --skill cx-service-catalog -a claude-codeЧто делает cx-service-catalog
Скилл описывает пять команд cx service-catalog: entity-types показывает, по каким типам сущностей у аккаунта есть данные, schema отдаёт список колонок и меток для одного типа, entities перечисляет известные сущности, data собирает агрегаты по всем сущностям типа, а entity-data — по одной конкретной. Все команды только читают и умеют -o json или -o toon.
Порядок такой: сначала entity-types, потом schema, потом entities, и лишь затем запрос данных. Так сделано потому, что каждая команда даёт вход для следующей. Тип сущности принимает короткие формы вроде service, k8s-pod, jvm-gc — регистр и дефисы не важны, а неизвестное значение отклоняется на клиенте, до запроса. Флаг --column обязателен и повторяем, но колонки у каждого типа свои: то, что работает для service, для k8s-pod может не существовать. Это повод перепроверять schema при смене типа.
--filter повторяется только по разным меткам, значения одной метки перечисляются через запятую. --limit, --sort-column и --sort-order действуют лишь при --aggregation table; для timeseries CLI отклоняет такую комбинацию сразу, потому что бэкенд эти флаги молча игнорирует. Ответы с ошибкой в отдельной колонке — не пустой результат, а повод разбираться.
Какие задачи решает
- посмотреть задержку сервиса за последний час
- найти поды Kubernetes с наибольшим потреблением памяти
- сравнить сервисы по частоте ошибок
- выяснить, какие типы сущностей вообще есть в аккаунте
- построить график здоровья сервиса по времени
Примеры запросов агенту
- покажи список сервисов в Service Catalog
- какие типы сущностей есть в аккаунте?
- выведи задержку сервиса checkout/api за последние сутки
Как установить cx-service-catalog
1Через Skills CLI (Vercel)
npx skills add coralogix/cx-cli --skill cx-service-catalog -a claude-code2Вручную: положить файлы
~/.claude/skills/cx-service-catalog/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/cx-service-catalog/
1Через Skills CLI (Vercel)
npx skills add coralogix/cx-cli --skill cx-service-catalog -a codex2Вручную: положить файлы
.agents/skills/cx-service-catalog/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add coralogix/cx-cli --skill cx-service-catalog -a cursor2Вручную: положить файлы
.cursor/skills/cx-service-catalog/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install coralogix/cx-cli cx-service-catalog2Вручную: положить файлы
.github/skills/cx-service-catalog/SKILL.md1Через Skills CLI (Vercel)
npx skills add coralogix/cx-cli --skill cx-service-catalog -a gemini-cli2Командой платформы
gemini skills install https://github.com/coralogix/cx-cli --path skills/cx-service-catalogВручную: положить файлы
.devin/skills/cx-service-catalog/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add coralogix/cx-cli --skill cx-service-catalog -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Из того же набора16
Похожие
Рядом в теме «DevOps и инфраструктура»
Всё по теме «DevOps и инфраструктура» →Вопросы о cx-service-catalog
Как установить cx-service-catalog в Claude?
Выполните npx skills add coralogix/cx-cli --skill cx-service-catalog -a claude-code. Скилл появится в ~/.claude/skills/cx-service-catalog/SKILL.md.
Что делает cx-service-catalog?
Учит агента работать с Service Catalog Coralogix через CLI cx: находить типы сущностей, смотреть их схему, перечислять сущности и забирать агрегированные или временные ряды метрик.
Почему запрос данных падает с ошибкой по колонке?
Колонки задаются отдельно для каждого типа сущности. Сначала посмотрите cx service-catalog schema <entity-type> и подставьте id оттуда — чужие значения API не примет.
Исходный текст
SKILL.md · Apache-2.0
---
name: cx-service-catalog
description: >
Query Coralogix's Service Catalog (APM v2 entities) with the `cx service-catalog`
CLI — discover entity types, list known entities, check their schema, and pull
aggregated or timeseries data for services, databases, operations, JVMs, and
Kubernetes pods. Use when the user asks to "list services", "what entity types
exist", "show me service latency", "check error rate for a service",
"which pods are using the most memory", "database operation performance",
"JVM GC pauses", "service health over time", "compare services by latency",
"what columns are available for this entity type", "service catalog schema",
or wants to explore APM entities and their metrics.
metadata:
version: "0.1.0"
---
# Service Catalog Skill
Use this skill to discover and query **Service Catalog entities** — services,
databases, operations, database operations, JVMs, JVM GC, Kubernetes pods, and
transactions — and their columnar metrics (latency, error rate, health, resource
usage, etc.) via the v2 Service Catalog API.
## CLI Commands
| Command | Purpose | Key flags |
|---|---|---|
| `cx service-catalog entity-types` | List entity types this account has data for | - |
| `cx service-catalog schema <entity-type>` | Columns/labels schema for one entity type | - |
| `cx service-catalog entities <entity-type>` | Known entities of one type (e.g. service names) | - |
| `cx service-catalog data <entity-type>` | Aggregated column data across every entity of a type | `--start`, `--end`, `--column` (required, repeatable); `--group-by`, `--filter`, `--aggregation`, `--limit`, `--sort-column`, `--sort-order` |
| `cx service-catalog entity-data <entity-type> <entity-id>` | Column data for one named entity (drilldown) | `--start`, `--end`, `--column` (required, repeatable); `--group-by`, `--filter`, `--aggregation` |
- All commands are **read-only** and support `-o json` / `-o toon` for
structured output.
- **Entity type accepts short forms**: `service`, `database`, `operation`,
`database-operation`, `jvm`, `jvm-gc`, `k8s-pod`, `transaction` (case-insensitive,
hyphens or underscores). The full proto name (`ENTITY_TYPE_K8S_POD`) also works.
Unknown values are rejected client-side before any request is made.
- `--start`/`--end` accept `now`, `now-1h`-style relative expressions, or
RFC3339 timestamps.
- `--column` is **required** and repeatable — discover valid column ids with
`cx service-catalog schema <entity-type>` first; the API rejects unknown ones.
- `--filter label=value1,value2` is repeatable **across distinct labels only**
(filters AND together); combine multiple values for the same label with commas
rather than repeating the flag — repeating a label is rejected client-side.
- `--aggregation` is `table` (default behavior when combined with `--limit`/
`--sort-column`/`--sort-order`) or `timeseries`. **`--limit`, `--sort-column`,
and `--sort-order` only apply to `table`** — the backend silently ignores them
for `timeseries`, so the CLI rejects that combination up front rather than
sending a request whose flags are quietly dropped.
- `entity-data` percent-encodes the entity id for you — pass it as returned by
`entities` (e.g. `checkout/api`), quoted if it contains `/`.
## Inspection Workflow
Four steps, and only because each one supplies an input the next one requires:
`entity-types` gives valid `<entity-type>` values, `schema` gives valid
`--column` ids, `entities` gives the `entity-id` for a drilldown.
1. **Discover what entity types exist** — never guess, they vary by account:
```bash
cx service-catalog entity-types -o json
```
2. **Check the schema** for one entity type to find valid column ids and
filterable/groupable labels:
```bash
cx service-catalog schema service -o json
```
3. **List known entities** of that type (e.g. service names):
```bash
cx service-catalog entities service -o json
```
4. **Query data** — aggregated across all entities, or scoped to one. Column
ids, filter/group-by labels, and entity ids below are placeholders — always
substitute values returned by `schema`/`entities` for the entity type in
question, they vary by account and entity type:
```bash
cx service-catalog data <entity-type> --start now-1h --end now \
--column <column-id> --column <column-id> -o json
cx service-catalog entity-data <entity-type> <entity-id> --start now-1h --end now \
--column <column-id> -o json
```
## Examples
The commands below use `service` and `k8s-pod` for concreteness, but every
`<column-id>`, `<filterable-label>`, `<groupable-label>`, and `<entity-id>`
must come from that entity type's own `schema`/`entities` output — never
assume a column or label from one entity type exists on another.
### Top 5 entities by a metric in the last hour
```bash
cx service-catalog schema service -o json # discover column ids first
cx service-catalog data service --start now-1h --end now \
--column <column-id> --aggregation table \
--sort-column <column-id> --sort-order desc --limit 5 -o json
```
### Filter to one label value
```bash
cx service-catalog schema service -o json # discover filterable_labels first
cx service-catalog data service --start now-1h --end now \
--column <column-id> --column <column-id> \
--filter <filterable-label>=<value> -o json
```
### Group by a label
```bash
cx service-catalog schema service -o json # discover groupable_labels first
cx service-catalog data service --start now-1h --end now \
--column <column-id> --group-by <groupable-label> -o json
```
### Kubernetes pod resource saturation
```bash
cx service-catalog schema k8s-pod -o json # discover column ids first
cx service-catalog data k8s-pod --start now-1h --end now \
--column <column-id> --column <column-id> --column <column-id> -o json
```
### Latency over time for one entity
```bash
cx service-catalog entities service -o json # discover entity ids first
cx service-catalog entity-data service <entity-id> --start now-24h --end now \
--column <column-id> --aggregation timeseries -o json
```
### Just the rows
```bash
# Table responses live under .rows; timeseries under .series
cx service-catalog data service --start now-1h --end now \
--column <column-id> -o json | jq '.rows'
```
## Key Principles
- **Discover before querying** — `entity-types` and `schema` are cheap and
answer "what's valid here" before spending a `data`/`entity-data` call on a
guess.
- **`--column` values are per-entity-type** — a column valid for `service` may
not exist for `k8s-pod`; always re-check `schema` when switching entity types.
- **Malformed responses are errors, not silent empty results** — a column that
is neither a value nor an error (or both) fails loudly rather than producing
a partial or empty row, so a non-zero exit means investigate, not "no data".
- **A column-level error is not a command failure** — an individual column can
come back as `{"error": "..."}` inside an otherwise successful row (e.g. a
query timeout for just that column); check per-column before assuming the
whole request failed.
- **`table` vs `timeseries` are mutually exclusive result shapes** — `table`
responses are flat rows suitable for `-o json | jq '.rows'`; `timeseries`
responses nest datapoints per series and are best consumed as raw JSON rather
than forced into a table.
- **Use `-o json` with `jq`** for filtering; use `-o toon` for token-efficient
output in agent contexts.
- **Multi-profile fan-out** works on every subcommand — repeat `-p <profile>` to
compare the same entity type/data across accounts; rows and series are tagged
with `profile` when more than one is given.
## Related Skills
- **`cx-infra`** — infrastructure resource health (hosts, containers) is a
distinct concept from Service Catalog entity health; use `cx-infra` for
host/instance-level monitoring and this skill for application/service-level
APM entities.
- **`cx-telemetry-querying`** — once a service or pod name surfaces from this
skill's commands, pivot to raw telemetry: `cx logs "filter $l.subsystemname ==
'<service>'"` or `cx search-fields "<name>" -s value` to find related log/span
fields. Correlate a latency or error spike with the underlying logs/spans.
- **`cx-alerts`** — `cx alerts list --name "<service-name>"` finds alert
definitions matching a service surfaced by this skill.
- **`cx-dashboards`** — `cx dashboards search "<service-name> ..."` finds
dashboards built around a service found here.
© coralogix · Apache-2.0 · coralogix/cx-cli