Loading...
Loading...
This skill should be used when the user asks to "query metrics", "investigate a metrics issue", "check CPU usage", "find slow services", "investigate production issues using metrics", "search for metrics", "search metric names", "run a PromQL query", "check error rate", "check latency", "look up a metric", "analyze system load", "check memory usage", "investigate infrastructure issues", "analyze custom metrics", "check node health", "investigate disk usage", or wants to explore Coralogix metrics data - including application, infrastructure, and custom metrics - using the cx CLI.
npx skill4agent add coralogix/cx-cli cx-metrics-querycx metricscx metrics| Command | Purpose | Key flags |
|---|---|---|
| Find metrics by name (wildcard or substring) | |
| List available label names for a metric | - |
| Instant PromQL query (single point in time) | |
| Range PromQL query (time series) | |
-o json-o agents# Exact substring match
cx metrics search --name http_requests
# Wildcard: find all CPU metrics
cx metrics search --name '*cpu*'
# List all metrics
cx metrics search --name '*'# Current state
cx metrics query 'up'
# At a specific time
cx metrics query 'rate(http_requests_total[5m])' --time 2024-01-01T12:00:00Z
# With output for further processing
cx metrics query 'sum by (service) (rate(http_errors_total[5m]))' -o agents# Last hour, default step (1m)
cx metrics query-range 'rate(http_requests_total[5m])'
# Custom window and step
cx metrics query-range 'sum by (service) (rate(http_requests_total[5m]))' \
--start now-6h --end now --step 5m
# Daily aggregation over the last week
cx metrics query-range 'max by () (max_over_time(cpu_usage[1d]))' \
--start now-7d --end now --step 1dcx metrics get-labels http_requests_total
# Returns: job, instance, method, route, status_code, ...nownow-1hnow-30mnow-2dnow-1w2024-01-01T00:00:00Z# Try domain-specific patterns first
cx metrics search --name '*http*'
cx metrics search --name '*error*'
cx metrics search --name '*latency*'
cx metrics search --name '*cpu*'
cx metrics search --name '*memory*'
# If nothing found, broaden the search
cx metrics search --name '*request*'
cx metrics search --name '*' # full list as last resort_count_countcx metrics get-labels <metric_name>cx metrics query--timecx metrics query-range--step[window]# Step 1: Check if metric exists and has data
cx metrics query 'http_requests_total'
# Step 2: Add label filters and aggregation
cx metrics query 'sum by (status) (rate(http_requests_total[5m]))'
# Step 3: Build the final diagnostic query
cx metrics query 'sum by (service) (rate(http_requests_total{status=~"5.."}[5m]))'cx metrics search --name '*<keyword>*'cx metrics get-labels <metric>{label!=""}sum by (service) (rate(http_requests_total{status=~"5.."}[5m]))sum by (service) (rate(http_requests_total[5m]))histogram_quantile(0.95, sum by (le, service) (rate(http_request_duration_seconds_bucket[5m])))upcx metrics query 'up'max_over_time(metric[1d])--step 1d{label!=""}sum by (...)references/promql-guidelines.md