[consul] Make health check status cache size and TTL configurable#23603
Open
mwdd146980 wants to merge 5 commits intomasterfrom
Open
[consul] Make health check status cache size and TTL configurable#23603mwdd146980 wants to merge 5 commits intomasterfrom
mwdd146980 wants to merge 5 commits intomasterfrom
Conversation
Adds health_checks_cache_size and health_checks_cache_ttl options so users with large Consul clusters (>5000 distinct health checks) can size the in-memory transition-detection cache appropriately. Defaults preserve the prior 5000/3600 behavior. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files🚀 New features to boost your workflow:
|
🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 05fd936 | Docs | Datadog PR Page | Give us feedback! |
…fig path Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 36e7b7e10d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Validation ReportAll 20 validations passed. Show details
|
brett0000FF
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
ConsulCheckkeeps an in-memoryTTLCachekeyed by(check_id, service_id, service_name, node_name)to detect health check status transitions and emitconsul.check_failedevents. Both the size (5000) and TTL (3600s) have been hardcoded since the cache was introduced.Customers with large Consul clusters that report more than 5000 distinct health checks hit eviction. Evicted entries look new on the next run, which causes missed transitions and re-emitted failure events.
Closes AGENT-16145.
Approach
Two new instance/init_config options, falling back to the existing defaults:
health_checks_cache_size(default 5000)health_checks_cache_ttl(default 3600)Both are
fleet_configurableand constrained tominimum: 1in the spec. Pydantic codegen producesField(None, ge=1), so non-positive values are rejected at firstcheck()viacheck_initializationswith a clear error naming the bad field.The instance/init_config/default precedence matches the existing
max_services/threads_countpattern.Verification
ddev --no-interactive test consul: 28 passed, 3 skipped.ddev test -fs consul: clean.🤖 Generated with Claude Code