observability

A command for adding structured logs, measurements, and request traces to a software module. These records help show what an application is doing and how it performs.

In plain words
What is it for?
Use it when instrumenting Go, Python, JavaScript, TypeScript, Rust, Java, Kotlin, or C# code for troubleshooting and monitoring.
Why use it?
It helps replace scattered print statements and missing diagnostics with information that can be searched and monitored.

Command

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 commands/fockus/skill-memory-bank/observability
Clone the repo
git clone --depth 1 https://github.com/fockus/skill-memory-bank
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 954 The whole file, excluding the scripts and references it only reads on demand.
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.00011 $0.00954
Opus 5 $0.00005 $0.00477
Sonnet 5 $0.00002 $0.00191
Haiku 4.5 $0.00001 $0.00095

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

Security

Grade A, and why

observability 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 2d 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.

commands/observability.md · 96 lines

How it starts

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

Observability: $ARGUMENTS

0. Stack detection

eval "$(bash ~/.claude/skills/memory-bank/scripts/mb-metrics.sh)"
# Uses: stack to pick the right library set

If stack=unknown, ask the user which stack the target module uses.

1. Current state

# Logging
grep -rn "log\.\|logger\.\|logging\.\|fmt\.Print\|console\.log\|print(\|tracing::\|Serilog" \
  --include="*.go" --include="*.py" --include="*.ts" --include="*.js" \
  --include="*.rs" --include="*.java" --include="*.kt" --include="*.cs" . | head -30

# Metrics
grep -rn "prometheus\|metrics\|statsd\|datadog\|micrometer\|System\.Diagnostics\.Metrics" . | head -20

# Tracing
grep -rn "opentelemetry\|OpenTelemetry\|jaeger\|zipkin\|trace\.\|span\.\|tracing::" . | head -20

2. Structured logging (per stack)

Go — zerolog / slog (stdlib)

  • Replace fmt.Println / log.Println with a structured logger
  • Fields: timestamp, level, message, request_id, error
  • JSON format for production; console for dev

Python — structlog or logging with python-json-logger

  • Replace print() / logging.info() with structured logs
  • JSON for production, colored output for local

Node.js / TypeScript — pino (fast) or winston

  • Use pino-pretty for local dev; JSON in production

Rust — tracing crate + tracing-subscriber

  • Replace println! / eprintln! with tracing::info! / warn! / error!
  • tracing-subscriber with fmt layer for dev, json layer for prod

Java / Kotlin — SLF4J + Logback / Log4j2 JSON encoder

  • Use MDC for request-scoped context (request_id, trace_id)

.NET — Microsoft.Extensions.Logging + Serilog

  • Serilog.Sinks.Console + Serilog.Formatting.Compact for JSON

Requirements across all stacks

  • Logs must NOT contain PII or secrets
  • Every log entry includes a correlation ID (request_id / trace_id)
  • Error logs include a stack trace

3. Metrics (Prometheus / OpenTelemetry)

Expose:

  • http_requests_total — counter labeled by method, path, status
  • http_request_duration_seconds — histogram by method, path
  • Business metrics: registrations, orders, payments (counters)
  • Runtime metrics: per-stack (Go promhttp, Python prometheus-client, JVM micrometer-registry-prometheus, .NET System.Diagnostics.Metrics)

Read the full file on GitHub · 96 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. 2d ago First seen · 96 lines · 11 tokens per session scan A 97e9c0f2cf8a

Subscribe to this mod's changes

observability is a command published in the GitHub repository fockus/skill-memory-bank (25 stars, last pushed 1mo ago), licensed MIT. It adds 11 tokens to every session and 954 once invoked, about $0.0001 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-08-30.