Prometheus-Grafana Vs Zabbix

To monitor the modern cloud infrastructure SRE(Software reliability Engineer), DevOps personnel has to rely on modern automated monitoring tools such Prometheus, Grafana or Zabbix. These tools can help SREs and DevOps practitioners to analyze the production health of the production environment in the form of graphs on a real-time basis. The tools (Prometheus, Zabbix) collects the data from various resources (virtual machine, Network Storage, Routers..) and stores it locally which can be used later for visualization and analysis.

Both the tools Prometheus and Zabbix are very mature tools but keeping the Prometheus alone against the Zabbix would not be a fair comparison. To compare with Zabbix we should be put Prometheus and Grafana together because the Prometheus server is a data collector which heavily relies on Node Exporter and on the other hand Grafana is used to create the visualization dashboard using the data collected by the Prometheus.

Prometheus Grafan vs Zabbix

On the other hand, Zabbix is a complete package that stores performance metrics data into the local MySQL database and also provides the visualization dashboard. So instead of using two tools(Prometheus, Grafana), Zabbix is a complete package.

In this article we will go through key features of Prometheus, Grafana and Zabbix also we are going to see what are the differences which make them more powerful and popular among the DevOps community

Table Of Content

  1. Prometheus and Grafana Overview
  2. Zabbix Overview
  3. Prometheus, Grafana Vs Zabbix
  4. How to choose between Prometheus, Grafana vs Zabbix
  5. Infrastructure cost for running Prometheus, Grafana and Zabbix
  6. Conclusion


1. Prometheus and Grafana Overview

Prometheus

Prometheus is an open-source tool used by DevOps practitioners for monitoring and alerting. The primary responsibility of the Prometheus is to collect and store the performance metrics from various hardware and virtual resource. All the performance data is being collected in a time series. Apart from collecting and storing the data a user can label the data model using key-value pairs.

The key benefits of using Prometheus -

  1. It can scrape the data using the various Node Exporter and store it according to the timeline.
  2. Prometheus has superb support from 3rd party Node Exporter which can help Prometheus to extract a variety of hardware and kernel-related metrics.
  3. From the Developer perspective Prometheus also has excellent support for query language known as PromQL and with the help of PromQL, you can really drill down on the statistics collected by the Prometheus
  4. HTTP API support for Prometheus - This is one of the out-of-the-box features with which a developer can fetch the data from the Prometheus server by making HTTP calls.
  5. Prometheus server has standalone architecture, so you do not have to worry about distributed storage and network latency
  6. With the help of scrap config yaml you can set up multiple target nodes for collecting the performance metrics

Grafana

On the other hand, Grafana is also an open-source tool for visualization and analysis. If we look at the broader the spectrum of Prometheus and Grafana then Prometheus is going to be the core layer for scrapping and storing the data whereas Grafana is responsible for fetching the data from the Prometheus server with the help of datasource.

Prometheus and grafana integration



The Key benefits of using Grafana -

  1. Feature enrich dashboard - One of the cool features of the Grafana is it's a feature reach tool where you have multiple options to customize the dashboard according to your preference.

  2. Drag, Drop and support for scripting - Either you can use the drag and drop feature of grafana or you can write down the script for setting up the dashboard.

  3. Annotation - As with the time you will have a multitude of data sitting in the Prometheus server so to simplify that problem Grafana has really good support of Annotation so that you can correlate the data

  4. Plugins - With the help of Grafana you can visualize anything provided you have data in the form of time series. You can write the plugin and provide the data stream to grafana.

  5. Alerts - As a monitoring tool so we should expect some kind of automated alerting from grafana and it does support alerting. If you have Slack or Teams then grafana can send customized alerts to those channels

  6. Datasource - Grafana does not store any kind of data, so we must provide a Datasource to grafana so that graphs can be rendered. Onto the grafana dashboard, you will find a number of data sources that you can configure based on your need.

    Prometheus as preferred data source

  7. Native support for Database - There is native support for various databases such Oracle, Mysql, Postgress, etc..

  8. All in all Grafana is can support your on-premise as well as cloud infra for visualization and analysis



2. Zabbix Overview

Zabbix is also one of the open-source enterprise applications developed under GPL(General Public License). Just like Prometheus-Grafana, Zabbix has also very good support for monitoring on-premise as well as cloud infrastructure which includes - servers, virtual machines, applications, databases.

Unlike Prometheus-Grafana where Prometheus's primary responsibility is to collect and store the metrics and Grafana to visualize the data. But if you are using Zabbix then you can achieve data collection as well as visualization using the Zabbix. Zabbix supports both polling and trapping alongside the Web UI for visualization.

Zabbix is built on C language to reduce the memory footprint and it uses support MySQL, Postgress for storing the data.

The key benefits of using Zabbix -

  1. Auto-discovery allows Zabbix to find any new devices which are available in the network for monitoring.
  2. Zabbix has distributed architecture so instead of Zabbix centralized server there Zabbix Proxies which is responsible for collecting the data and sending it back to the Zabbix server.
  3. Zabbix also provides proactive and passive monitoring support.
  4. Zabbix can be installed on various operating systems such as - Linux/CentOS, Debian/Ubuntu/Rasbian, Suse Linux server, Windows, MacOS
  5. Zabbix has Server and Client architecture, so you have to install Zabbix agent on each client-side for gathering and sending the data to the Zabbix server.
  6. Just like Prometheus and Grafana you can create a custom dashboard and run real-time analysis.


