agentleFS
aayushostwalaayushostwal/nexus/skills/observability/SKILL.md

observability

Skill19 starsChanged 3 months agoMITView on GitHub

Use for correlated API failures, cascading errors, and distributed-system incident tracing. Trigger on multi-service error spikes, dependency-chain analysis, circuit-breaker events, or requests to identify origin service and blast radius from logs/metrics across components.

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 10 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

  • JohnJBorenSkill

    ci-cd

    CI/CD pipeline design, GitHub Actions, testing automation, and deployment strategies

    Also in 13 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 7 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 70 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If two candidates remain ambiguous, state both — do not guess.

    line 77
  2. Very specific:

    Service meshes (Istio/Linkerd): Check control plane health first — a sick control plane degrades all data plane services simultaneously.

    line 147
  3. Very specific:

    Databases (PostgreSQL/MySQL): Check max_connections/pg_stat_activity — connection exhaustion is the most common DB-originated cascade.

    line 149
  4. Very specific:

    Caches (Redis/Memcached): Check rejected_connections — full connection pool causes DB fallback storms.

    line 151
  5. Distinctive:

    API gateways/load balancers: Check backend health check logs — misconfigured health checks mark healthy backends as down.

    line 153
  6. Very specific:

    Every investigation closes with this report.

    line 159
  7. Very specific:

    Read anti-patterns/common-mistakes.md before starting any investigation.

    line 181
  8. Distinctive:

    Never blame a downstream service without proving its upstream was healthy at failure time.

    line 183
  9. Distinctive:

    Never construct a timeline from summarized logs — raw timestamps only.

    line 184
  10. Distinctive:

    Never propose a fix before completing Steps 1–5.

    line 185
  11. Distinctive:

    Never skip the dependency graph — fan-out cascades look like independent failures without it.

    line 186
  12. Very specific:

    Never mark complete if Blind Spots is empty when data is missing — state what is unknown.

    line 187
  13. Distinctive:

    Never conflate correlation with causation — simultaneous spikes do not imply causation.

    line 188

“Common” is measured: kept by at least 6 in 10 of the 70 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Nexus Observability — API Failure Correlation Engine

Systematically correlate failures across distributed services to identify causal chains, blast radius, and the origin service — before proposing any fix.


Compatibility

  • Supporting files: checklists/investigation-checklist.md, anti-patterns/common-mistakes.md, validation/output-validation.md
  • Required tools: Read, Bash, Grep
  • Optional tools: WebSearch (vendor-specific error lookups)
  • Hands off to: nexus:debugging once origin service is identified; the roadmap-planner agent after fix is agreed upon

Core Principle

Never assign blame before building the full cross-service timeline. A cascade always has one origin — fixing a victim while the cause is live means the failure recurs.


Workflow

Step 1 — Context Acquisition

Collect before reading any logs. Require items 1–5 minimum; ask for all in one message:

#CollectWhy
1Verbatim error logs from all affected servicesParaphrased logs lose exact timestamps and error codes
2Distributed traces (Jaeger/Zipkin/X-Ray/Tempo) for ≥3 failing requestsShows exact call path and which hop introduced error/latency
3Metrics: error rate, p99 latency, RPS, CPU/mem/conn-pool per serviceDistinguishes saturation from errors from cascades
4Exact first-elevated-error timestamp per serviceRequired for timeline in Step 2
5Dependency map (direct + indirect call relationships)Required for blast radius in Step 3
6Changes in the 4h window: deploys, config, feature flags, cron, infraMost failures are change-triggered
7Alert firing history and orderAlert order mirrors propagation direction

Step 2 — Timeline Construction

Align all timestamps to UTC. Use first occurrence per service, not peak. Trust trace timestamps over log timestamps when they differ. Note data gaps explicitly — they are blind spots, not clean windows.

| Time (UTC) | Service     | Event                              | Error Rate |
|------------|-------------|------------------------------------|------------|
| T+00:00    | database    | connection pool at 95% utilization | 0%         |
| T+00:47    | database    | connection pool exhausted          | 0%         |
| T+01:03    | api-gateway | upstream timeouts begin            | 2%         |
| T+01:15    | auth-service| DB queries failing, JWT slow       | 8%         |
| T+01:22    | user-service| auth check timeouts                | 34%        |
| T+01:31    | api-gateway | circuit breaker opens on auth      | 78%        |

Step 3 — Identify the Origin Service

The origin has the earliest elevated error signal. Confirm with all three tests:

TestMethodWhat it proves
Earliest timestampLowest T+XX:XX across servicesCandidate origin
No upstream errors at that timeCheck if anything calling the candidate was already erroringConfirms not a victim
Error type is localDB timeout with no downstream = local origin; HTTP 503 from a pass-through = victimDistinguishes originator from propagator
Metrics confirm saturationCPU/mem/conn-pool maxed at origin timeSaturation precedes errors at the origin

State the origin as: "[Service X] is the origin. Its [metric] saturated at [T+XX:XX], [N]s before the first downstream error in [Service Y]."

If two candidates remain ambiguous, state both — do not guess.


Step 4 — Map Dependency Graph and Failure Mode

Classify using this table:

Failure ModeSignatureMeaning
Linear cascadeErrors propagate A → B → C with delays matching timeout settingsUpstream timeout drives downstream retry storm
Fan-out cascadeOne service fails; N downstream services spike simultaneouslyShared dependency (DB, cache, auth) failed
Independent failuresMultiple services spike with no call relationshipShared infra failure: network, DNS, load balancer, cloud event
Thundering herdError rate drops then re-spikes in wavesCircuit breaker retry storm after brief recovery
BrownoutLatency rises gradually, error rate follows slowlyResource saturation (pool, thread, memory) near limit

Draw the dependency graph and mark each node: ORIGIN, PROPAGATOR, or VICTIM.

[database] ← [auth-service] ← [api-gateway] ← [user-service]
                              ↑
                          [billing-service]

Step 5 — Root Cause + Blast Radius

Root cause format (required):

"[Service X] failed because [mechanism] when [trigger], causing [failure mode] that propagated to [affected services], with [N]% of [user-facing operation] requests failing by [T+XX:XX]."

Blast radius table:

| Service         | Role        | Peak Error Rate | User Impact            |
|-----------------|-------------|-----------------|------------------------|
| database        | ORIGIN      | 100% timeouts   | Internal only          |
| auth-service    | PROPAGATOR  | 45%             | Login failures         |
| api-gateway     | PROPAGATOR  | 78%             | All authenticated reqs |
| user-service    | VICTIM      | 34%             | Profile page errors    |

Fix table (one action per service):

| Service      | Immediate Action                          | Prevention                          |
|--------------|-------------------------------------------|-------------------------------------|
| database     | Increase pool limit; kill idle conns      | Alert at 80% pool utilization       |
| auth-service | Add circuit breaker on DB calls           | Cache JWT verify results for 30s    |
| api-gateway  | Tune circuit breaker thresholds           | Add fallback for auth timeout       |

Signal Patterns

Observed patternMost likely cause
All services spike simultaneously (< 1s apart)Shared infra: network partition, DNS, load balancer, cloud event
Errors propagate in waves matching timeout delaysRequest-driven cascade — upstream timeout → downstream retry storm
Periodic error spikes (regular interval)Cron job contention, batch overloading shared resource, pool TTL recycling
p99 latency rises before error rateResource saturation building (pool, thread, memory near limit)
Error rate rises before latencyHard failure (process crash, network drop) not saturation
Error rate drops and re-spikes in wavesThundering herd — circuit breaker open/close/retry cycle
Single service high error rate, all others fineIsolated failure — route to nexus:debugging, do not correlate
Error rate high, latency normalFast-failing errors (circuit breaker open, auth rejection)
Memory/CPU climbs gradually then all services degradeGC pauses or OOM kills on shared nodes

Specialization Notes

Service meshes (Istio/Linkerd): Check control plane health first — a sick control plane degrades all data plane services simultaneously. 503 upstream connect error and upstream reset before response started are cascade signatures. Envoy proxy logs often contain the causal chain before application logs do.

Databases (PostgreSQL/MySQL): Check max_connections/pg_stat_activity — connection exhaustion is the most common DB-originated cascade. Check slow query log (one long query can block all connection slots). Check replication lag — replica failures appear before primary errors.

Caches (Redis/Memcached): Check rejected_connections — full connection pool causes DB fallback storms. Check memory/evictions — maxmemory-policy evictions cause cache misses that look like cache failure. Check slowlog — an expensive command (LRANGE, SMEMBERS) blocks all other operations.

API gateways/load balancers: Check backend health check logs — misconfigured health checks mark healthy backends as down. Check connection timeout vs. read timeout mismatch — causes partial failure modes that are hard to correlate.


Output Contract

Every investigation closes with this report. Fill every field; write none if not applicable — never leave blank:

## Failure Correlation Report

**Outcome:**          [one-line summary]
**Failure Mode:**     [Linear cascade | Fan-out | Independent | Thundering herd | Brownout]
**Origin Service:**   [service name + specific metric/event that triggered failure]
**Trigger:**          [what caused the origin service to fail]
**Timeline:**         [inline table T+00:00 to resolution]
**Causal Chain:**     [A → B → C with failure mode at each hop]
**Blast Radius:**     [table: service | role | peak error rate | user impact]
**Fix — Immediate:**  [per-service immediate actions]
**Fix — Prevention:** [per-service prevention measures]
**Blind Spots:**      [services or time windows with no data]
**Next Step:**        [one clear action for the user]

Anti-Patterns

Read anti-patterns/common-mistakes.md before starting any investigation.

  • Never blame a downstream service without proving its upstream was healthy at failure time.
  • Never construct a timeline from summarized logs — raw timestamps only.
  • Never propose a fix before completing Steps 1–5.
  • Never skip the dependency graph — fan-out cascades look like independent failures without it.
  • Never mark complete if Blind Spots is empty when data is missing — state what is unknown.
  • Never conflate correlation with causation — simultaneous spikes do not imply causation.

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.