How-to

How the elku-monitoring AI skill works

A 5-minute guide for end users: install the skill into your AI agent, point it at your tenant's monitoring backend, and start asking questions in plain English.

TL;DR

  1. Open Profile → Agent API Keys (/profile#agent-api-keys), click Create, copy the elku_live_… key (shown once).

  2. Run the installer in a terminal:

    curl -fsSL https://elkutils.com/api/agent/install.sh | bash

    It prompts for the key, validates it, and writes the skill to ~/.cursor/skills/elku-monitoring/.

  3. Open Cursor (or your AI agent) in any project and ask: "use the elku-monitoring skill — what alerts are firing?"

What does the skill actually give my agent?

A skill, in agent terms, is a small bundle of files (a SKILL.md describing the API and an elku-prom curl wrapper) that teaches an AI agent how to talk to a specific service. The elku-monitoring skill teaches your agent to talk to your tenant's Prometheus through the Agentic Monitoring API on elkutils.com.

  • Per-tenant isolation

    Your API key is scoped to your tenant only. The agent literally cannot see another customer's data — there is no cross-tenant surface to leak.

  • Read-only by design

    Only Prometheus read verbs are exposed (query, query_range, alerts, rules, health). No /admin/tsdb, no writes, no deletes.

  • Rich alert context

    Every alert and rule ships with description, impact, and runbook annotations so the AI can recommend curated remediation, not hallucinated fixes.

  • One key, all tools

    The skill installs into Cursor today and works with any agent that can run a curl command — Claude Code, Copilot CLI, custom MCP, etc.

Install it (3 minutes)

  1. 1

    Generate an API key

    Sign in and go to Profile → Agent API Keys (/profile#agent-api-keys). Pick a name like "cursor-laptop", click Create, and copy the key — it starts with elku_live_ and is shown once. Store it in a password manager; if you lose it, just create a new one and revoke the old.

  2. 2

    Run the installer

    In any terminal:

    curl -fsSL https://elkutils.com/api/agent/install.sh | bash

    The installer asks for ELKU_API_KEY on the terminal so the key never lands in your shell history. It hits /api/agent/v1/prometheus/health with the key to make sure it works, then writes:

    • ~/.cursor/skills/elku-monitoring/SKILL.md — the skill manifest your agent reads.
    • ~/.cursor/skills/elku-monitoring/elku-prom — a tiny curl wrapper for one-off CLI checks.
  3. 3

    Tell your shell about the key

    Add the key to your shell rc file (so the agent can read it every time you open a terminal):

    export ELKU_API_KEY=elku_live_...
    export PATH="$HOME/.cursor/skills/elku-monitoring:$PATH"

    Restart your terminal (or source the rc file).

How to use it from your agent

You don't have to memorise endpoints — just mention the skill in your prompt. Cursor (and most agent runtimes) auto-discover the installed skill and decide when to call it. Here are some prompts that map cleanly to a single API call:

You ask

“Are any of my Elasticsearch alerts firing right now?”

Agent calls
GET /api/agent/v1/prometheus/alerts

The agent reads the live alerts list, including the impact and runbook annotations the monitor-agent stack ships, and walks you through remediation step-by-step.

You ask

“Show me JVM heap usage on my data nodes for the last 6 hours.”

Agent calls
POST /api/agent/v1/prometheus/query_range

The agent picks the right PromQL (elasticsearch_jvm_memory_used_bytes / max_bytes), bounds the window to 6 hours with a sane step, and summarises the trend in plain English.

You ask

“What alerts WOULD fire on my cluster if shards became unassigned?”

Agent calls
GET /api/agent/v1/prometheus/rules

Rules are exposed even when nothing is firing — the agent can preview the runbook of any alert before you ever hit the condition.

A simple end-to-end example

Imagine you open Cursor in your repo and your cluster is suddenly slower than usual. You type:

“Use the elku-monitoring skill. Are there any alerts firing on my Elasticsearch cluster, and if yes, walk me through the runbook.”

Behind the scenes the agent does this:

# 1. Read live alerts
curl -H "Authorization: Bearer $ELKU_API_KEY" \
  https://elkutils.com/api/agent/v1/prometheus/alerts

→ {
  "alerts": [
    {
      "labels":  { "alertname": "ElasticsearchHighJVMHeap", "severity": "warning" },
      "annotations": {
        "summary":     "JVM heap >80% on a data node",
        "description": "Heap usage on data-2 has been above 80% for 10m.",
        "impact":      "GC pauses are increasing query latency.",
        "runbook":     "1) check shard balance  2) drop low-value indices  3) consider adding a node"
      },
      "state": "firing"
    }
  ]
}

# 2. (Optional) drill into the metric for context
curl -X POST -H "Authorization: Bearer $ELKU_API_KEY" \
  https://elkutils.com/api/agent/v1/prometheus/query_range \
  -d '{
    "query": "100 * elasticsearch_jvm_memory_used_bytes{area=\"heap\"} / elasticsearch_jvm_memory_max_bytes{area=\"heap\"}",
    "start": "now-1h", "end": "now", "step": "60s"
  }'

The agent then summarises in plain English: "Heap on data-2 is at 85%. The runbook recommends checking shard balance first — want me to query the unassigned shards metric?" You stay in your editor; the AI does the curl chasing.

Demo

Here is what a real interaction looks like inside Cursor. You mention the skill with the @ symbol and ask a plain-English question — the agent does the rest.

You
@elku-monitoring Are any of my Elasticsearch alerts firing right now?
elku-monitoring
I found 1 active alert on your cluster:

⚠ ElasticsearchHighJVMHeap (warning, firing for 12m)
  Node: data-2 · Heap usage: 84%
  Impact: GC pauses are increasing query latency

  Runbook:
  1. Check shard balance across data nodes
  2. Drop low-value indices to free heap
  3. Consider adding a data node if load persists

Would you like me to check the JVM heap trend for the last hour?
You
Yes, show me the heap trend.
elku-monitoring
Here is the JVM heap usage on your data nodes over the last hour:

  data-1: 62% → 64% (stable)
  data-2: 78% → 84% (rising)
  data-3: 58% → 59% (stable)

Only data-2 shows a sustained increase. The runbook suggests checking shard balance first — want me to query the shard allocation metrics?

The agent uses the @elku-monitoring skill reference to discover the API endpoints and your embedded API key. You never need to write curl commands, remember endpoint paths, or manage authentication — the skill handles all of that.

Safety & FAQ

What if my key leaks?
Open Profile → Agent API Keys (/profile#agent-api-keys) and click Revoke. The next request with that key returns 401 immediately. Then create a fresh key.
Can the agent change anything in my cluster?
No. The API only exposes Prometheus read verbs. There is no write, delete, restart, or admin surface — even with a valid key.
Does the agent see other tenants' data?
No. Every API key resolves to exactly one tenant on the server side, and the request is routed to that tenant's isolated Prometheus namespace. There is no cross-tenant query path.
I get HTTP 429 — what now?
The API rate-limits per key to keep things fair. The response includes a Retry-After header — the agent (and the elku-prom wrapper) should back off for that many seconds before retrying.
I get HTTP 502 — what now?
That means your in-cluster Prometheus is unreachable. Run elku-prom /api/agent/v1/prometheus/health — if it reports reachable: false, check that your monitor-agent stack is still provisioned (/monitor/install).

Ready to give your AI agent eyes on your cluster?

The whole flow takes about 2 minutes — open the install page, copy the commands, done.