Application Metrics Instrumentation

VerifiedSafe

Practical guide for adding observability to applications through metrics, counters, and gauges. Covers API endpoints, databases, queues, caching, and locks.

Sby Skills Guide Bot
DevOpsIntermediate
3/8/2026
Claude CodeCursorWindsurfCopilotCodex
#metrics#observability#instrumentation#monitoring#latency

Recommended for

Automated summary

A guide for instrumenting applications with metrics: metric types, a naming convention, and per-component checklists covering APIs, databases, message queues, caching, and locks.

Strengths

  • Covers five metric families with concrete naming examples
  • Provides a reusable <system>.<component>.<operation>.<metric_type> naming convention
  • Detailed checklists per component: API endpoints, databases, queues, cache, and locks
  • Calls out sharp anti-patterns, including unbounded label cardinality and a missing heartbeat metric

Limitations

  • Does not describe any library- or backend-specific implementation (Prometheus, StatsD, OpenTelemetry)
  • The full detail lives in an external article behind a URL
  • Assumes metrics are already collected somewhere; nothing on export, storage, or alerting
When to use it

Use it when you need to add counters, gauges, or latency measurements to existing code to make it observable.

When not to use it

Skip it if you want concrete configuration for a metrics SDK or a strategy for alerting and dashboards.

Security analysis

Safe
Quality score78/100

The skill is purely instructional content about metrics naming, metric types, and per-component checklists. Declared tools are Read, Grep, Edit, Write — no bash, no network client, no credential access. The only external reference is an https link to a blog post, which cannot be fetched with the allowed toolset and poses no exfiltration or destructive risk. Nothing obfuscated, no destructive commands, no safety disabling.

Findings
  • •Prompts the agent to 'fetch the complete guide' from an external URL (pierrezemb.fr), but no network/fetch tool is granted, so it is only an informational link
  • •Edit/Write permissions allow modifying code; expected and appropriate for an instrumentation guide
How this analysis is made

Examples

Instrument an HTTP API
Add metrics to our Express user API: request counts by endpoint and method, p50/p95/p99 latency, error rate by status code, and payload sizes. Follow a consistent naming convention.
Database and cache observability
Instrument the Postgres connection pool and the Redis cache layer in this service — active/idle/waiting connections, query duration, slow query count, hit/miss ratio, and eviction count.
Review metrics for anti-patterns
Review the metrics in this file: check for unbounded label cardinality, missing failure paths, and naming inconsistencies, and suggest fixes.

name: application-metrics description: Guide for instrumenting applications with metrics. Use when adding observability, monitoring, metrics, counters, gauges, or instrumentation to code. Covers API endpoints, databases, queues, caching, and locks. allowed-tools: Read, Grep, Edit, Write

Application Metrics Instrumentation

Practical patterns for adding observability to applications.

Five Metric Types

| Type | Purpose | Example | |------|---------|---------| | Operational Counters | Track discrete events (success/failure) | api.requests.success_total | | Resource Utilization | Current capacity usage (gauges) | db.connections.active | | Performance/Latency | Speed with explicit units | api.request.duration_ms | | Data Volume | Information flow rates | queue.messages.bytes_total | | Business Logic | Domain-specific value | orders.completed_total |

Naming Convention

<system>.<component>.<operation>.<metric_type>

Examples:

  • myapp.api.users.requests_total
  • myapp.db.queries.duration_ms
  • myapp.cache.items.hit_total

Component Checklists

API Endpoints

  • Request count by endpoint and method
  • Response time (p50, p95, p99)
  • Error rate by status code
  • Authentication failures
  • Request/response payload sizes

Database

  • Connection pool (active, idle, waiting)
  • Query duration by operation type
  • Slow query count (threshold-based)
  • Error count by type (timeout, constraint, connection)
  • Transaction commit/rollback rates

Message Queues

  • Messages produced/consumed per topic
  • Queue depth (current backlog)
  • Processing latency (end-to-end)
  • Consumer lag
  • Dead letter queue size

Caching

  • Hit/miss ratio
  • Eviction count and reason
  • Cache size (entries and bytes)
  • TTL expiration rate
  • Connection pool status

Locks/Synchronization

  • Acquisition time
  • Contention count (failed acquisitions)
  • Hold duration
  • Timeout count
  • Deadlock occurrences

Anti-patterns to Avoid

  1. Unbounded label cardinality - Never use user IDs, session tokens, or request IDs as labels
  2. Missing failure paths - Always instrument errors alongside successes
  3. No heartbeat metric - Add a constant gauge (e.g., app.up = 1) to verify instrumentation works
  4. Inconsistent naming - Stick to one convention across the codebase

Full Reference

For detailed examples, patterns, and rationale, fetch the complete guide: https://pierrezemb.fr/posts/practical-guide-to-application-metrics/

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/application-metrics-instrumentation-mmh8qqw0/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/application-metrics-instrumentation-mmh8qqw0' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/application-metrics-instrumentation-mmh8qqw0/download' --output '.skill-downloads/application-metrics-instrumentation-mmh8qqw0/SKILL.md.part' && mv '.skill-downloads/application-metrics-instrumentation-mmh8qqw0/SKILL.md.part' '.skill-downloads/application-metrics-instrumentation-mmh8qqw0/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Read, Grep, Edit, Write

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/application-metrics-instrumentation-mmh8qqw0/SKILL.md' && test -s '.skill-downloads/application-metrics-instrumentation-mmh8qqw0/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/application-metrics' && cp -R '.skill-downloads/application-metrics-instrumentation-mmh8qqw0' '.claude/skills/application-metrics'

Cursor
test -f '.skill-downloads/application-metrics-instrumentation-mmh8qqw0/SKILL.md' && test -s '.skill-downloads/application-metrics-instrumentation-mmh8qqw0/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/application-metrics' && cp -R '.skill-downloads/application-metrics-instrumentation-mmh8qqw0' '.cursor/skills/application-metrics'

Codex
test -f '.skill-downloads/application-metrics-instrumentation-mmh8qqw0/SKILL.md' && test -s '.skill-downloads/application-metrics-instrumentation-mmh8qqw0/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/application-metrics' && cp -R '.skill-downloads/application-metrics-instrumentation-mmh8qqw0' '.agents/skills/application-metrics'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/application-metrics-instrumentation-mmh8qqw0'

openskills read 'application-metrics-instrumentation-mmh8qqw0'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/application-metrics-instrumentation-mmh8qqw0/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills