← ClaudeAtlas

prometheus-clilisted

Query Prometheus metrics using the HTTP API via curl. Use for instant queries, range queries, metadata lookups, and alert/rule inspection.
abdullahkhawer/devops-skills · ★ 7 · DevOps & Infrastructure · score 78
Install: claude install-skill abdullahkhawer/devops-skills
# Prometheus CLI Skill Use the instance and rules below when constructing all Prometheus API commands. ## Instances Update the table below with your Prometheus instance URLs before using this skill: | Environment | Base URL | Token File | |---|---|---| | Production | `https://<your-prometheus-prod-url>` | `~/.prometheus/prod.token` | | Staging | `https://<your-prometheus-staging-url>` | `~/.prometheus/staging.token` | If the target instance is unclear, ask the user before running any command. ## Prerequisites (one-time setup by user) Obtain a Prometheus API token for each instance you intend to use and save it to the corresponding token file (see instance table above). Never print or display token values. Do not perform these steps yourself. For each instance: 1. Obtain an API token (via your team or the monitoring platform) 2. Save it: ```bash mkdir -p ~/.prometheus && echo "<your-api-token>" > <TOKEN_FILE> && chmod 600 <TOKEN_FILE> ``` ## Command Format All API calls use `curl` with the token read from the instance's token file (see instance table above): ```bash curl -s -H "Authorization: Bearer $(cat <TOKEN_FILE>)" \ "<BASE_URL>/api/v1/<endpoint>" | jq . ``` Example (production): ```bash curl -s -H "Authorization: Bearer $(cat ~/.prometheus/prod.token)" \ "https://<your-prometheus-prod-url>/api/v1/query?query=up" | jq . ``` ## Available API Endpoints ### Read-only (safe, no confirmation needed) | Endpoint | Description | |---|---| | `/api/v1/query?quer