spring-actuator
Spring Boot Actuator for monitoring and management. Covers health indicators, metrics with Micrometer, Prometheus integration, custom endpoints, Kubernetes probes, and endpoint security. USE WHEN: user mentions "actuator", "health endpoint", "metrics", "prometheus", "micrometer", "kubernetes probes", "liveness", "readiness", "/health", "/metrics" DO NOT USE FOR: application profiling - use `spring-profiles` instead, distributed tracing - use `micrometer-tracing` instead
What this skill does
# Spring Boot Actuator
## Quick Start
```xml
<!-- pom.xml -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
```
```yaml
# application.yml
management:
endpoints:
web:
exposure:
include: health,info,metrics,prometheus
endpoint:
health:
show-details: when_authorized
info:
env:
enabled: true
info:
app:
name: @project.name@
version: @project.version@
```
---
## Endpoints Configuration
```yaml
management:
endpoints:
web:
exposure:
include: "*" # Dev: all
# include: health,info,metrics,prometheus # Prod
exclude: shutdown,threaddump
base-path: /actuator
endpoint:
health:
enabled: true
show-details: when_authorized
show-components: when_authorized
shutdown:
enabled: false # Dangerous in prod
```
### Available Endpoints
| Endpoint | Description | Default |
|----------|-------------|---------|
| `/health` | Health status | Enabled |
| `/info` | App info | Enabled |
| `/metrics` | Metrics | Enabled |
| `/prometheus` | Prometheus format | Enabled* |
| `/env` | Environment properties | Disabled |
| `/configprops` | Configuration properties | Disabled |
| `/beans` | All beans | Disabled |
| `/mappings` | Request mappings | Disabled |
| `/loggers` | Logger levels | Disabled |
| `/threaddump` | Thread dump | Disabled |
| `/shutdown` | Graceful shutdown | Disabled |
---
## Health Indicators
```yaml
management:
health:
db:
enabled: true
redis:
enabled: true
diskspace:
enabled: true
threshold: 10MB
```
### Custom Health Indicator
```java
@Component
public class ExternalServiceHealthIndicator implements HealthIndicator {
private final RestClient restClient;
@Override
public Health health() {
try {
long startTime = System.currentTimeMillis();
ResponseEntity<Void> response = restClient.get()
.uri("/health")
.retrieve()
.toBodilessEntity();
long responseTime = System.currentTimeMillis() - startTime;
if (response.getStatusCode().is2xxSuccessful()) {
return Health.up()
.withDetail("service", "external-api")
.withDetail("responseTime", responseTime + "ms")
.build();
}
return Health.down().build();
} catch (Exception e) {
return Health.down()
.withDetail("error", e.getMessage())
.build();
}
}
}
```
> **Full Reference**: See [health.md](health.md) for composite indicators, health groups, and availability management.
---
## Kubernetes Probes
```yaml
management:
endpoint:
health:
probes:
enabled: true
group:
liveness:
include: livenessState
readiness:
include: readinessState,db,redis
health:
livenessstate:
enabled: true
readinessstate:
enabled: true
```
```yaml
# Kubernetes deployment
spec:
containers:
- name: app
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: 8080
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: 8080
initialDelaySeconds: 10
periodSeconds: 5
```
> **Full Reference**: See [health.md](health.md) for availability state management and K8s probe configuration.
---
## Metrics with Micrometer
```yaml
management:
metrics:
enable:
all: true
tags:
application: ${spring.application.name}
environment: ${spring.profiles.active:default}
distribution:
percentiles-histogram:
http.server.requests: true
```
### Custom Metrics
```java
@Service
public class OrderService {
private final MeterRegistry meterRegistry;
private final Counter orderCounter;
private final Timer orderProcessingTimer;
public OrderService(MeterRegistry meterRegistry) {
this.meterRegistry = meterRegistry;
this.orderCounter = Counter.builder("orders.created")
.description("Total orders created")
.register(meterRegistry);
this.orderProcessingTimer = Timer.builder("orders.processing.time")
.publishPercentiles(0.5, 0.95, 0.99)
.register(meterRegistry);
}
public Order createOrder(OrderRequest request) {
return orderProcessingTimer.record(() -> {
Order order = processOrder(request);
orderCounter.increment();
return order;
});
}
}
```
> **Full Reference**: See [metrics.md](metrics.md) for annotations, Prometheus config, and Grafana alerts.
---
## Prometheus Integration
```yaml
management:
endpoints:
web:
exposure:
include: prometheus
prometheus:
metrics:
export:
enabled: true
```
```yaml
# prometheus.yml
scrape_configs:
- job_name: 'spring-boot-app'
metrics_path: '/actuator/prometheus'
scrape_interval: 15s
static_configs:
- targets: ['localhost:8080']
```
---
## Security
```java
@Configuration
@EnableWebSecurity
public class ActuatorSecurityConfig {
@Bean
public SecurityFilterChain actuatorSecurityFilterChain(HttpSecurity http) throws Exception {
return http
.securityMatcher(EndpointRequest.toAnyEndpoint())
.authorizeHttpRequests(auth -> auth
.requestMatchers(EndpointRequest.to("health", "info")).permitAll()
.requestMatchers(EndpointRequest.to("prometheus")).permitAll()
.requestMatchers(EndpointRequest.to("env", "beans")).hasRole("ADMIN")
.anyRequest().authenticated()
)
.httpBasic(Customizer.withDefaults())
.build();
}
}
```
```yaml
# Separate management port
management:
server:
port: 9090
address: 127.0.0.1
```
> **Full Reference**: See [custom-endpoints.md](custom-endpoints.md) for custom endpoints and testing.
---
## Best Practices
| Do | Don't |
|----|-------|
| Expose only necessary endpoints in prod | Expose all endpoints |
| Use health groups for K8s probes | Use single health endpoint |
| Configure metrics with consistent tags | Use high-cardinality tags |
| Implement custom health indicators | Rely only on built-in |
| Separate management port in production | Use same port as app |
---
## When NOT to Use This Skill
- **Application profiling** - Use `spring-profiles` for environment config
- **Distributed tracing** - Use `micrometer-tracing` for trace context
- **Log aggregation** - Use logging frameworks and ELK/Loki
- **APM tools** - Actuator complements Datadog, New Relic
---
## Common Pitfalls
| Error | Cause | Solution |
|-------|-------|----------|
| Endpoints not exposed | Missing config | Add to `management.endpoints.web.exposure.include` |
| Health always UP | Indicators not configured | Verify dependencies in classpath |
| Metrics missing | Registry not configured | Add `micrometer-registry-prometheus` |
| Security bypass | Endpoints public | Configure security for actuator |
| Memory leak | High cardinality tags | Avoid userId, requestId as tags |
---
## Anti-Patterns
| Anti-Pattern | Problem | Solution |
|--------------|---------|----------|
| Exposing all endpoints in prod | Security risk | Limit to health, metrics, prometheus |
| High cardinality metric tags | Memory explosion | Use bounded tag values |
| No auth on sensitive endpoints | Information leak | Configure Spring Security |
| Ignoring health groups | Poor K8s integration | Use liveness/readiness groups |
---
## Quick Troubleshooting
| Problem | Diagnostic | Fix |
|---Related in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.