Scrivio Interview library
DesignAdvanced6 min read · updated 12 November 2026

Define an actuator standard for all services: which endpoints, on which port, with which security, and how monitoring tools discover them.

The standard exposes health with probes, info and prometheus (or metrics) to the platform and every other endpoint only to operators. It picks one port approach, either a separate management.server.port or the main port with path rules, and applies it everywhere, secures non-public endpoints with a dedicated SecurityFilterChain and operator roles, ships all of this in a platform starter so services get it by default, and lets monitoring discover services through standard Kubernetes conventions such as scrape annotations or Prometheus Operator ServiceMonitors.

Why this question is asked

When every team configures Actuator by itself, the result is predictable: some services expose everything, some expose nothing, health lives on four different paths, and the monitoring team maintains a spreadsheet of exceptions. Interviewers ask this design question to see whether we can turn good per-service practice into a platform standard that teams adopt without effort. In this answer, we will set the endpoint policy, choose the port model, define the security, package it all in a starter, and describe how monitoring and probes discover every service the same way.

1What the Standard Must Achieve

The standard has three goals. Safety: no service publishes an endpoint that reveals secrets, by mistake or by default. Uniformity: the platform can probe, scrape and inspect any service without knowing anything special about it. Low effort: a team that does nothing gets the standard, and a team that needs something extra knows how to ask.

Each decision below serves those goals, and the most important one is the last: if the standard lives in a document instead of in code, it will drift.

2Which Endpoints, for Whom

The platform-facing endpoints are health, with liveness and readiness groups enabled, info, with build and git information, and prometheus, since our monitoring is Prometheus-based (metrics if it is not). Operator endpoints, such as loggers, threaddump, env and configprops, are exposed but require the operator role, with loggers read-only by default so changing a level is a deliberate, separate permission. heapdump is not exposed; heap dumps go through platform tooling with an audit trail. shutdown stays at access none.

The Actuator standard
EndpointAudienceRule
health, liveness, readinessKubernetes, load balancersOpen; details only when authorized
infoDeploy tools, operatorsOpen internally; build and git only
prometheusMonitoringMONITORING role or network identity
loggers, threaddumpOperatorsOPS role; loggers read-only
env, configprops, beansOperatorsOPS role; values masked
heapdump, shutdownNobodyNot exposed; access none

3One Port Approach for Everyone

There are two reasonable models. A separate management.server.port, for example 9090, is easy to isolate with a network policy that admits only the kubelet and the monitoring namespace, and the ingress never routes to it. Its costs are a second listener per service, and probes that check the management server rather than the server users hit. The main port with path rules keeps one listener, so probes test the real server, but every service depends on the ingress and security rules to keep /actuator away from the public.

Either works. The important decision is to pick one and apply it everywhere, because the value of the standard comes from probes, scrape configuration and network policies that are identical for every service. I would choose the separate port, because a mistake then fails closed: an endpoint exposed by accident is still unreachable from outside the cluster.

4Security and the Platform Starter

All of the configuration lives in a platform starter, a shared library every service already depends on, as auto-configuration with defaults. Services get the standard by upgrading the starter, and they can override a property when they have an approved reason.

Java
# platform-starter: META-INF default properties (applied with low precedence)
management.server.port=9090
management.endpoints.web.exposure.include=health,info,prometheus,loggers,threaddump,env,configprops
management.endpoint.health.probes.enabled=true
management.endpoint.health.show-details=when-authorized
management.endpoint.loggers.access=read-only
management.endpoints.access.max-permitted=read-only # Boot 3.4+: no write operations unless overridden
management.info.git.mode=simple
// platform-starter: auto-configured security for Actuator only
@AutoConfiguration
class PlatformActuatorSecurity {
@Bean
@Order(Ordered.HIGHEST_PRECEDENCE)
@ConditionalOnMissingBean(name = "actuatorSecurity")
SecurityFilterChain actuatorSecurity(HttpSecurity http) throws Exception {
return http.securityMatcher(EndpointRequest.toAnyEndpoint())
.authorizeHttpRequests(a -> a
.requestMatchers(EndpointRequest.to("health", "info")).permitAll()
.requestMatchers(EndpointRequest.to("prometheus")).hasRole("MONITORING")
.anyRequest().hasRole("OPS"))
.oauth2ResourceServer(o -> o.jwt(Customizer.withDefaults())) // operator tokens from our IdP
.build();
}
}

Notice that the security chain matches only Actuator endpoints, so it does not interfere with the service's own security for its business API. The roles come from the organisation's identity provider, so access to operator endpoints follows the same joiner and leaver process as everything else. max-permitted caps every endpoint at read-only, so even a team that sets an endpoint to unrestricted does not get write operations unless the platform cap is raised for it.

5How Monitoring and Probes Discover Services

Discovery should need no per-service configuration. The deployment template sets the probes to the same paths and port for every service, and it declares the metrics endpoint in a way Prometheus understands. In clusters that use the Prometheus Operator, a ServiceMonitor selects services by a label and scrapes the named port; in simpler setups, the widely used prometheus.io scrape annotations, a community convention rather than part of Kubernetes itself, tell Prometheus where to look.

YAML
# deployment template (the same for every service)
ports:
- { name: http, containerPort: 8080 }
- { name: management, containerPort: 9090 }
livenessProbe: { httpGet: { path: /actuator/health/liveness, port: management } }
readinessProbe: { httpGet: { path: /actuator/health/readiness, port: management } }
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata: { name: platform-services }
spec:
selector: { matchLabels: { platform/actuator: "standard" } }
endpoints:
- { port: management, path: /actuator/prometheus, interval: 30s }
Step throughHow the standard reaches every service
  1. Platform starterexposure, access caps, security chain
  2. Service codeonly its own health indicators and info
  3. Deployment templateports, probes, actuator label
  4. ServiceMonitor or annotationsPrometheus finds every labelled service
  5. Network policyport 9090 only from kubelet and monitoring

5 layers, from the top down. Step through them one at a time.

With this, a new service appears in dashboards and gets probes the moment it is deployed with the template's label. Nobody files a ticket to add it to monitoring.

6Follow-up questions

What if a team needs heapdump during an incident?

The standard routes that through platform tooling, such as a runbook that runs jcmd in the pod with audited access, rather than exposing the endpoint. If a team truly needs the endpoint, it is an exception with a reason and an end date, and the platform raises the cap for that service only.

How do you roll out the standard to existing services?

Release it in the starter behind a property that defaults to the old behaviour, publish a report of which services differ, help teams switch one by one, and then flip the default. A deploy check that compares the effective Actuator configuration with the standard shows progress and catches drift.

How do you keep the standard from blocking teams?

Make the common needs part of the standard, such as custom health indicators and info contributors, which work without changes, and give a clear exception process for the rest. Teams resist standards that make normal work harder, not ones that remove decisions they never wanted to make.

7Conclusion

In this answer, we defined an Actuator standard: health with probes, info and prometheus for the platform, other endpoints only for operators, heapdump and shutdown not available. We chose one port approach, a separate management port isolated by network policy, secured non-public endpoints with a dedicated SecurityFilterChain and roles from the identity provider, shipped it all in the platform starter with access caps, and made monitoring and probes discover every service through the deployment template and ServiceMonitors or scrape annotations.

What to say in the interviewAbout 80 seconds aloud

Open with

I would make the standard code, not a document, so services get it by default. Endpoints first: health with liveness and readiness groups, info with build and git details, and prometheus go to the platform.

Then, if they want more

Operator endpoints like loggers, threaddump, env and configprops are exposed only to an operator role, with loggers read-only, and heapdump and shutdown are not available, heap dumps go through audited tooling instead.

For the port, there are two valid models, a separate management.server.port or the main port with path rules, and the key is to pick one and use it everywhere. I would choose a separate port like 9090 with a network policy allowing only the kubelet and monitoring, so an accidental exposure still fails closed.

Security is a dedicated SecurityFilterChain that matches only Actuator endpoints through EndpointRequest: health and info open, with details only when authorized, prometheus for a monitoring role, and the rest for operators, using tokens from our identity provider. All of this ships in the platform starter, including max-permitted access as a cap, and teams override only with an approved reason.

For discovery, the deployment template sets identical probes and a label, and a Prometheus Operator ServiceMonitor, or the common scrape annotations, picks up every labelled service automatically. A deploy check catches drift.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Spring Boot reference, Actuator
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Define an actuator standard for all services: which endpoints, on which port, with which...": https://scrivio-interview-library.netlify.app/spring-boot/actuator/36755d43c5/