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

Reject queries without a time range #3395

Merged
merged 6 commits into from
Jul 2, 2024
Merged

Reject queries without a time range #3395

merged 6 commits into from
Jul 2, 2024

Conversation

bryanhuhta
Copy link
Contributor

In grafana/explore-profiles#15, I ran across a bug where the UI was sending queries without a time range. It was a little tricky to track down because Pyroscope would respond with a success status code, but an empty payload. This made me wonder if there was a bug in Pyroscope's query logic.

I think we should classify queries with no time range an error. I don't know of any use cases in which we want to have a time range, but allow it to be optionally provided.

@bryanhuhta bryanhuhta self-assigned this Jul 2, 2024
@bryanhuhta bryanhuhta requested review from a team as code owners July 2, 2024 00:40
Copy link
Collaborator

@kolesnikovae kolesnikovae left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for looking into this!

The Unix time 0 is exactly midnight UTC on 1 January 1970

Although 0 is a valid Unix time, I do think we should report an error in this case.

pkg/validation/validate.go Outdated Show resolved Hide resolved
bryanhuhta and others added 3 commits July 2, 2024 13:37
@bryanhuhta bryanhuhta enabled auto-merge (squash) July 2, 2024 18:40
@bryanhuhta bryanhuhta disabled auto-merge July 2, 2024 18:40
@bryanhuhta bryanhuhta enabled auto-merge (squash) July 2, 2024 18:41
@bryanhuhta bryanhuhta merged commit c697f0d into main Jul 2, 2024
16 checks passed
@bryanhuhta bryanhuhta deleted the fix-range-validation branch July 2, 2024 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants