Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Querier] Add day range limit for LabelNames and LabelValues #6233

Merged
merged 3 commits into from
Oct 4, 2024

Conversation

afhassan
Copy link
Contributor

What this PR does:
Check day range limit in LabelNames and LabelValues. Return query too long error if MaxQueryLength limit is exceeded.

Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Can we add a unit test?

Signed-off-by: Ahmed Hassan <afayekhassan@gmail.com>
Signed-off-by: Ahmed Hassan <afayekhassan@gmail.com>
Signed-off-by: Ahmed Hassan <afayekhassan@gmail.com>
Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@yeya24 yeya24 merged commit e449374 into cortexproject:master Oct 4, 2024
16 checks passed
@alanprot
Copy link
Member

Seems this broke the query with no parameters as we default to min time

https://github.com/prometheus/prometheus/blob/d9a54284f5bcf5d82b2552a00fc476669c3634d5/web/api/v1/api.go#L670-L672

@yeya24
Copy link
Contributor

yeya24 commented Oct 10, 2024

Unfortunately I think it breaks things as by default label names and label values can have no start and end parameters specified.

So by default all those APIs without time range parameters will be denied. I think the behavior is not wrong but at current stage the behavior change breaks existing use cases.

So we need to find another way around. Maybe fallback to a smaller time range and add a warning

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.

3 participants