spring-observability
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.
- License 许可
- MIT
- 最近更新
- 2026-11-11
- Stars
- ★ 4.1w
- Forks
- 5.3k
01 前言 Front Matter
- name
- spring-observability
- description
- 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.
02 资源文件 5
- 参考文档references/actuator.md1.9 KB
- 参考文档references/dumps-and-diagnostics.md1.4 KB
- 参考文档references/logging.md1.7 KB
- 参考文档references/metrics.md2.0 KB
- 参考文档references/tracing-observation.md2.7 KB
03 SKILL.md 正文
Spring Boot observability
Covers Actuator, Micrometer, the Observation API, tracing, and logging. Details in references/. For JDK-level diagnosis (thread dumps, JFR, heap analysis) see the java-diagnostics skill; for securing endpoints see spring-security.
Safety rules
- Never read or print secrets (
.env, credentials, tokens) while inspecting configuration or/actuator/env. - Never expose
heapdumporthreaddumpover public HTTP. The only exception is a temporary, user-consented window with authentication, TLS and network restriction, removed afterwards (same policy injava-diagnostics). - Never expose
env,configprops,loggers, orshutdownin production without authentication and network restrictions. - Pin dependency versions via the Boot BOM; do not add explicit versions for Boot-managed artifacts.
Detect first
Check the Boot version (3.x or 4.x) and what is already present (spring-boot-starter-actuator, micrometer-registry-*, tracing/OTel dependencies, logback-spring.xml). Boot 4 modularized observability (spring-boot-micrometer-*, spring-boot-opentelemetry) but starters still bring them in.
Quick start
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
management:
endpoints:
web:
exposure:
include: health,info,prometheus # allow-list, never "*" in production
endpoint:
health:
probes:
enabled: true # /actuator/health/liveness and /readiness
show-details: when-authorized
Topics
- Actuator, health groups and probes, endpoint exposure
- Micrometer metrics and Prometheus/OTLP export
- Observation API and tracing with OpenTelemetry
- Structured logging and correlation ids
- Heapdump/threaddump caveats and runtime diagnosis
Checklist
- [ ] Only needed endpoints exposed and secured; separate management port if possible.
- [ ] Liveness/readiness probes configured for the platform (Kubernetes); readiness group includes critical dependencies only.
- [ ] Metrics exported to the chosen backend; common tags (
application,env) set; no high-cardinality tags (user ids, URLs with ids). - [ ] Tracing sampling probability set deliberately (Boot default 10%).
- [ ] Logs carry trace/span ids; JSON structured logs in production.
- [ ] Custom observations/metrics have tests.
Local runtime insights (optional)
For a local-only developer console (and an opt-in MCP server) that shows a running Spring Boot or Quarkus app's runtime state, see BootUI: https://github.com/jdubois/boot-ui and https://www.julien-dubois.com/boot-ui/. Its agent skill can be installed with gh skill install jdubois/boot-ui skills/bootui.
- Ask the user for consent before adding any dependency.
- Use it only in a dev/local profile (for example a Maven/Gradle profile or
developmentOnlyconfiguration); never ship it to production. - Follow BootUI's own documentation for coordinates and setup rather than copying them here.
See also: https://docs.spring.io/spring-boot/reference/actuator/observability.html and https://docs.micrometer.io/micrometer/reference/.
04 同仓库更多 Skills
supabase-rls-policies
Write, review, and test Supabase Row Level Security (RLS) policies so that one user cannot read or change another user's rows. Use when creating or changing tables, policies, views, or security definer functions in a Supabase project, when reviewing a migration that touches RLS, or when asked to prove user isolation with pgTAP tests that sign in as two users.
skill-distribution-audit
Audit a skill collection before release or investigate installer omissions, archived/template leakage, duplicate identities, and manifest drift. Reconcile the intended public source set, distribution manifest, and actual discovery output for a specified consumer version. Includes a deterministic set-comparison helper.
logicapps-custom-code-net10-migration
Migrate Azure Logic Apps Standard local-function custom-code projects from .NET 8 to .NET 10. Use for legacy Logic Apps custom-code workspace upgrades, project/package configuration, custom-worker settings, publication, and integrated VS Code debugging. Not for ordinary .NET applications, standalone Azure Functions, Consumption workflows, or cloud deployment.
winmd-api-search
Find and explore Windows desktop APIs. Use when building features that need platform capabilities — camera, file access, notifications, UI controls, AI/ML, sensors, networking, etc. Discovers the right API for a task and retrieves full type details (methods, properties, events, enumeration values).
resemble-detect
Deepfake detection and media safety — detect AI-generated audio, images, video, and text, trace synthesis sources, apply watermarks, verify speaker identity, and analyze media intelligence using Resemble AI
quality-playbook
Run a complete quality engineering audit on any codebase. Derives behavioral requirements from the code, generates spec-traced functional tests, runs a three-pass code review with regression tests, executes a multi-model spec audit (Council of Three), and produces a consolidated bug report with TDD-verified patches. Finds the 35% of real defects that structural code review alone cannot catch. Works with any language. Trigger on 'quality playbook', 'spec audit', 'Council of Three', 'fitness-to-purpose', or 'coverage theater'.