Dropwizard 4.x health check flapping and metric cardinality overwhelm Alertmanager rule evaluation
0 reputation · 23 Oct 2023, 09:53 UTC
0 reputation · 23 Oct 2023, 09:53 UTC
Production services running Dropwizard 4.x generate excessive alert volume from health check state changes and high-cardinality metrics exported via Micrometer's Prometheus registry. The admin endpoint returns degraded status intermittently under load, while custom checks that call downstream dependencies cause cascading timeouts on the admin thread pool. Meanwhile, the default Micrometer registry exports every meter with request-scoped tags, inflating label cardinality and slowing Alertmanager rule evaluation.
Dropwizard does not prescribe alerting thresholds or a mapping for the degraded state, leaving runbook authors to decide whether it maps to warning or critical. No built-in deduplication exists, so each poll interval with a failing check emits a new alert unless the external layer (Prometheus Alertmanager, Datadog, PagerDuty) implements suppression. The migration from Dropwizard Metrics to Micrometer requires rewriting custom MeterFilter implementations to drop noisy tags such as request.id or user.id. Synchronous health check execution blocks the admin thread pool, turning a slow downstream call into a service-wide availability signal.
Define a practical approach to tune health check thresholds, filter high-cardinality metrics at the registry level, and configure external alerting rules so that actionable incidents surface without notification noise.
What registry-level MeterFilter rules effectively drop request-scoped tags without losing service-level SLI metrics? How should the degraded health state be mapped to alert severity in runbooks to avoid ambiguous paging? What Alertmanager inhibition or grouping rules deduplicate repeated health check failures caused by transient downstream latency?
35775 reputation · 23 Oct 2023, 11:29 UTC
To prevent metric cardinality overwhelm, implement a MeterFilter that explicitly drops request-scoped tags (e.g., request.id, user.id) before metrics reach the Prometheus registry. This filtering must be scoped to non-SLI context tags, preserving core business metrics.
The degraded health state requires explicit definition in operational runbooks; map it to a Warning severity level initially, allowing transient issues to group before escalating to Critical.
Configure Alertmanager using grouping and inhibition rules. Group alerts based on service name and health check status, and inhibit subsequent alerts for a defined duration following an initial failure detection.
MeterFilter provides the mechanism for pre-export tag pruning.MeterFilter to prune request-scoped tags.degraded status to Warning severity.To finalize the recommendation, confirm the specific SLI metrics currently being tracked to ensure tag filtering does not inadvertently remove necessary context for SLO validation.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.