Skip to main content
skill CX Codex

182-java-observability-metrics-micrometer — Claude Code skill

182-java-observability-metrics-micrometer guides Java developers through Micrometer metrics design and validation. Use it when adding service measurements or revising existing instrumentation.

Apache-2.0 297 installs ★ 465 updated 2026-10-21

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add jabrena/plinth --skill 182-java-observability-metrics-micrometer -a claude-code
Open on GitHub

What 182-java-observability-metrics-micrometer does

The skill helps map service indicators to metric names, units, tags, and meter types. It covers Counter, Timer, Gauge, DistributionSummary, and LongTaskTimer, along with histogram and percentile choices. Export guidance includes Actuator, Prometheus, and OpenTelemetry.

It stresses keeping tag values bounded: userId, UUIDs, raw URLs, and full exception messages can produce excessive time series and strain observability systems. After instrumentation changes, validate metric registration and values with tests, then run ./mvnw clean verify or mvn clean verify.

What it helps with

  • choose a meter type for events, latency, or current state
  • set stable metric names and low-cardinality tags
  • configure histograms and percentiles for service metrics
  • test that metrics register and report expected values

Example prompts for the agent

  • Add Micrometer measurements for latency and error counts in this Java service.
  • Review metric tags and remove values with unbounded cardinality.
  • Configure histograms for the service metrics and validate them with tests.

How to install 182-java-observability-metrics-micrometer

1Skills CLI (Vercel)

npx skills add jabrena/plinth --skill 182-java-observability-metrics-micrometer -a claude-code

2Manually: put the files in place

~/.claude/skills/182-java-observability-metrics-micrometer/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/182-java-observability-metrics-micrometer/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about 182-java-observability-metrics-micrometer

How do I install 182-java-observability-metrics-micrometer in Claude Code?

Run npx skills add jabrena/plinth --skill 182-java-observability-metrics-micrometer -a claude-code. The skill file is at ~/.claude/skills/182-java-observability-metrics-micrometer/SKILL.md.

What does 182-java-observability-metrics-micrometer do?

It guides Micrometer instrumentation in Java services, covering meter selection, naming, tags, cardinality control, and test validation.

Which metric tags should I avoid?

Avoid unbounded values such as userId, UUIDs, raw URLs, or full exception messages. They can cause time-series growth that harms observability systems.

Source text

SKILL.md · Apache-2.0
---
name: 182-java-observability-metrics-micrometer
description: Use when you need to implement or improve Java metrics observability with Micrometer — including meter design, naming/tag conventions, cardinality control, timers/counters/gauges/distribution summaries, percentiles/histograms, Actuator/Prometheus integration, and metrics validation through tests. This should trigger for requests such as Improve metrics; Apply Micrometer; Add metrics observability; Refactor Micrometer instrumentation; Add Micrometer timers counters or gauges to Java services. Part of Plinth Toolkit
license: Apache-2.0
metadata:
  author: Juan Antonio Breña Moral
  version: 0.19.0
---
# Java Metrics Observability with Micrometer

Implement effective Java metrics instrumentation with Micrometer by defining meaningful service-level metrics, controlling cardinality, selecting the right meter type, and exposing production-ready telemetry for dashboards and alerting.

**What is covered in this Skill?**

- Metrics-first observability with Micrometer in Java applications
- Meter selection: Counter, Timer, DistributionSummary, Gauge, LongTaskTimer
- Naming and tagging conventions with low-cardinality dimensions
- Cardinality and meter lifecycle safeguards to prevent time-series explosion
- Histogram/percentile strategy and SLO-oriented metrics design
- Integration guidance for Actuator + Prometheus/OpenTelemetry pipelines
- Testing and verification of metrics registration and values

**Scope:** Application-level metrics design and instrumentation quality for Java services, with emphasis on operationally useful and cost-efficient telemetry.

## Constraints

Metrics instrumentation must be operationally safe, low-cardinality, and validated. Poor tag design or excessive meter creation can degrade observability systems and increase costs.

- **LOW CARDINALITY FIRST**: Never tag metrics with unbounded values (userId, UUID, raw URL, full exception message)
- **RIGHT METER TYPE**: Use Counter for monotonically increasing events, Timer for latency, Gauge for point-in-time state, and DistributionSummary for sampled values
- **BEFORE APPLYING**: Read the reference for good/bad instrumentation examples and anti-patterns
- **VERIFY**: Run `./mvnw clean verify` or `mvn clean verify` after changes

## When to use this skill

- Improve metrics
- Apply Micrometer
- Add metrics observability
- Refactor Micrometer instrumentation
- Add Micrometer timers counters or gauges to Java services

## Workflow

1. **Define measurement goals and meter contract**

Identify key service indicators (throughput, latency, error ratio, saturation) and map each to stable metric names, units, and low-cardinality tags.

2. **Select meter types and instrument code paths**

Apply Counter/Timer/Gauge/DistributionSummary/LongTaskTimer where appropriate, ensuring consistent naming conventions and reusable tags.

3. **Harden instrumentation for production**

Control cardinality, avoid dynamic meter churn, configure histogram/percentile strategy only where needed, and align export settings with the telemetry backend.

4. **Validate and operationalize metrics**

Verify metrics in tests and runtime endpoints, confirm expected labels/units, and ensure dashboards/alerts can consume the emitted series.

## Reference

For detailed guidance, examples, and constraints, see [references/182-java-observability-metrics-micrometer.md](references/182-java-observability-metrics-micrometer.md).

© Juan Antonio Breña Moral · Apache-2.0 · jabrena/plinth

Similar skills

All skills for DevOps and infrastructure →

From the same set123

The whole set →
043-planning-github-issues 043-planning-github-issues guides GitHub CLI setup and keeps issue prose outside agent context, relying on repository-owned documents for requirements analysis. CX Codex +1 312installs 126-java-exception-handling 126-java-exception-handling is a Claude Code skill for Java exception handling. It activates on requests to review error types, resource cleanup, or failure propagation. CX Codex +1 307installs 703-technologies-fuzzing-testing The 703-technologies-fuzzing-testing skill guides CATS-based fuzz testing for Java APIs from an OpenAPI contract. Use it to probe invalid inputs, boundary conditions, and CI checks. CX Codex +1 304installs 314-frameworks-spring-kafka 314-frameworks-spring-kafka guides Kafka messaging setup in Spring Boot projects, covering consumers, DLT retries, and Testcontainers. CX Codex +1 297installs 403-frameworks-quarkus-validation 403-frameworks-quarkus-validation guides Quarkus validation work, from DTO constraints and REST boundaries to configuration checks and API error mapping. CX Codex +1 296installs 404-frameworks-quarkus-security 404-frameworks-quarkus-security is a skill for designing and reviewing security in Quarkus applications, including authentication, access control, and secure logging. CX Codex +1 294installs 315-frameworks-spring-mongodb 315-frameworks-spring-mongodb — a skill for designing and implementing MongoDB data access in Spring Boot. Covers document modeling, repositories, indexing, optimistic locking, and error handling strategies. CX Codex +1 284installs 504-frameworks-micronaut-security The 504-frameworks-micronaut-security skill reviews and improves Micronaut application security, covering authentication, route authorization, JWT, CORS, and safe handling of sensitive data. CX Codex +1 282installs

Project sponsors

Companies that keep this analytics open