I want to setup monitoring on our environment. I am wondering on what are the advantages of using something like Prometheus for making metrics vs. just using something like the ELK stack for creating similar metrics using logs?
2 Answers
Efficiency
If you don't need the file it saves space and trouble to leave it out. Logs require rotation and retention policies which are nice to skip.
Reliability
Skipping the file avoids issues with the file that could caused lost metrics like a full disk.
Latency
Skipping the file means that you remove latency from disk I/O. For most metrics you don't care if they show up a few seconds late, but if you're trying to build things to respond to some metric quickly. You might want to put it on Kafka also.
-
1Add to that some metrics can't be made from logs, for exemple IO operations if logged per operation would just create an infinite loop, as each log of one IO would create a new IO logged in turn.– TensibaiJul 15, 2019 at 13:33
The basic difference between prometheus metrics And logs is that prometheus is a timeseries db while logs - in General sense - are event driven.
Thus using prometheus is suitable for monitoring the whole lifecycle of your endpoints, making aggregations on results And generally evaluating the behaviour of your target before something occurs.
Logs are more suitable if you want reportin when something particular happens, in an order of events And generally tracking down incidents after they've already happened.
-
ELK can work with metrics too. See elastic.co/products/beats/metricbeat– MessaJun 25, 2019 at 18:31
-
It can work with metrics of course. It is different working with metrics and beeing a time series db. Check this out en.wikipedia.org/wiki/Time_series_database Jun 26, 2019 at 7:14