OkapiMicrometerAutoConfiguration has no property-level opt-out, and the flag a user would naturally reach for is silently ignored.
Current state
OkapiMetricsProperties (OkapiMetricsProperties.kt:14-16) exposes only refreshInterval:
@ConfigurationProperties(prefix = "okapi.metrics")
data class OkapiMetricsProperties(
val refreshInterval: Duration = Duration.ofSeconds(15),
)
and OkapiMicrometerAutoConfiguration carries no @ConditionalOnProperty. Because ignoreUnknownFields defaults to true, setting okapi.metrics.enabled=false binds nothing, raises nothing, and changes nothing:
--okapi.metrics.enabled=false → context starts, TOTAL okapi_* series: 12 (unchanged)
The only mechanism that works is excluding the whole auto-configuration:
--spring.autoconfigure.exclude=com.softwaremill.okapi.springboot.OkapiMicrometerAutoConfiguration → 0 series
Both verified on v1.0.0 (e199775).
Why it matters
This is inconsistent with the rest of the library, which offers okapi.processor.enabled, okapi.purger.enabled and okapi.liquibase.enabled. A user who sets okapi.metrics.enabled=false gets no feedback and will reasonably believe metrics are off, while OutboxMetricsRefresher keeps its daemon thread and keeps issuing two store queries every refreshInterval (15s by default).
Wanting to stop the gauge polling without dropping okapi-micrometer entirely is a realistic need — reducing database load, quieting things during an incident, or a publish-only/worker deployment that still wants the delivery counters.
The severity is low; the silent-ignore is the annoying part, not the polling itself.
Possible directions
Add okapi.metrics.enabled as a @ConditionalOnProperty on the bean factory (matching how processor/purger/liquibase do it, per the convention that enabled is a condition rather than a field in the *Properties class). A narrower alternative would be a flag that stops only the refresher, keeping the counters registered by MicrometerOutboxListener.
Either way, documenting the existing spring.autoconfigure.exclude route in the README would help — none of the .enabled opt-outs are currently mentioned there.
OkapiMicrometerAutoConfigurationhas no property-level opt-out, and the flag a user would naturally reach for is silently ignored.Current state
OkapiMetricsProperties(OkapiMetricsProperties.kt:14-16) exposes onlyrefreshInterval:and
OkapiMicrometerAutoConfigurationcarries no@ConditionalOnProperty. BecauseignoreUnknownFieldsdefaults totrue, settingokapi.metrics.enabled=falsebinds nothing, raises nothing, and changes nothing:The only mechanism that works is excluding the whole auto-configuration:
Both verified on v1.0.0 (
e199775).Why it matters
This is inconsistent with the rest of the library, which offers
okapi.processor.enabled,okapi.purger.enabledandokapi.liquibase.enabled. A user who setsokapi.metrics.enabled=falsegets no feedback and will reasonably believe metrics are off, whileOutboxMetricsRefresherkeeps its daemon thread and keeps issuing two store queries everyrefreshInterval(15s by default).Wanting to stop the gauge polling without dropping
okapi-micrometerentirely is a realistic need — reducing database load, quieting things during an incident, or a publish-only/worker deployment that still wants the delivery counters.The severity is low; the silent-ignore is the annoying part, not the polling itself.
Possible directions
Add
okapi.metrics.enabledas a@ConditionalOnPropertyon the bean factory (matching howprocessor/purger/liquibasedo it, per the convention thatenabledis a condition rather than a field in the*Propertiesclass). A narrower alternative would be a flag that stops only the refresher, keeping the counters registered byMicrometerOutboxListener.Either way, documenting the existing
spring.autoconfigure.excluderoute in the README would help — none of the.enabledopt-outs are currently mentioned there.