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

feat: added max_time_sereis and max_samples in prom queries #6802

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

aniketio-ctrl
Copy link
Contributor

@aniketio-ctrl aniketio-ctrl commented Jan 12, 2025

Summary

Added MaxTimeSeries, MaxSamples to limit prom queries.
we have set these values in context so that it can be picked while adding clickhouse settings.

Related Issues / PR's

https://github.com/SigNoz/engineering-pod/issues/1996


Important

Add MaxTimeSeries and MaxSamples to PromQuery and update context handling in querier.go to enforce query limits.

  • Behavior:
    • Add MaxTimeSeries and MaxSamples fields to PromQuery in v3.go to limit Prometheus queries.
    • Modify context in runPromQueries() in querier.go to include MaxTimeSeries and MaxSamples settings.
  • Constants:
    • Add ResultOverflowMode, MaxRowsToGroupBy, and MaxResultRows to constants.go for context settings.
  • Misc:
    • Update execPromQuery() calls in querier.go to use modified context with limits.

This description was created by Ellipsis for e67a024. It will automatically update as commits are pushed.

Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@github-actions github-actions bot added the enhancement New feature or request label Jan 12, 2025
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot 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 to me! Reviewed everything up to e67a024 in 1 minute and 15 seconds

More details
  • Looked at 80 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. pkg/query-service/app/querier/v2/querier.go:224
  • Draft comment:
    Modifying the context in a loop can lead to race conditions. Consider creating a new context for each goroutine using context.WithValue outside the loop.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
2. pkg/query-service/model/v3/v3.go:409
  • Draft comment:
    The Clone method should also clone MaxTimeSeries and MaxSamples to ensure all fields are copied.
  • Reason this comment was not posted:
    Comment was on unchanged code.
3. pkg/query-service/app/querier/v2/querier.go:219
  • Draft comment:
    Avoid using the component/index.tsx file structure approach, as it makes it difficult to debug and find components using global search tools like VS Code.
  • Reason this comment was not posted:
    Comment was not on a valid diff hunk.

Workflow ID: wflow_e3oTSegP0yJwKbfV


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs required enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants