Skip to content

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 <[email protected]>
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