Actuator endpoints and their risks, AOP in Spring with a real aspect, what Spring Cloud provides for microservices, serverless with Spring Cloud Function, configuring Spring Cloud Gateway for routing, security and monitoring, and distributed tracing with Micrometer Tracing and OpenTelemetry (Sleuth's successor).
Published September 25, 2026
These questions cover the operational and platform side of Spring. Get the names and versions right: Sleuth is gone in Boot 3, Spring Cloud is its own release train, and Gateway comes in reactive and MVC flavours. That signals you've worked with a current stack.
Short answer: Actuator exposes operational endpoints under /actuator:
| Endpoint | Purpose |
|---|---|
health (+ liveness/readiness groups) | Aggregated health indicators, used for load balancers and Kubernetes probes |
info | Build, git and custom application info |
metrics, prometheus | Micrometer metrics (JVM, HTTP, pools, custom) |
loggers | View or change log levels at runtime |
env, configprops | Effective configuration (values masked) |
beans, conditions, mappings | The bean graph, auto-configuration report, request mappings |
threaddump, heapdump | Diagnostics |
scheduledtasks, caches, flyway/liquibase | Runtime state |
Key points to cover:
health is exposed over HTTP by default. Diagnostics such as env and heapdump leak secrets if they're public, so secure them (see the security lesson), or run them on a separate management port.@Endpoint, and custom health checks with HealthIndicator.Learn it in depth → Metrics & Monitoring
Short answer: AOP moves cross-cutting concerns (transactions, security, caching, metrics, auditing, retries) out of business methods and into aspects. Spring applies an aspect's advice at join points (method executions on beans), selected by pointcuts, by wrapping the beans in proxies. You use AOP constantly without writing any: @Transactional, @Cacheable, @Async, @PreAuthorize, @Retryable and @Timed are all aspects.
@Aspect
@Component
class AuditAspect {
@AfterReturning(pointcut = "@annotation(audited)", returning = "result")
void audit(JoinPoint jp, Audited audited, Object result) {
auditLog.record(audited.action(), currentUser(), jp.getArgs(), result);
}
}
@Audited(action = "REFUND_ISSUED") // custom annotation, used as a pointcut
public Refund issueRefund(long orderId, BigDecimal amount) { … }
Key points to cover:
private and final methods aren't advised.@Order when several aspects apply to the same method.Learn it in depth → Spring AOP
Short answer: Spring Cloud is an umbrella of projects, released as a release train aligned with Spring Boot versions, that implements common distributed-system patterns:
| Need | Spring Cloud project |
|---|---|
| Centralised configuration | Spring Cloud Config, Spring Cloud Vault / AWS / Azure integrations |
| Service discovery | Spring Cloud Netflix Eureka, Consul, Zookeeper, Kubernetes |
| Client-side load balancing | Spring Cloud LoadBalancer |
| Edge routing | Spring Cloud Gateway |
| Declarative HTTP clients | Spring Cloud OpenFeign |
| Resilience | Spring Cloud Circuit Breaker (Resilience4j) |
| Messaging abstraction | Spring Cloud Stream (Kafka/RabbitMQ binders) |
| Serverless | Spring Cloud Function |
| Contract testing | Spring Cloud Contract |
Common trap: calling Spring Cloud a "component of the Spring Framework". It's a separate set of projects built on Spring Boot. On Kubernetes, the platform already covers several of these needs (discovery, config, load balancing), so teams adopt only the parts they need.
Short answer: You write business logic as plain java.util.function beans: a Function<I,O>, Supplier<O> or Consumer<I>. Spring Cloud Function adapts those beans to different execution targets with no code changes: HTTP endpoints (spring-cloud-function-web), message-driven processing (Spring Cloud Stream), and serverless platforms (AWS Lambda, Azure Functions, GCP) through adapter modules.
@Bean
Function<OrderPlaced, Invoice> generateInvoice(InvoiceService invoices) {
return invoices::createFor; // the same bean can run as Lambda, as an HTTP POST, or on a Kafka topic
}
Key points to cover:
Short answer:
lb://service-id for discovery-based load balancing./actuator/gateway/routes), Micrometer metrics per route, and tracing that propagates trace IDs downstream.spring:
cloud:
gateway:
routes:
- id: orders
uri: lb://order-service
predicates: [ "Path=/api/orders/**" ]
filters:
- name: CircuitBreaker
args: { name: orders, fallbackUri: "forward:/fallback/orders" }
- name: RequestRateLimiter
args: { redis-rate-limiter.replenishRate: 50, redis-rate-limiter.burstCapacity: 100 }
Key points to cover:
Learn it in depth → API Gateway
Short answer: In Spring Boot 3, tracing is provided by Micrometer Tracing, with a bridge to OpenTelemetry (or Brave), and an exporter (OTLP to Jaeger, Tempo, Zipkin or a vendor). Boot auto-instruments incoming and outgoing HTTP (RestClient, WebClient), Kafka, JDBC (with add-ons) and @Observed methods, propagates W3C traceparent headers, and puts traceId/spanId into the logs (MDC). You then follow one request across services, see where time is spent, and jump from a trace to its logs.
<dependency><groupId>io.micrometer</groupId><artifactId>micrometer-tracing-bridge-otel</artifactId></dependency>
<dependency><groupId>io.opentelemetry</groupId><artifactId>opentelemetry-exporter-otlp</artifactId></dependency>
management:
tracing:
sampling:
probability: 0.1 # sample 10% in production; 1.0 in development
otlp:
tracing:
endpoint: http://otel-collector:4318/v1/traces
Common trap: recommending Spring Cloud Sleuth. It supports only Boot 2.x. Its functionality moved into Micrometer Tracing for Boot 3.
Key points to cover:
Learn it in depth → Distributed Tracing
Q: What is the Micrometer Observation API?
A: A single instrumentation API (Observation) that produces metrics and traces (and log correlation) from one piece of instrumentation. Spring Boot 3 uses it internally. You can use it through @Observed, or ObservationRegistry.
Q: How do you add a custom health check?
A: Implement HealthIndicator (or ReactiveHealthIndicator), and return Health.up() or .down().withDetail(...). Put it in the readiness group only if a failure really means "don't send me traffic".
Q: What's the difference between metrics, logs and traces? A: Metrics are cheap, aggregated numbers over time, used for alerting and trends. Logs are detailed, discrete events, used for investigation. Traces show the causal path and timing of one request across services. You need all three, linked by the trace ID.
Q: Why use a gateway instead of exposing each service? A: A single entry point centralises TLS, authentication, rate limiting, CORS and routing. It hides the internal topology, and lets services change without breaking clients.