ADR 0004: Configuration Visibility Actuator Endpoint
Author: AirCommerce Architecture Team • Scope: util-configuration
1. Context and Problem Statement
Section titled “1. Context and Problem Statement”In ADR 0003: Graceful Default Value Fallbacks, we implemented graceful fallback mechanisms that return application fields to their hardcoded default values when configurations are missing or deleted from the remote Configuration Service. While this greatly improved application resilience and prevented start-up crashes, it inadvertently created an observability blind spot. When a configuration was missing remotely, operations teams had no way to easily identify whether the application was running on its default values or if there was a synchronization issue, leading to potential “split-brain” debugging scenarios between the remote UI and the local application state. We needed a way to bridge this gap without breaking the fail-safe architecture.
2. Decision Drivers
Section titled “2. Decision Drivers”- Observability: Operations teams need clear, immediate visibility into what configurations the application is actively using.
- Developer Experience (DX): Finding configuration inconsistencies should not require digging through code or attaching a debugger.
- Security & Encapsulation: Exposing internal state must be done safely without cluttering business APIs.
- Backwards Compatibility: The
util-configurationlibrary is shared across many services; any added visibility features must not forcibly alter the host application’s dependencies (e.g., forcing them to include Actuator if they don’t want to).
3. Considered Options
Section titled “3. Considered Options”- Option 1: Log all effective configurations on startup
- Option 2: Expose a standard Spring
@RestControllerendpoint - Option 3 (Chosen): Expose a custom Spring Boot Actuator Endpoint (
@Endpoint) with@ConditionalOnClass
4. Decision Outcome
Section titled “4. Decision Outcome”We chose Option 3, because it natively aligns with industry standards for application operability while protecting the encapsulation of host microservices.
4.1. Implementation Mechanics
Section titled “4.1. Implementation Mechanics”Custom Actuator Endpoint
Section titled “Custom Actuator Endpoint”By leveraging Spring Boot Actuator (@Endpoint(id = "aircommerceConfig")), we ensure that configuration visibility integrates directly into the host application’s existing management port and security configurations. The endpoint queries the ConfigurationFieldRegistry and ConfigurationNamespaceLoader to identify the live, injected value of all fields, explicitly tagging them as either REMOTE or FALLBACK_DEFAULT.
Graceful Degradation via Conditional Logic
Section titled “Graceful Degradation via Conditional Logic”To ensure that util-configuration remains a lightweight and un-intrusive library, spring-boot-starter-actuator is included only as an <optional>true</optional> dependency. The endpoint itself is annotated with @ConditionalOnClass(Endpoint.class), meaning that if a host microservice does not use Actuator, the endpoint is completely ignored during component scanning, preventing ClassNotFoundException errors.
Status Mappings
Section titled “Status Mappings”The actuator endpoint returns an explicit status field for every tracked configuration to instantly alert operations to its origin:
REMOTE: Mapped when the configuration key exists in the remote payload fetched by theConfigurationNamespaceLoader. This indicates the application successfully retrieved and injected the configuration from the centralized server.FALLBACK_DEFAULT: Mapped when the configuration key is absent from the remote payload. This indicates the application could not find the key remotely (either it was deleted or never created) and has gracefully fallen back to the local, hardcoded default value stored in the source code.GARBAGE_COLLECTED: Mapped when the underlying Java bean that held the configuration field has been destroyed or garbage-collected by the JVM (tracked viaWeakReference). This is an edge-case indicating the configuration field is no longer actively in use in memory.
Payload Structure
Section titled “Payload Structure”{ "totalTrackedFields": 1, "configurations": [ { "namespace": "payment-service", "key": "feature.paypal.enabled", "status": "FALLBACK_DEFAULT", "remoteType": null, "declaringClass": "one.aircommerce.payment.config.PaymentConfig", "fieldName": "paypalEnabled", "fieldType": "Boolean", "defaultValue": false, "currentValue": false, "lastUpdated": "2026-09-11T12:00:00Z" } ]}5. Pros and Cons of the Options
Section titled “5. Pros and Cons of the Options”Option 1: Log all effective configurations on startup
Section titled “Option 1: Log all effective configurations on startup”- Good: Extremely simple to implement; requires no new endpoints or dependencies.
- Bad: Configurations can change at runtime via Spring Cloud Bus events. A startup log quickly becomes stale and is difficult to query when troubleshooting a live incident.
Option 2: Expose a standard Spring @RestController endpoint
Section titled “Option 2: Expose a standard Spring @RestController endpoint”- Good: Accessible without requiring Actuator dependencies.
- Bad: Exposes internal operational state on the same port as business APIs, potentially leading to security leaks. Pollutes the host application’s API namespace.
Option 3 (Chosen): Expose a custom Spring Boot Actuator Endpoint (@Endpoint) with @ConditionalOnClass
Section titled “Option 3 (Chosen): Expose a custom Spring Boot Actuator Endpoint (@Endpoint) with @ConditionalOnClass”- Good: Integrates cleanly into existing monitoring stacks; separates management traffic from business traffic; uses reflection to definitively prove what value is currently sitting in memory.
- Bad: Adds slight complexity to the
util-configurationlibrary’s component scanning and classpath assumptions.
6. Validation and Verification Strategy
Section titled “6. Validation and Verification Strategy”- Conditional Bean Creation Tests: Verified via
@SpringBootTestsuites withoutspring-boot-starter-actuatoron classpath ensuring the bean context initializes cleanly. - Actuator Endpoint Tests: Verified via
WebTestClienthitting/actuator/aircommerceConfigensuring JSON schema matches expectedstatus,defaultValue, andcurrentValuefields. - Security Scans: Automated scans verify that Actuator endpoints are properly isolated to the internal management port and require appropriate administrative roles.
7. Migration and Rollout Consequences
Section titled “7. Migration and Rollout Consequences”- Zero Breaking Changes: Microservices without Actuator continue to function without any classpath issues.
- Observability Integration: Prometheus/Grafana or ops dashboards can optionally ingest this endpoint for platform-wide configuration drift auditing.