Skip to content

feat(ruler): add limit to list-rules API - #7785

Draft
kylestang wants to merge 1 commit into
cortexproject:masterfrom
kylestang:kyle/listrules-limit
Draft

feat(ruler): add limit to list-rules API#7785
kylestang wants to merge 1 commit into
cortexproject:masterfrom
kylestang:kyle/listrules-limit

Conversation

@kylestang

Copy link
Copy Markdown

This commit adds a limit to the number of rules returned by the ListRules prometheus API, after which the API will return 400 and an error message encourages the caller to use pagination.

This is being implemented after we found that serializing very large numbers of rules massively spikes the ruler CPU, which causes issues with rule evaluations and request timeouts.

What this PR does:

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]
  • docs/configuration/v1-guarantees.md updated if this PR introduces experimental flags

This commit adds a limit to the number of rules returned by the
ListRules prometheus API, after which the API will return 400 and an
error message encourages the caller to use pagination.

This is being implemented after we found that serializing very large
numbers of rules massively spikes the ruler CPU, which causes issues
with rule evaluations and request timeouts.

Signed-off-by: Kyle Stang <kylestng@amazon.com>
@kylestang
kylestang force-pushed the kyle/listrules-limit branch from 6a3e9f6 to b439734 Compare August 19, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant