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

UI only shows 100 alert rules even though there are more #1687

Closed
druchoo opened this issue Jul 4, 2017 · 8 comments
Closed

UI only shows 100 alert rules even though there are more #1687

druchoo opened this issue Jul 4, 2017 · 8 comments
Assignees
Milestone

Comments

@druchoo
Copy link

druchoo commented Jul 4, 2017

  • Full details of your operating system (or distribution): CentOS Linux release 7.2.1511 (Core)
  • The version of Chronograf you are running: chronograf-1.3.3.4-1.x86_64
  • Whether you installed it using a pre-built package, or built it from source: package
  • A small test case, if applicable, that demonstrates the issues: Create more than 100 tasks in Kapacitor
  • A screenshot, when appropriate, to demonstrate any issues that are related to the UI:
$ kapacitor stats general
ClusterID:                    ***
ServerID:                     ***
Host:                         ***
Tasks:                        162
Enabled Tasks:                162
Subscriptions:                13
Version:                      1.3.1

screenshot at jul 04 15-30-42

@nhaugo nhaugo added this to the 1.3.5 milestone Jul 6, 2017
@nhaugo nhaugo added the design label Jul 10, 2017
@nhaugo
Copy link
Contributor

nhaugo commented Jul 10, 2017

This should function similar to the alerts table on status.

@nhaugo nhaugo modified the milestones: 1.3.6, 1.3.5 Jul 25, 2017
@121watts 121watts self-assigned this Jul 27, 2017
@121watts
Copy link
Contributor

@nhaugo there is currently no limit placed on the GET to rules from the frontend. Perhaps the limit in on the server?

@druchoo
Copy link
Author

druchoo commented Jul 27, 2017

@121watts, Just a guess, but it looks like kapacitor's default limit of 100 is used when one is not specified. This is assuming Chronograf is using the same API call..

$ kapacitor stats general
ClusterID:                    ***
ServerID:                     ***
Host:                         ***
Tasks:                        328
Enabled Tasks:                328
Subscriptions:                16
Version:                      1.3.1

$ curl http://localhost:9092/kapacitor/v1/tasks -s | grep -c created
100

$ curl http://localhost:9092/kapacitor/v1/tasks?limit=101 -s | grep -c created
101

$ curl http://localhost:9092/kapacitor/v1/tasks?limit=500 -s | grep -c created
328

@121watts 121watts removed their assignment Jul 31, 2017
@cryptoquick
Copy link
Contributor

I did some research into this one...

This will need some Chronograf backend work. At first I was hoping to just modify the backend to send 0 as the limit, but this code prevents that trick:

https://github.com/influxdata/kapacitor/blob/a31abae7f2cd4bf056ae7ccccfb81daab93e513b/client/v1/client.go#L884

We could probably just implement pagination somewhere. It could paginate on the backend and return a full response so the frontend does not need to be modified. I am not aware of anywhere in the application that implements a real pagination flow, so that might prove to be more difficult, in that we don't have any frontend components or patterns of that sort to run with currently.

I am also wondering if pagination of any sort is required to satisfy this story. 100 is a little low, but perhaps 1000 or 10000 rules could be enough?

@druchoo
Copy link
Author

druchoo commented Aug 2, 2017

@cryptoquick, Would it make sense to do something like getting the total amount of ticks on page load to use as your limit? You would of course be able to use that number to correctly display the amount of "Alert Rules" as well. What do you think?

@121watts
Copy link
Contributor

121watts commented Aug 2, 2017

@goller thoughts? I don't think the chronograf server exposes a limit option for rules

@goller
Copy link
Contributor

goller commented Aug 2, 2017

@121watts @druchoo you are absolutely correct. We'll need to expose the limit/offset through the rules api

@nhaugo nhaugo modified the milestones: 1.3.7, 1.3.6 Aug 7, 2017
@nhaugo
Copy link
Contributor

nhaugo commented Aug 8, 2017

Loop through next until you reach the end of kapacitor tasks and put them all in the list

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

No branches or pull requests

8 participants