{"id":"9c42ce07-4637-4018-bf0a-cad2e068b4c0","shortId":"2yMqGY","kind":"skill","title":"182-java-observability-metrics-micrometer","tagline":"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 validati","description":"# Java Metrics Observability with Micrometer\n\nImplement 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.\n\n**What is covered in this Skill?**\n\n- Metrics-first observability with Micrometer in Java applications\n- Meter selection: Counter, Timer, DistributionSummary, Gauge, LongTaskTimer\n- Naming and tagging conventions with low-cardinality dimensions\n- Cardinality and meter lifecycle safeguards to prevent time-series explosion\n- Histogram/percentile strategy and SLO-oriented metrics design\n- Integration guidance for Actuator + Prometheus/OpenTelemetry pipelines\n- Testing and verification of metrics registration and values\n\n**Scope:** Application-level metrics design and instrumentation quality for Java services, with emphasis on operationally useful and cost-efficient telemetry.\n\n## Constraints\n\nMetrics instrumentation must be operationally safe, low-cardinality, and validated. Poor tag design or excessive meter creation can degrade observability systems and increase costs.\n\n- **LOW CARDINALITY FIRST**: Never tag metrics with unbounded values (userId, UUID, raw URL, full exception message)\n- **RIGHT METER TYPE**: Use Counter for monotonically increasing events, Timer for latency, Gauge for point-in-time state, and DistributionSummary for sampled values\n- **BEFORE APPLYING**: Read the reference for good/bad instrumentation examples and anti-patterns\n- **VERIFY**: Run `./mvnw clean verify` or `mvn clean verify` after changes\n\n## When to use this skill\n\n- Improve metrics\n- Apply Micrometer\n- Add metrics observability\n- Refactor Micrometer instrumentation\n\n## Workflow\n\n1. **Define measurement goals and meter contract**\n\nIdentify key service indicators (throughput, latency, error ratio, saturation) and map each to stable metric names, units, and low-cardinality tags.\n\n2. **Select meter types and instrument code paths**\n\nApply Counter/Timer/Gauge/DistributionSummary/LongTaskTimer where appropriate, ensuring consistent naming conventions and reusable tags.\n\n3. **Harden instrumentation for production**\n\nControl cardinality, avoid dynamic meter churn, configure histogram/percentile strategy only where needed, and align export settings with the telemetry backend.\n\n4. **Validate and operationalize metrics**\n\nVerify metrics in tests and runtime endpoints, confirm expected labels/units, and ensure dashboards/alerts can consume the emitted series.\n\n## Reference\n\nFor detailed guidance, examples, and constraints, see [references/182-java-observability-metrics-micrometer.md](references/182-java-observability-metrics-micrometer.md).","tags":["182","java","observability","metrics","micrometer","cursor","rules","jabrena","agent-skills","ai-skills","claude","claude-code"],"capabilities":["skill","source-jabrena","skill-182-java-observability-metrics-micrometer","topic-agent-skills","topic-ai-skills","topic-claude","topic-claude-code","topic-claude-code-skills","topic-claude-code-subagents","topic-claude-skills","topic-cursor-agent","topic-cursor-ai","topic-cursor-skills","topic-cursorai","topic-github-copilot"],"categories":["cursor-rules-java"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/jabrena/cursor-rules-java/182-java-observability-metrics-micrometer","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add jabrena/cursor-rules-java","source_repo":"https://github.com/jabrena/cursor-rules-java","install_from":"skills.sh"}},"qualityScore":"0.642","qualityRationale":"deterministic score 0.64 from registry signals: · indexed on github topic:agent-skills · 384 github stars · SKILL.md body (2,736 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T18:54:19.436Z","embedding":null,"createdAt":"2026-05-07T12:55:06.703Z","updatedAt":"2026-05-18T18:54:19.436Z","lastSeenAt":"2026-05-18T18:54:19.436Z","tsv":"'/mvnw':238 '1':263 '182':1 '2':292 '3':311 '4':336 'actuat':124 'actuator/prometheus':30 'add':256 'alert':70 'align':329 'anti':234 'anti-pattern':233 'appli':224,254,300 'applic':85,137 'application-level':136 'appropri':303 'avoid':318 'backend':335 'cardin':25,55,100,102,166,184,290,317 'chang':246 'churn':321 'clean':239,243 'code':298 'configur':322 'confirm':348 'consist':305 'constraint':157,365 'consum':355 'contract':269 'control':26,54,316 'convent':24,96,307 'cost':154,182 'cost-effici':153 'counter':88,203 'counter/timer/gauge/distributionsummary/longtasktimer':301 'cover':73 'creation':175 'dashboard':68 'dashboards/alerts':353 'defin':48,264 'degrad':177 'design':22,120,140,171 'detail':361 'dimens':101 'distributionsummari':90,219 'dynam':319 'effect':41 'effici':155 'emit':357 'emphasi':148 'endpoint':347 'ensur':304,352 'error':276 'event':207 'exampl':231,363 'except':197 'excess':173 'expect':349 'explos':112 'export':330 'expos':62 'first':79,185 'full':196 'gaug':91,211 'goal':266 'good/bad':229 'guidanc':122,362 'harden':312 'histogram/percentile':113,323 'identifi':270 'implement':12,40 'improv':14,252 'includ':20 'increas':181,206 'indic':273 'instrument':44,142,159,230,261,297,313 'integr':31,121 'java':3,15,35,42,84,145 'java-observability-metrics-micromet':2 'key':271 'labels/units':350 'latenc':210,275 'level':52,138 'lifecycl':105 'longtasktim':92 'low':99,165,183,289 'low-cardin':98,164,288 'map':280 'meaning':49 'measur':265 'messag':198 'meter':21,59,86,104,174,200,268,294,320 'metric':5,16,33,36,43,53,78,119,131,139,158,188,253,257,284,340,342 'metrics-first':77 'micromet':6,19,39,46,82,255,260 'monoton':205 'must':160 'mvn':242 'name':93,285,306 'naming/tag':23 'need':10,327 'never':186 'observ':4,17,37,80,178,258 'oper':150,162 'operation':339 'orient':118 'path':299 'pattern':235 'percentiles/histograms':29 'pipelin':126 'point':214 'point-in-tim':213 'poor':169 'prevent':108 'product':64,315 'production-readi':63 'prometheus/opentelemetry':125 'qualiti':143 'ratio':277 'raw':194 'read':225 'readi':65 'refactor':259 'refer':227,359 'references/182-java-observability-metrics-micrometer.md':367,368 'registr':132 'reusabl':309 'right':58,199 'run':237 'runtim':346 'safe':163 'safeguard':106 'sampl':221 'satur':278 'scope':135 'see':366 'select':56,87,293 'seri':111,358 'servic':51,146,272 'service-level':50 'set':331 'skill':76,251 'skill-182-java-observability-metrics-micrometer' 'slo':117 'slo-ori':116 'source-jabrena' 'stabl':283 'state':217 'strategi':114,324 'summari':28 'system':179 'tag':95,170,187,291,310 'telemetri':66,156,334 'test':127,344 'throughput':274 'time':110,216 'time-seri':109 'timer':89,208 'timers/counters/gauges/distribution':27 'topic-agent-skills' 'topic-ai-skills' 'topic-claude' 'topic-claude-code' 'topic-claude-code-skills' 'topic-claude-code-subagents' 'topic-claude-skills' 'topic-cursor-agent' 'topic-cursor-ai' 'topic-cursor-skills' 'topic-cursorai' 'topic-github-copilot' 'type':60,201,295 'unbound':190 'unit':286 'url':195 'use':7,151,202,249 'userid':192 'uuid':193 'valid':168,337 'validati':34 'valu':134,191,222 'verif':129 'verifi':236,240,244,341 'workflow':262","prices":[{"id":"254ac023-25bf-481d-a0dd-146f92391031","listingId":"9c42ce07-4637-4018-bf0a-cad2e068b4c0","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"jabrena","category":"cursor-rules-java","install_from":"skills.sh"},"createdAt":"2026-05-07T12:55:06.703Z"}],"sources":[{"listingId":"9c42ce07-4637-4018-bf0a-cad2e068b4c0","source":"github","sourceId":"jabrena/cursor-rules-java/182-java-observability-metrics-micrometer","sourceUrl":"https://github.com/jabrena/cursor-rules-java/tree/main/skills/182-java-observability-metrics-micrometer","isPrimary":false,"firstSeenAt":"2026-05-07T12:55:06.703Z","lastSeenAt":"2026-05-18T18:54:19.436Z"}],"details":{"listingId":"9c42ce07-4637-4018-bf0a-cad2e068b4c0","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"jabrena","slug":"182-java-observability-metrics-micrometer","github":{"repo":"jabrena/cursor-rules-java","stars":384,"topics":["agent-skills","ai-skills","claude","claude-code","claude-code-skills","claude-code-subagents","claude-skills","cursor-agent","cursor-ai","cursor-skills","cursorai","github-copilot","intellij-idea","java","prompting","system-prompts"],"license":"apache-2.0","html_url":"https://github.com/jabrena/cursor-rules-java","pushed_at":"2026-05-18T13:53:37Z","description":"A curated and opinionated collection of Skills and Agents to be used in modern SDLC workflows for Java Enterprise development with your favorite AI Agent harness.","skill_md_sha":"d5e0c3536c768b07e0ea42326917c44cd2fa08d0","skill_md_path":"skills/182-java-observability-metrics-micrometer/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/jabrena/cursor-rules-java/tree/main/skills/182-java-observability-metrics-micrometer"},"layout":"multi","source":"github","category":"cursor-rules-java","frontmatter":{"name":"182-java-observability-metrics-micrometer","license":"Apache-2.0","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. Part of cursor-rules-java project"},"skills_sh_url":"https://skills.sh/jabrena/cursor-rules-java/182-java-observability-metrics-micrometer"},"updatedAt":"2026-05-18T18:54:19.436Z"}}