Skip to content

github/awesome-copilot / skills/spring-observability

spring-observability

Verified

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.

FileKindSize
SKILL.mdskill md3.7 KB
references/actuator.mdmarkdown1.9 KB
references/dumps-and-diagnostics.mdmarkdown1.4 KB
references/logging.mdmarkdown1.7 KB
references/metrics.mdmarkdown2.0 KB
references/tracing-observation.mdmarkdown2.7 KB

references/dumps-and-diagnostics.md

View on GitHub
# Heapdump, threaddump and runtime diagnosis

## Caveats

- `/actuator/heapdump` returns an HPROF file containing everything in memory: credentials, tokens, personal data. It also pauses the JVM and can be several GB.
- `/actuator/threaddump` reveals class names, thread states and sometimes parameters; it is a reconnaissance aid for attackers.
- Policy (shared with `java-diagnostics`): never expose either over public HTTP. The only exception is a temporary, user-consented window with authentication (admin role), TLS, and network restriction (separate management port, internal only), removed afterwards.
- Treat downloaded dumps as sensitive data; store encrypted, delete after analysis, never attach to public tickets.
- Boot 3.x/4.x can restrict access with `management.endpoint.heapdump.access=none` (Boot 3.4+); on older versions use `enabled=false`.

## Using them safely

```yaml
management:
  endpoints:
    web:
      exposure:
        include: health,info,threaddump     # heapdump only when needed
  endpoint:
    threaddump:
      access: read-only
```

Pair with a Spring Security chain restricting `EndpointRequest.to("heapdump","threaddump")` to an admin role (see `spring-security`).

## Going deeper

For JDK tools (`jcmd`, `jstack`, `jfr`, `jmap`, Eclipse MAT, JFR recording and analysis), use the `java-diagnostics` skill. Actuator metrics (`jvm.memory.used`, `jvm.gc.pause`, `hikaricp.connections.*`, `executor.*`) usually tell you which tool to reach for.
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 321kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 321kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 321kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 321kUpdated Claude CodeCodexVerifiedInstall