-
Notifications
You must be signed in to change notification settings - Fork 793
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
Add additional collector for SLM stats #558
Conversation
Signed-off-by: Mike Eves <michael.eves@autotrader.co.uk>
Signed-off-by: Mike Eves <michael.eves@autotrader.co.uk>
Signed-off-by: Mike Eves <michael.eves@autotrader.co.uk>
Thanks for your review @sysadmind With regards to counter suffix what's your opinion around the below? Currently there's e.g. Adding a There's also an argument that some of the total metrics could be removed in favour of just the policy metrics (as you can just Not sure what's best here? I'm leaning towards the first option of e.g. |
Signed-off-by: Mike Eves <michael.eves@autotrader.co.uk>
Signed-off-by: Mike Eves <michael.eves@autotrader.co.uk>
Made the relevant metrics counters now and suffixed appropriately, happy to review/change if you have any differing thoughts on the above though |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates. Just a few minor changes. Otherwise, looks good!
collector/slm_test.go
Outdated
// curl -XPUT http://127.0.0.1:9200/_slm/policy/everything -H 'Content-Type: application/json' -d '{"schedule":"0 */15 * * * ?","name":"<everything-{now/d}>","repository":"my_repository","config":{"indices":".*","include_global_state":true,"ignore_unavailable":true},"retention":{"expire_after":"7d"}}' | ||
// curl http://127.0.0.1:9200/_slm/stats (Numbers manually tweaked) | ||
|
||
tcs := map[string][]string{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would be more readable if it was a map[string]testData
with a new type testData struct {}
. That would mean instead of the array being positional in the test server, the actual response could be identified by name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just made this into a string rather than an array as the tests only use a single fixture as it stands, and I can't see there needing to be additional fixtures for the same Elastic version with this current collector, however it could always be introduced in the future if needed
Does that feel OK to you?
Signed-off-by: Mike Eves <michael.eves@autotrader.co.uk>
Signed-off-by: Mike Eves <michael.eves@autotrader.co.uk>
* master: Refactor cluster info collector (prometheus-community#536) Fix linting that was missed in CI run (prometheus-community#568) Grafana dashboard: use new node exporter metric names (prometheus-community#501) publish total shards on a node (prometheus-community#535) Add additional collector for SLM stats (prometheus-community#558) Update common Prometheus files (prometheus-community#565) Update build (prometheus-community#562) Signed-off-by: Steven Cipriano <cipriano@squareup.com>
* master: Refactor cluster info collector (prometheus-community#536) Fix linting that was missed in CI run (prometheus-community#568) Grafana dashboard: use new node exporter metric names (prometheus-community#501) publish total shards on a node (prometheus-community#535) Add additional collector for SLM stats (prometheus-community#558) Update common Prometheus files (prometheus-community#565) Update build (prometheus-community#562) Signed-off-by: Steven Cipriano <cipriano@squareup.com>
* Add additional collector for SLM stats Signed-off-by: Mike Eves <michael.eves@autotrader.co.uk> * Add additional metric for SLM status (operation mode) Signed-off-by: Mike Eves <michael.eves@autotrader.co.uk> * Update README Signed-off-by: Mike Eves <michael.eves@autotrader.co.uk> * Record time metrics in seconds Signed-off-by: Mike Eves <michael.eves@autotrader.co.uk> * Update metrics to be counters where appropriate Signed-off-by: Mike Eves <michael.eves@autotrader.co.uk> * Modify tests and update label on operation_mode metric Signed-off-by: Mike Eves <michael.eves@autotrader.co.uk> * Simplify test fixture Signed-off-by: Mike Eves <michael.eves@autotrader.co.uk> Signed-off-by: iishabakaev <iishabakaev@gmail.com>
* Add additional collector for SLM stats Signed-off-by: Mike Eves <michael.eves@autotrader.co.uk> * Add additional metric for SLM status (operation mode) Signed-off-by: Mike Eves <michael.eves@autotrader.co.uk> * Update README Signed-off-by: Mike Eves <michael.eves@autotrader.co.uk> * Record time metrics in seconds Signed-off-by: Mike Eves <michael.eves@autotrader.co.uk> * Update metrics to be counters where appropriate Signed-off-by: Mike Eves <michael.eves@autotrader.co.uk> * Modify tests and update label on operation_mode metric Signed-off-by: Mike Eves <michael.eves@autotrader.co.uk> * Simplify test fixture Signed-off-by: Mike Eves <michael.eves@autotrader.co.uk>
Closes #555