Skills Agentes

Clickhouse Managed Postgres Rca

Úsalo obligatoriamente para investigar problemas de rendimiento en una instancia Postgres gestionada por ClickHouse: analiza métricas de Prometheus y patrones de consultas lentas, y recomienda (sin aplicar) una solución.

Oficial
Estrellas
536

en todo el repo

Actividad
48

0–100, la ruta de este skill

Actualizado
hace 4 meses

último commit aquí

Commits
1

últimos 90 días

Contexto
1.2k tok

71 tok en reposo

Paquete
13 archivos

69 KB

Instalar

Funciona con cualquier agente que lea SKILL.md

npx -y skills add ClickHouse/agent-skills --skill clickhouse-managed-postgres-rca --agent claude-code

Se instala solo en este repositorio.

Qué hace

  • Ejecuta un flujo de RCA basado en evidencia para instancias de Postgres gestionadas por ClickHouse
  • Extrae métricas de Prometheus (postgresInstancePrometheusGet) y patrones de consultas lentas (slowQueryPatternsGetList)
  • Descubre el esquema OpenAPI en vivo para resolver nombres de campos y rutas antes de consultar
  • Clasifica la señal combinada según heurísticas (full scan, hot loop, congestión de escritura)
  • Redacta una recomendación con síntoma, evidencia, hipótesis y arreglos, sin aplicar ningún cambio

Úsalo cuando

  • El usuario reporta lentitud, alto CPU, bajo throughput, cache thrash u otro dolor inexplicado en una instancia Postgres gestionada por ClickHouse

No lo uses cuando

    Qué lo activa

    Di cualquiera de estas frases y el agente debería cargar este skill.

    • “Nuestra instancia de Postgres en ClickHouse Cloud está muy lenta, investiga por qué”
    • “¿Por qué el CPU de mi servicio Postgres gestionado está tan alto?”
    • “Analiza el cache hit ratio y las consultas lentas de este serviceId”

    SKILL.md

    En inglés

    ClickHouse Managed Postgres RCA

    When to use

    Trigger whenever a user reports slowness, high CPU, low throughput, cache thrash, or any unexplained pain on a ClickHouse-managed Postgres instance.

    What you have access to

    Two APIs on https://api.clickhouse.cloud (HTTP Basic auth using a ClickHouse Cloud API key/secret pair):

    • Prometheus metrics — operation postgresInstancePrometheusGet under the Prometheus tag. Returns Prometheus exposition format. System and workload metrics for one Postgres service.
    • Slow Query Patterns — operation slowQueryPatternsGetList under the Postgres tag. Returns per-digest latency, IO, and call statistics for normalized query patterns. Beta.

    Both endpoints require an organizationId and a serviceId as path parameters. The user must supply both, plus the API key/secret pair.

    What you do NOT have

    • Query plans / EXPLAIN output.
    • Per-table scan-type counters (seq_scan / idx_scan).
    • Autovacuum or last-ANALYZE timestamps.

    Reason from IO and timing signals, not from a plan tree.

    Workflow

    Six steps, in order. Do not skip ahead.

    Steps 2 and 3 only share auth — no data dependency between them. Run them in parallel (background curls, & + wait) to cut wall time from sequential ~2s to ~1s.

    1. Discover the live API shape

    These endpoints are Beta — paths, params, and JSON field names can shift. Follow rules/openapi-discovery.md to:

    1. Fetch the OpenAPI spec from https://api.clickhouse.cloud/v1.
    2. Locate the two operations by operationId:
      • postgresInstancePrometheusGet (Prometheus tag)
      • slowQueryPatternsGetList (Postgres tag)
    3. Resolve their path templates, required query parameters, and (for the slow-query endpoint) the response schema.
    4. Build a session-scoped role map from the schema property descriptions: { semantic role → actual field name }.

    Use the resolved names in every subsequent request and citation. Never hardcode field names from memory.

    2. Scrape Prom once for system gauges

    Follow rules/prometheus-scrape.md. One scrape, no wait. You're after gauges (current values) that don't need a delta: CacheHitRatio, ActiveConnections, MemoryUsedPercent, FilesystemUsedPercent.

    A CacheHitRatio well below ~95% on a workload that should fit in cache is a real signal on its own. Climbing ActiveConnections toward the pool ceiling is a real signal on its own. These don't need rate-of-change.

    A second scrape for counter deltas is opt-in, used only when Step 4 triage points at write-congestion (where deadlock and rollback rates matter and the Slow Query Patterns API can't substitute). For the read-path case (the most common RCA shape) the single scrape is enough.

    3. Pull top slow query patterns

    Request the slow query patterns. Follow rules/slow-query-patterns-fields.md for the fields that matter and how to read them. This is the primary diagnostic — it returns per-pattern accumulated totals (call count, runtime, blocks, rows) over the window you request, which is the "rate-of-change" data you'd otherwise derive from two Prom scrapes — but per query and without waiting.

    If no patterns return a meaningful totalDurationUs, the report may be overstated or the issue isn't query-shaped. Stop and tell the user what you looked at.

    4. Triage: pick the right heuristic

    Follow rules/triage.md. Match the combined Prom + slow-query signal to one of the heuristic shapes. Each shape points to a specific heuristic file:

    • rules/heuristic-full-scan.md — read-path full scan.
    • rules/heuristic-hot-loop.md — N+1 / hot loop from the app.
    • rules/heuristic-write-congestion.md — deadlocks, slow writes, high rollback rate.

    If the signal does not match any shape cleanly, do not invent a hypothesis. Surface the top patterns and ask the user which workload they recognize. New heuristics are welcome as PRs.

    5. Reason, then recommend

    Use the format in rules/output-template.md. Always include: symptom, evidence, hypothesis (noting any alternative cause you cannot rule out from this surface alone), short-term fix, and long-term follow-ups.

    6. Do not apply the fix

    Follow rules/recommend-only.md. Never run DDL. Never call pg_cancel_backend or pg_terminate_backend. Write the recommendation, explain why, and let the human apply it.

    Full Compiled Document

    For the complete guide with every rule expanded in a single context load: AGENTS.md.

    Reproducido de ClickHouse/agent-skills bajo licencia Apache-2.0. Leer esta página en markdown.

    Archivos

    13 archivos en el paquete. Solo se lee SKILL.md al activarse — las referencias se cargan si el skill decide que las necesita.

    Antes de instalar

    Requiere organizationId, serviceId y un par de API key/secret de ClickHouse Cloud con autenticación HTTP Basic.

    Detalles

    Creador
    ClickHouse
    Categoría
    Bases de datos
    Licencia
    Apache-2.0
    Recursos incluidos
    Incluye scripts o referencias
    Código fuente
    Ver SKILL.md

    Etiquetas

    Más de ClickHouse/agent-skills

    Este repo incluye 11 skills. Si instalas uno, normalmente ya tienes los demás. Ver el pack agent-skills entero y su comando de instalación

    Genera código TypeScript/JavaScript que lee/decodifica y escribe/codifica streams RowBinary de ClickHouse para el servidor HTTP; solo para Node.js, no cubre navegadores.

    Costo de contexto al activarse
    1.3k tok
    Tamaño del paquete
    193 archivos
    Última actualización
    hace 2 meses
    Oficialbases de datos

    Configura y gestiona ClickHouse con la CLI clickhousectl: servidor local para desarrollo y servicios ClickHouse Cloud gestionados para producción, incluyendo auth, esquemas y conexión.

    Costo de contexto al activarse
    661 tok
    Tamaño del paquete
    5 archivos
    Última actualización
    hace 2 meses
    Oficialbases de datos

    Configura y gestiona Postgres con clickhousectl: Postgres local con Docker para desarrollo, o servicios Postgres gestionados en ClickHouse Cloud (conexiones, TLS, réplicas, failover, restauración).

    Costo de contexto al activarse
    664 tok
    Tamaño del paquete
    5 archivos
    Última actualización
    hace 2 meses
    Oficialbases de datos

    Conecta un colector OpenTelemetry a un servicio Managed ClickStack en ClickHouse Cloud, desplegando uno nuevo o configurando el existente, y envía telemetría sintética para verificarlo en ClickStack.

    Costo de contexto al activarse
    9.9k tok
    Tamaño del paquete
    2 archivos
    Última actualización
    hace 2 meses
    Oficialdevops infraestructura

    Escribe código idiomático para el cliente Node.js de ClickHouse (@clickhouse/client): configuración, ping, inserts, selects, parámetros, sesiones y tipos de datos. No usar para código de cliente Web/navegador.

    Costo de contexto al activarse
    2.8k tok
    Tamaño del paquete
    13 archivos
    Última actualización
    hace 3 meses
    Oficialbases de datos

    Soluciona problemas comunes del cliente Node.js de ClickHouse (@clickhouse/client): socket hang-up, Keep-Alive, streams, tipos de datos, TLS/proxy y timeouts.

    Costo de contexto al activarse
    1.3k tok
    Tamaño del paquete
    10 archivos
    Última actualización
    hace 3 meses
    Oficialbases de datos

    Skills relacionados

    Ejecuta SQL analítico con chDB, ClickHouse embebido en Python, sobre archivos locales, URLs, S3 o bases remotas (Postgres, MySQL, MongoDB, Iceberg, Delta Lake) sin servidor.

    Costo de contexto al activarse
    1.2k tok
    Tamaño del paquete
    8 archivos
    Última actualización
    hace 4 meses
    Oficialbases de datos

    Úsalo obligatoriamente al diseñar arquitecturas ClickHouse, elegir patrones de ingesta o modelado, o traducir buenas prácticas en diseños específicos del workload.

    Costo de contexto al activarse
    791 tok
    Tamaño del paquete
    15 archivos
    Última actualización
    hace 4 meses
    Oficialbases de datos

    Úsalo obligatoriamente al revisar schemas, queries o configuraciones de ClickHouse: contiene 31 reglas que deben verificarse antes de dar recomendaciones.

    Costo de contexto al activarse
    2.6k tok
    Tamaño del paquete
    37 archivos
    Última actualización
    hace 4 meses
    Oficialbases de datos