monitoring

monitoring is a cursor rule for Cursor from bernierllc/agents-environment-config. It costs 0 tokens per session (577 once invoked), scanned A, original, MIT.

Rules for monitoring, observability, and logging. Observability means collecting information that helps explain what an application is doing and when something goes wrong.

In plain words
What is it for?
It is for designing application monitoring, operational logs, and other practices for understanding system health.
Why use it?
They give the project consistent ways to record events and watch system behavior, making problems easier to detect and investigate.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit It is for designing application monitoring, operational logs, and other practices for understanding system health.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/bernierllc/agents-environment-config/monitoring
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.

Clone the repo
git clone --depth 1 https://github.com/bernierllc/agents-environment-config

Made for: Cursor.

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/bernierllc/agents-environment-config/monitoring/github.svg)](https://agentmods.dev/rules/bernierllc/agents-environment-config/monitoring)
Your own site
<a href="https://agentmods.dev/rules/bernierllc/agents-environment-config/monitoring"><img src="https://agentmods.dev/badge/rules/bernierllc/agents-environment-config/monitoring/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for monitoring

Your own site · 80×15
<a href="https://agentmods.dev/rules/bernierllc/agents-environment-config/monitoring"><img src="https://agentmods.dev/badge/rules/bernierllc/agents-environment-config/monitoring.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 577 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.00577
Opus 5.5 $0.00000 $0.00231
Sonnet 5.5 $0.00000 $0.00115
Haiku 4.5 $0.00000 $0.00058

Measured 1mo ago against content hash 2f6d3d4a9202, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo ago.

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.

.cursor/rules/topics/observability/monitoring.mdc · 104 lines

How it starts

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

Observability Standards

Logging Patterns

Structured Logging

  • Use structured JSON logs with consistent fields
  • Include trace_id, user_id, and request context
  • Forward logs to centralized systems (MS Sentinel, etc.)
  • Fallback to stdout when centralized logging unavailable

API Logging

// Structured API logs
logger.info('API request', {
  trace_id: requestId,
  user_id: userId,
  site_id: siteId,
  endpoint: '/api/users',
  method: 'GET',
  status: 200
});

React Logging

  • Use Sentry DSN from environment variables
  • Configure Sentry for React error tracking
  • Include user context and error details

Error Monitoring

Browser Errors

  • Monitor browser console errors
  • Check logs/frontend.log for frontend errors
  • Track JavaScript errors and unhandled promises
  • Monitor network request failures

Server Errors

  • Monitor API endpoint errors
  • Track database connection issues
  • Log unhandled exceptions with stack traces
  • Alert on critical errors

Monitoring Requirements

Application Monitoring

  • Error rates and types
  • Response times and latency
  • Throughput and request rates
  • Database performance metrics

Infrastructure Monitoring

  • Server resource usage (CPU, memory, disk)
  • Database connection pools
  • Network latency and availability
  • Service health checks

Tracing

Distributed Tracing

  • Use trace_id for request correlation
  • Track requests across services
  • Monitor end-to-end latency
  • Identify bottlenecks

Performance Tracing

  • Track slow queries
  • Monitor API endpoint performance
  • Profile critical code paths
  • Identify performance regressions

Alerting

Critical Alerts

  • Production errors exceeding threshold
  • Database connection failures
  • Service unavailability
  • Security incidents

Warning Alerts

  • Elevated error rates
  • Slow response times
  • Resource usage warnings
  • Deprecated API usage

Best Practices

  1. Log Levels: Use appropriate log levels (debug, info, warn, error)
  2. Structured Data: Use JSON for structured logging
  3. Correlation IDs: Include trace_id in all logs
  4. Error Context: Include full error context in logs
  5. Privacy: Never log sensitive data (passwords, tokens, PII)

Read the full file on GitHub · 104 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. 1mo ago First seen · 104 lines · 0 tokens per session scan A 2f6d3d4a9202

Subscribe to this mod's changes

monitoring is a cursor rule published in the GitHub repository bernierllc/agents-environment-config (11 stars, last pushed 10d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 577 tokens. 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-08-31.