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

Loki: Add line limit for annotations #31183

Merged
merged 2 commits into from
Feb 16, 2021
Merged

Conversation

ivanahuckova
Copy link
Member

What this PR does / why we need it:

We already had line limit and query type fields in Annotation Loki editor since implementing it in dashboard #29356. But unfortunately, these new fields weren't working (you couldn't input the number and couldn't switch query type). This PR fixes it and implements logic to limit number of logs in annotation queries and choose query type.

loki_annotations_limit.mov

Which issue(s) this PR fixes:

Fixes #21308

@@ -124,7 +124,7 @@ export class LokiDatasource extends DataSourceApi<LokiQuery, LokiOptions> {
runInstantQuery = (
target: LokiQuery,
options: DataQueryRequest<LokiQuery>,
responseListLength: number
responseListLength = 1
Copy link
Member Author

Choose a reason for hiding this comment

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

This is in the same way implemented in runRangeQuery.

Copy link
Member

@zoltanbedi zoltanbedi left a comment

Choose a reason for hiding this comment

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

lgtm 🦄

Copy link
Contributor

@mckn mckn left a comment

Choose a reason for hiding this comment

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

Awesome work! Looks great!

@ivanahuckova ivanahuckova merged commit 350dcb9 into master Feb 16, 2021
@ivanahuckova ivanahuckova deleted the ivana/loki-annotation-line branch February 16, 2021 12:27
ryantxu pushed a commit that referenced this pull request Feb 24, 2021
* Add line limit to Annotation query editor

* Refactor to keep type consistent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure loki as annotation source has option to set results limit
3 participants