Skip to content

Navigation Menu

Sign in
Sign up

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

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

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

Conversation

@kylestang

@kylestang kylestang commented Aug 19, 2026

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

kylestang force-pushed the kyle/listrules-limit branch 3 times, most recently from b13e6fd to 014cc97 Compare August 21, 2026 20:09
This commit adds a limit to the number of rules returned by the
ListRules prometheus API, after which the API will truncate the result
and return a pagination token for the next page. If a single rule group
is larger than the max, that rule group will still be returned.
This is being implemented after we found that JSON serializing a very large
number of rules massively spikes the ruler CPU, which causes issues
with rule evaluations and request timeouts.
Signed-off-by: Kyle Stang <kylestng@amazon.com>

Copy link
Copy Markdown
Contributor

Thanks @kylestang. The code looks solid.
Can you update the description? It seems outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /