Index of every page on this site: llms.txt
All skills
github avatar

/spring-observability

@f10fdb8 official
by githubgithub/awesome-copilot42k stars
5,426
Run it yourself

Add and review observability in Spring Boot 3/4 apps: Actuator exposure and health probes, Micrometer metrics, Observation API, OpenTelemetry tracing and OTLP/Prometheus export, structured logging with correlation ids, and safe use of heapdump/threaddump. Use when instrumenting, monitoring or troubleshooting a Spring Boot service.

Use this Skill: https://skilld.dev/gh/github/awesome-copilot/spring-observability

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesmetrics.md

≈513 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Micrometer metrics

Boot auto-configures a composite MeterRegistry plus a registry for each micrometer-registry-* found on the classpath.

Export

  • Prometheus scrape: add io.micrometer:micrometer-registry-prometheus (version managed by Boot) and expose prometheus. Endpoint: /actuator/prometheus.
  • OTLP push: io.micrometer:micrometer-registry-otlp, then management.otlp.metrics.export.url=http://collector:4318/v1/metrics. With Boot 4 spring-boot-starter-opentelemetry also provides OTLP export of metrics, traces and logs, check the Boot reference for current properties.
  • Disable all exporters in tests: management.defaults.metrics.export.enabled=false.

Common tags

@Bean
MeterRegistryCustomizer<MeterRegistry> commonTags(@Value("${spring.application.name}") String app) {
    return r -> r.config().commonTags("application", app);
}

(Package: Boot 3.x org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer; Boot 4.x org.springframework.boot.micrometer.metrics.autoconfigure.MeterRegistryCustomizer.) Alternatively management.metrics.tags.application=${spring.application.name}.

Custom metrics

Counter.builder("orders.created").tag("channel", "web").register(registry).increment();
Timer.builder("orders.processing").publishPercentileHistogram().register(registry).record(() -> process());
Gauge.builder("orders.queue.size", queue, Queue::size).register(registry);
  • Use @Timed/@Counted only with the TimedAspect/CountedAspect beans and AOP present.
  • Keep tag cardinality bounded (never user ids, raw URLs, exception messages).
  • HTTP server metrics: http.server.requests is on by default; enable histograms with management.metrics.distribution.percentiles-histogram.http.server.requests=true.
  • JVM, DB pool (HikariCP), cache, Kafka and executor metrics are automatic when present.

Testing

Use SimpleMeterRegistry in unit tests, and @AutoConfigureObservability (or enable export explicitly) in slices that disable metrics by default.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 alert5d3 checks · Risk SAFE
  • Gen Agent Trust Hub5d

    The skill provides comprehensive guidelines for implementing and managing observability in Spring Boot applications. It follows secure defaults, includes explicit safety warnings regarding sensitive data (secrets, heap dumps), and recommends official or well-known community tools for development. No malicious patterns or security risks were detected.

  • Socket20d

    No alerts

  • Snyk5d

    Risk: CRITICAL · 2 issues

Signed by skilld at f10fdb8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 days ago.

Activeupdated last month

README badge

README badge for github/awesome-copilot/spring-observability