monitoring

monitoring is a cursor rule for coding agents from nedcodes-ok/cursorrules-collection. It costs 513 tokens per session, scanned A, original, MIT.

A set of rules for watching applications and services through metrics, alerts, and service goals. It explains measures such as latency, request volume, errors, and resource usage.

In plain words
What is it for?
Use it to define service-level objectives, track response-time percentiles, create actionable alerts, and link alerts to troubleshooting steps.
Why use it?
It helps teams notice failures and slow degradation early, while filtering out alerts that do not lead to action.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/nedcodes-ok/cursorrules-collection/monitoring
Clone the repo
git clone --depth 1 https://github.com/nedcodes-ok/cursorrules-collection

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for monitoring

README.md
[![agentmods](https://agentmods.dev/badge/rules/nedcodes-ok/cursorrules-collection/monitoring.svg)](https://agentmods.dev/rules/nedcodes-ok/cursorrules-collection/monitoring)
Your own site
<a href="https://agentmods.dev/rules/nedcodes-ok/cursorrules-collection/monitoring"><img src="https://agentmods.dev/badge/rules/nedcodes-ok/cursorrules-collection/monitoring.svg" alt="Measured on agentmods" height="20"></a>
Per session 513 This file is loaded in full into every session.
When invoked 513 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00513 $0.00513
Opus 5 $0.00257 $0.00257
Sonnet 5 $0.00103 $0.00103
Haiku 4.5 $0.00051 $0.00051

Measured yesterday against content hash 2b42063f37a9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

monitoring scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

rules-mdc/practices/monitoring.mdc · 51 lines

How it starts

The opening of the file, as written. The whole thing — 51 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Monitoring Cursor Rules

You are an expert at application monitoring. Follow these rules:

Four Golden Signals

  • Latency: track P50, P95, P99 — averages hide tail latency
  • Traffic: requests per second by endpoint and status code
  • Errors: error rate as percentage, broken down by type
  • Saturation: CPU, memory, disk, connection pool utilization

Metrics

  • USE method for infrastructure: Utilization, Saturation, Errors
  • RED method for services: Rate, Errors, Duration
  • Custom business metrics: signups/min, orders/hour, revenue
  • Use histograms for latency, not averages — P99 matters most
  • Label dimensions: service, endpoint, status_code, environment

Alerting

  • Alert on symptoms (high error rate), not causes (CPU spike)
  • Two tiers: page (P1, needs human now) and notify (P2, next business day)
  • Burn-rate alerts for SLO-based monitoring — catches slow degradation
  • Every alert needs a runbook link with triage steps
  • No alert without an actionable response — remove noisy alerts ruthlessly

SLOs

  • Define SLIs first: what indicates the service is working for users
  • Availability SLO: 99.9% = 43 min downtime/month — pick realistic targets
  • Latency SLO: 95% of requests under 200ms, 99% under 1s
  • Error budget: when budget is exhausted, freeze features and fix reliability
  • Review SLOs quarterly — adjust based on actual user impact

Dashboards

  • Service overview: golden signals at a glance
  • Dependency dashboard: health of all downstream services
  • Business dashboard: key metrics non-engineers care about
  • No dashboard with more than 10 panels — if everything is important, nothing is
  • Include links from dashboards to relevant logs and traces

Health Checks

  • /health for load balancers: returns 200 if the process is running
  • /ready for k8s readiness: returns 200 only when ready to serve traffic
  • Deep health checks: verify DB, cache, external service connectivity
  • Dont alert on brief health check failures — use consecutive failure thresholds
  • Synthetic monitoring: probe critical user flows every 1-5 minutes

Read the full file on GitHub · 51 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 51 lines · 513 tokens per session scan A 2b42063f37a9

Subscribe to this mod's changes

monitoring is a cursor rule published in the GitHub repository nedcodes-ok/cursorrules-collection (37 stars, last pushed 6mo ago), licensed MIT. It adds 513 tokens to every session, about $0.0026 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.