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

promtool check metrics issues #204

Closed
mjtrangoni opened this issue Dec 5, 2018 · 5 comments · Fixed by #256
Closed

promtool check metrics issues #204

mjtrangoni opened this issue Dec 5, 2018 · 5 comments · Fixed by #256
Labels

Comments

@mjtrangoni
Copy link
Contributor

Hi @oliver006 ,

Checking the redis_exporter `v0.23.0 output with promtool, I have the following result,

# curl -s http://fqdn:9121/metrics | promtool check metrics
redis_commands_duration_seconds_total non-counter metrics should not have "_total" suffix
redis_commands_processed_total non-counter metrics should not have "_total" suffix
redis_commands_total non-counter metrics should not have "_total" suffix
redis_connections_received_total non-counter metrics should not have "_total" suffix
redis_evicted_keys_total non-counter metrics should not have "_total" suffix
redis_expired_keys_total non-counter metrics should not have "_total" suffix
redis_keyspace_hits_total non-counter metrics should not have "_total" suffix
redis_keyspace_misses_total non-counter metrics should not have "_total" suffix
redis_net_input_bytes_total non-counter metrics should not have "_total" suffix
redis_net_output_bytes_total non-counter metrics should not have "_total" suffix
redis_rejected_connections_total non-counter metrics should not have "_total" suffix

If you agree, I could send a PR for fixing this, and also adding this check to CircleCI.

@oliver006
Copy link
Owner

@mjtrangoni - thanks for raising the issue, I think that's related to #178 - a lot or the _total metrics are gauges and just pass through counter data from redis so they really could/should be counters in prometheus.

Go ahead and open a PR if you want to fix the issue, that'd be great!

@mjtrangoni
Copy link
Contributor Author

@oliver006 ok, perfect. I will be sending a PR creating Counters instead of Gauges at weekend. Thanks!

@oliver006
Copy link
Owner

Thanks @mjtrangoni
fyi, it might not be as easy as creating Counters instead of Gauges (see #178 for a bit of background) but I'm looking forward to seeing what you come up with.

@mjtrangoni
Copy link
Contributor Author

@oliver006 I took a look today, and saw that I can create from Exporter struct element metrics, two variables, one metricsGauge, and the other metricsCounter.

Do you agree doing that? This will be fixing only the following two metrics,

redis_commands_duration_seconds_total non-counter metrics should not have "_total" suffix
redis_commands_total non-counter metrics should not have "_total" suffix

After fixing them, I would be adding, like it is said in #178, a metric type field to the metricMap. Do you agree doing that too? This would be a separated PR.

@oliver006
Copy link
Owner

I think what you suggest makes sense. You'll probably need separate map for Counters and Gauges unless there's a common interface you can use instead (maybe prometheus.Metric?)

And then follow the path laid out in #178 - you should be good to go!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants