logstash_exporter icon indicating copy to clipboard operation
logstash_exporter copied to clipboard

Add 'up' metric

Open matejzero opened this issue 8 years ago • 4 comments

Hello,

I'm testing your exporter with our logstash instances and I'm missing an 'up' metrics which would tell me if logstash is running or not, so I can alert if it crashes.

Alxrem is exposing this metric in his exporter. Would you be willing to add it as well? It seems to me like a useful metric to have.

Thanks

matejzero avatar Jan 04 '18 11:01 matejzero

I looked at the exposed metrics and could solve this problem with logstash_exporter_scrape_duration_seconds_count metric:

rate(logstash_exporter_scrape_duration_seconds_count{result="error"}[1m]) == 1

This works for me and is better then up since it's more descriptive of what it does.

matejzero avatar Jan 04 '18 12:01 matejzero

After some use, I still think up metric would be useful, something like logstash_exporter_up or logstash_node_up. Values would be 1, if last scrape was successful and 0 if not.

This is also recommended by prometheus.

matejzero avatar Jan 16 '18 11:01 matejzero

Metric added on https://github.com/sequra/logstash_exporter/pull/5

mpucholblasco avatar Jan 29 '19 13:01 mpucholblasco

This is nice to hear!

I also see you merged some extra PRs to your repo. When I get back to work I'll pull your code and test it. I saw some new metrics regarding queue which should help me with a problem I'm having.

matejzero avatar Jan 30 '19 14:01 matejzero