3. Prometheus, Grafana Vs Zabbix

Let's talk about what are the key differences between Prometheus-Grafana and Zabbix, also what is unique feature which makes them more suitable for your use -

Prometheus-Grafana Zabbix
Technology implementation Go C (Implemented in C for better lower memory footprint)
Performance, monitoring data collection and storage It stored the data locally The default MySQL Database is used for storage, it also supports Postgress
Support for Docker and Kubernetes No in build support for Docker and Kubernetes
Plugins and Integration Prometheus and Grafana have a variety of opensource plugins to support various infrastructure monitoring Zabbix has very limited support for 3rd party integration
Querying the data for analysis Prometheus has PromQL for querying the metrics For Zabbix, you have to use SQL(Structured Query Language) to fetch the metrics from either Mysql or Postgress
Dashboard and Visualization Grafana has really good support for custom dashboard also there are various opensource ready use dashboard which can be imported Zabbix also has a really good Dashboard but does not support importing dashboard from other developers
Alerting Prometheus and Grafana has really good support for alerting SMS, Microsoft Teams, Slack, Email Zabbix also has a very good support for alerting on SMS, Microsoft Teams, Slack, Email


4. How to choose between Prometheus, Grafana vs Zabbix

If you look from the end results which is produced by Prometheus+Grafana and Zabbix then you will not find much of difference because both are doing Monitoring, Alerting, and Dashboard visualization.

But once you start digging more into how you can integrate your infra with wither Prometheus+Grafana or Zabbix then the answer will shift towards Prometheus+Grafana rather than Zabbix -

Here are some key properties which differentiate Prometheus+Grafana from Zabbix -

  1. Prometheus use Node exporter to expose its metrics over HTTP but the best thing about node exporter is you can build your own but similar functionality is not available in Zabbix.
  2. Prometheus and Grafana are very container agnostic and have native support for Kubernetes and Docker. Zabbix does not have native support for Kubernetes and Docker.
  3. Prometheus has a Service Discovery approach where each new resource is treated as a service for collecting the metrics whereas Zabbix uses the machine-based resource approach.
  4. For Zabbix we need to install agent on the individual server on the other hand Prometheus also require you to install node exporter on individual resource, but you can configure, enable and disable this node exporter with the the help of `node exporter config YAML such flexibility is missing in the Zabbix.
  5. Prometheus uses HTTP based communication which makes integration with other tools much easier while Zabbix use TCP based communication is also quite okay but HTTP based integration is most preferred.

5. Infrastructure cost for running Prometheus, Grafana, and Zabbix

To measure the cost of any framework running in the cloud environment, you have to rely on the following parameters -

  1. CPU
  2. RAM
  3. Storage

Once you know the above parameters then it does not measure which cloud platform(AWS, Google Cloud) you are using, you simply have to multiply the hourly rates with the above-mentioned resources

5.1 Measuring operational cost of Prometheus and Grafana

To measure specifically the cost of Prometheus and Grafana, you can simply use the PromQL to fetch the cpu usage by putting the container_cpu_usage_seconds_total parameter in the PromQL. You can also create a New Dashboard where you can measure the CPU usage in an hourly manner

1(sum(container_cpu_usage_seconds_total) / 60 / 60 ) * 0.0445 

Whatever value is return from the above expression can be multiplied by the hourly price of the cloud environment which will give you a rough estimate of the cost involved in running Prometheus and grafana.

Kubernetes - If you are using Kubernetes and you want to measure the operational cost then there is a better alternative for it. You can use Kubecost for measuring and monitoring management.

To reduce the cost of your Kubernetes infrastructure you can use loft.sh which can help you reduce the cost of your Kubernetes infrastructure by using Sleep Node to put namespace into the sleep when no one is using it. Also periodically purging the PODs when not in use. It also has Auto Delete which deletes the namespace that idle for a long time.

5.2 Operational cost Zabbix

Zabbix is an open-source tool but if you are looking for enterprise-level support then they have different tiered based pricing model which starts from Upgrade Light($1500) to Custom Package.

If you are looking for enterprise-level support then Custom package should be the right choice for you because you can get include lots of customization based on your environment setup.

Final words on costing - Although Prometheus and Grafana are opensource if it is not set up properly then running them both in the cloud environment can really shoot up your bills but on the other hand, Zabbix support package can help you to assist in reducing the price of Zabbix in a production environment.


6. Conclusion

Although both tools(Prometheus+Grafana, Zabbix) support enterprise-level applications considering the cloud-agnostic development Prometheus+Grafana seems to be better suited for monitoring and alerting.
Prometheus+Grafana does not restrict you from integration with other tools as well as allows you to develop your own customization on top of their existing solution which is a far better adaptable approach nowadays.

Zabbix is very limited in terms of integration, and it is always hard to leave the Zabbix ecosystem once you are into it. If the Zabbix fits your need then they have perfect support for you but if you want to have an option of integration and power of 3rd party plugin then go for Prometheus and Grafana.


Learn more On Prometheus and Grafana -

  1. How to setup Prometheus, Node Exporter and Grafana
  2. How to setup Prometheus, Grafana dashboard for Kubernetes monitoring on AWS
  3. Prometheus-Grafana Vs Zabbix