cx-cost-optimization
БесплатноБез исполняемых скриптовНе проверенUse this skill when the user asks to "check data usage", "list TCO policies", "reduce Coralogix costs", "optimize observability spend", "lower our logging…
от coralogix★ 243 звезды на GitHubОб этом скилле
Cost Optimization Skill
Use this skill when investigating or reducing Coralogix data costs. It covers the full cost management lifecycle: measuring current spend, reviewing TCO policies, adjusting retention periods, and configuring archive storage for cold data.
CLI Commands
| Command | Subcommands | Purpose |
|---|---|---|
cx usage |
summary, daily, logs-count, spans-count, export-status, capabilities, query |
Measure current data consumption and billable usage |
cx tco |
list, get, create, update, delete, reorder, test, settings, settings-update |
Manage TCO (Total Cost of Ownership) policies |
cx retentions |
list, update, activate, status |
Manage data retention periods |
cx archive logs |
get, set |
Configure logs archive target |
cx archive metrics |
get, create, update, enable, disable, validate |
Configure metrics archive storage |
cx metrics query |
<promql> (positional), --time |
Query billing and usage metrics via PromQL (instant) |
cx metrics query-range |
<promql> (positional), --start/--end |
Query billing and usage metrics via PromQL (range) |
Key flags:
- All commands support
-o jsonfor structured output and-p <profile>for profile selection cx usage dailyaccepts--type processed-gbs|units|evaluation-tokensand--start/--endtime filterscx usage summaryaccepts--start/--endtime filterscx usage logs-countandcx usage spans-countaccept--start/--endtime filters, defaulting to the last 24h, plus--resolution(default1h),--subsystem-aggregation,--application-aggregation, and repeated--param KEY=VALUEfor API filter query params- Data usage summary and count endpoints are documented as newline-delimited JSON over
Accept: text/event-stream; the CLI handles that transport and normalizes count chunks into.result.logsCount[]or.result.spansCount[]. cx usage capabilitiesis the required first step: it returns the labels, measurements, units, and request limits that the public Data Usage Query API currently supports for the selected tenantcx usage queryis the required second step: submit only a JSON request derived from the immediately precedingcapabilitiesresponse with exactly one of--query '<json>'or--from-file <path>(--from-file -reads stdin)cx tco create/update,cx retentions update,cx archive logs set,cx archive metrics create/update/validateuse--from-file <path>(or-for stdin)
Authoritative Billable Usage Queries
For billable totals, quota units, plan consumption, or a supported usage breakdown, use this mandatory two-step workflow:
- Run
cx usage capabilitiesin the current session. - Build and run
cx usage queryusing only that response.
Do not call cx usage query first and do not guess labels, measurement kinds, units, filter values, intervals, or request limits. They are tenant-specific and can change.
# Inspect the currently valid dimensions and constraints
cx usage capabilities -o json
# Submit a capabilities-derived request inline
cx usage query --query '{"daily":{"relativeRange":"DAILY_RELATIVE_RANGE_LAST_7_DAYS"}}' -o json
# Or read the same request from a file or stdin
cx usage query --from-file usage-query.json -o json
printf '%s' '{"daily":{"relativeRange":"DAILY_RELATIVE_RANGE_LAST_7_DAYS"}}' \
| cx usage query --from-file - -o json
Load references/data-usage-query-api.md before creating the query body. It defines the capability and response schemas, valid interval forms, and limits.
Cost Investigation Workflow
Follow these steps to diagnose and reduce costs:
Step 1: Measure Current Usage
For billable totals, quota units, plan consumption, or supported breakdowns, first follow the mandatory two-step workflow above:
cx usage capabilities -o json
cx usage query --from-file usage-query.json -o json
Build usage-query.json only from the immediately preceding capabilities response. Do not use the legacy commands below as a substitute for an authoritative billing answer.
For a legacy consumption overview and log/span record counts, use:
cx usage summary -o json
cx usage summary --start now-30d -o json
cx usage daily --type processed-gbs --start now-7d -o json
cx usage logs-count --start now-7d --end now -o json
cx usage spans-count --start now-7d --end now -o json
Identify which data types consume the most volume. Use jq to sort:
cx usage summary -o json | jq '[.[] | {name, daily_avg: .avg_daily_gb}] | sort_by(.daily_avg) | reverse'
Step 2: Review TCO Policies
cx tco list -o json
cx tco settings -o json
TCO policies control which logs go to Frequent Search (expensive, fast) vs. Archive (cheap, slower). Check if high-volume, low-value logs are on Frequent Search:
cx tco list -o json | jq '.[] | select(.priority
Установить cx-cost-optimization в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл cx-cost-optimization?
Use this skill when the user asks to "check data usage", "list TCO policies", "reduce Coralogix costs", "optimize observability spend", "lower our logging bill", "data budget exceeded", "TCO policy", "retention tier", "archive storage", "ingestion costs", "frequent search vs archive", "why is our bill so high", "spending too much on logs", "data retention settings", "cost analysis", "usage breakdown", "optimize log volume", "control data ingestion", "archive cold data", "billing units", "plan consumption", "daily plan", "overage", "PAYG", "usage anomaly", "usage trend", "cx_data_usage_units", or wants to investigate, analyze, or reduce Coralogix data costs.
Как установить скилл cx-cost-optimization?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл cx-cost-optimization запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic