agentleFS
BappozBappoz/My-Claude-Skills/skills/engineering/observability/SKILL.md

observability

Skill1 starsChanged 4 months agoMITView on GitHub

Observabilidade production-grade: logs, métricas e traces (os 3 pilares), SLI/SLO/error budget, alertas acionáveis, cardinalidade e OpenTelemetry. Use quando o usuário mencionar: "observabilidade", "monitoramento", "logs", "métricas", "tracing", "SLO", "SLI", "alerta", "dashboard de sistema", "por que está lento em prod", "APM", "OpenTelemetry", "Prometheus".

87 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use gitops, background-jobs and 8 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • kcns008Skill

    gitops

    GitOps Agent (Flow) — manages ArgoCD applications, Helm charts, Kustomize overlays, deployment strategies (canary, blue-green, rolling), multi-cluster GitOps, and drift detection for Kubernetes and OpenShift clusters.

    Also in 4 projects that use this

  • YepAPISkill

    background-jobs

    Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.

    Also in 4 projects that use this

  • Mushfiqur-Rahman-RobinSkill

    rag-systems

    Best practices for building Retrieval-Augmented Generation systems — chunking, embedding, hybrid retrieval, reranking, indexing, caching, evaluation, observability — plus a catalog of RAG patterns and when each applies.

    Also in 3 projects that use this

  • YepAPISkill

    data-pipelines

    ETL patterns, cron scheduling, queue-based processing, and batch jobs with Inngest/BullMQ.

    Also in 4 projects that use this

  • wpankSkill

    caching

    Caching strategies, invalidation, eviction policies, HTTP caching, distributed caching, and anti-patterns. Use when designing cache layers, choosing eviction policies, debugging stale data, or optimizing read-heavy workloads.

    Also in 5 projects that use this

  • MicrosoftSkill

    data-modeling

    Use when the app needs to store or read data — records, a database, entities, CRUD, lists, "save/remember X", or per-user data with row-level security. This app's data layer is Rayfin's: you declare entities as TypeScript classes with decorators in rayfin/data/, register them in the schema, and read/write them through the typed rayfin-client. Covers: defining an @entity, field decorators, registering it, per-entity access with @role, owner-only row-level security, and the client query/mutation API. Triggers: data, database, model, entity, schema, table, record, CRUD, create, read, update, delete, list, store, save, persist, per-user, row-level security, RLS, access control, ownership.

    Also in 6 projects that use this

The file

Files
SKILL.md

Observability

Você atua como engenheiro de confiabilidade. Objetivo: instrumentar sistemas para responder perguntas novas sem redeploy — não só "está no ar?", mas "por que este usuário viu latência às 3h12?". Observabilidade é sobre conseguir explicar o desconhecido.

Os 3 pilares (use os três, cada um resolve algo)

PilarRespondeCuidado
LogsO que aconteceu neste evento (detalhe)Estruturados (JSON), não texto solto; sem PII/segredo; custo de volume
MétricasQuantos/quão rápido, ao longo do tempo (agregado)Baratas e rápidas, mas baixa cardinalidade
TracesO caminho de UMA requisição por N serviçosContexto propagado (trace-id); amostragem

Regra: métrica te alerta → trace te localiza → log te explica.

Logs que prestam

  • Estruturados: JSON com campos (level, trace_id, user_id, latency_ms), não string interpolada.
  • Correlacionáveis: todo log carrega trace_id/request_id para casar com traces.
  • Níveis com disciplina: ERROR = ação humana necessária; WARN = anômalo mas tratado; INFO = marco; DEBUG = fora de prod.
  • Sem vazar: nunca logue senha, token, PAN, PII sensível.

Métricas — os 4 sinais dourados (Google SRE)

Instrumente todo serviço com:

  1. Latency — p50/p95/p99 (média mente; use percentis).
  2. Traffic — req/s, throughput.
  3. Errors — taxa de falha (5xx, exceptions).
  4. Saturation — quão cheio (CPU, memória, fila, conexões).

Cardinalidade: cada combinação única de labels é uma série temporal. user_id como label de métrica explode custo — use em log/trace, não em métrica.

Traces (distribuído)

  • Propague o contexto (trace-id, span-id) entre serviços via headers (W3C Trace Context).
  • Cada span mede uma operação; a árvore mostra onde o tempo foi.
  • Amostre (head/tail sampling) para controlar custo sem perder os traces interessantes (erros/lentos).

SLI / SLO / Error budget (o que realmente importa)

  • SLI — indicador medível da experiência (ex: % de requests < 300ms e 2xx).
  • SLO — a meta (ex: 99,9% num mês).
  • Error budget — o complemento (0,1% ≈ 43 min/mês). Enquanto há budget, entregue features; se estourou, pare e conserte confiabilidade.
  • Alerte sobre sintoma, não causa — alerte que o SLO está queimando (usuário sofrendo), não que "CPU 80%" (pode ser inofensivo).

Alertas acionáveis (senão viram ruído)

Todo alerta deve: (a) indicar impacto real ao usuário, (b) ser acionável agora, (c) apontar o runbook. Alerta que ninguém age → delete. Fadiga de alerta mata a resposta a incidentes.

Fluxo de instrumentação

  1. Defina o SLI/SLO do serviço (o que é "bom" para o usuário).
  2. Instrumente os 4 sinais dourados + traces nos caminhos críticos.
  3. Logs estruturados com trace-id.
  4. Dashboards: visão de saúde (golden signals) + drill-down.
  5. Alertas sobre queima de error budget, com runbook ([[runbook]] / [[handoff]] para on-call).

Recursos externos

RecursoO que pegar
Google SRE BookSLI/SLO/error budget, golden signals, alerting.
OpenTelemetryPadrão vendor-neutral de traces/métricas/logs.
PrometheusMétricas + PromQL + alerting.
Honeycomb — ObservabilityObservabilidade orientada a eventos e alta cardinalidade.
GrafanaDashboards e visualização dos 3 pilares.
W3C Trace ContextPropagação padronizada de trace-id.

Do / Don't

DoDon't
Logs estruturados + trace-idprint/string interpolada
Percentis (p95/p99)Só média de latência
Alertar por sintoma/SLOAlertar por "CPU alta"
Baixa cardinalidade em métricauser_id como label de métrica

Checklist

  • SLI/SLO definidos por serviço
  • 4 sinais dourados instrumentados (latency p95/p99, traffic, errors, saturation)
  • Traces com contexto propagado nos caminhos críticos
  • Logs estruturados, com trace-id, sem PII/segredo
  • Alertas acionáveis sobre queima de error budget + runbook
  • Cardinalidade de métricas controlada

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.