Files
spring-boot-demo/actuator-in-production/scripts/demo-default-exposure.sh
Ankur Mhatre 958b401f0f Spring Boot startup time: bean-by-bean diagnosis, and one directory per post
Adds spring-boot-startup-time/, the companion project for BLOG-618: a runnable
Spring Boot 4.1.1 application on JDK 25 that installs BufferingApplicationStartup
and FlightRecorderApplicationStartup behind a system property, and a /diag/startup
endpoint that computes step self time -- the number /actuator/startup does not give
you and the one that names the actual culprits.

Captured under docs/output/: the step tree sorted both ways, the same startup as JFR
events, a +5000-class experiment putting 0.11 ms per scanned class on the classpath
scan tax, the silent truncation a 2048-step buffer performs, and JDK 25 AOT cache
timings (6.93 s to 4.82 s). Post body and metadata live in post/.

Moves the existing Actuator project into actuator-in-production/ so the repository
holds one directory per article; the root README is now an index.
2026-09-05 00:17:37 +05:30

23 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# What Actuator exposes when you add the starter and configure nothing.
set -uo pipefail
cd "$(dirname "$0")/.."
OUT=docs/output/01-default-exposure.txt
{
echo "### Spring Boot Actuator, starter added, ZERO management.* configuration"
echo
echo "\$ curl -s -u ops:ops-password http://localhost:8080/actuator"
curl -s -u ops:ops-password http://localhost:8080/actuator | python3 -m json.tool
echo
echo "\$ curl -s -o /dev/null -w '%{http_code}' -u ops:ops-password http://localhost:8080/actuator/env"
curl -s -o /dev/null -w '%{http_code}\n' -u ops:ops-password http://localhost:8080/actuator/env
echo " 404 = discovered but NOT exposed over HTTP. Exposure and existence are different things."
echo
echo "\$ curl -s -u ops:ops-password http://localhost:8080/actuator/health"
curl -s -u ops:ops-password http://localhost:8080/actuator/health | python3 -m json.tool
echo
echo " Only 'health' is web-exposed by default. show-details defaults to 'never', so even an"
echo " authenticated caller sees a bare status until you say otherwise."
} > "$OUT" 2>&1
echo "wrote $OUT"