Saltar al contenido

Grafana Alerting vs AlertManager: Una Comparación de Dos Herramientas de Monitoreo Líderes

Introducción

Las capacidades de Grafana Alerting continúan mejorando en cada nueva versión que el equipo de GrafanaLabs realiza. Especialmente con los cambios realizados en Grafana 8 y Grafana 9, se han planteado muchas preguntas sobre su uso, las capacidades soportadas y la comparación con otras alternativas.

Queremos comenzar estableciendo el contexto sobre Grafana Alerting basado en el stack habitual que desplegamos para mejorar la observabilidad de nuestras cargas de trabajo. Grafana se puede usar para cualquier carga de trabajo; hay una preferencia por algunas específicas siendo la solución más utilizada cuando hablamos de cargas de trabajo en Kubernetes.

En este tipo de despliegue, el stack que usualmente desplegamos es Grafana como la herramienta de visualización y Prometheus como el núcleo para recopilar todas las métricas, de modo que todas las responsabilidades están diferenciadas. Grafana dibuja toda la información utilizando sus excelentes capacidades de paneles, recopilando la información de Prometheus.

Grafana Alerting vs AlertManager: Una Comparación de Dos Herramientas de Monitoreo Líderes

Cuando planeamos comenzar a incluir alertas, ya que no podemos aceptar que necesitamos tener un equipo específico solo observando paneles para detectar dónde algo está fallando, necesitamos implementar una forma de enviar alertas.

Las capacidades de alerta en Grafana han estado presentes desde el principio, pero sus capacidades en las primeras etapas se han limitado a generar alertas gráficas centradas en los paneles. En lugar de eso, Prometheus actuando como el cerebro, incluye un componente llamado AlertManager que puede manejar la creación y notificación de cualquier alerta generada a partir de toda la información almacenada en Prometheus.

Las principales capacidades que Alert Manager proporciona son la definición de las alertas, agrupación de las alertas, reglas de desestimación para silenciar algunas notificaciones, y finalmente, la forma de enviar esa alerta a cualquier sistema basado en un sistema de plugins y un webhook para poder extenderlo a cualquier componente disponible.

Grafana Alerting vs AlertManager: Una Comparación de Dos Herramientas de Monitoreo Líderes

Entonces, esta es la etapa inicial, pero esto ha cambiado con las últimas versiones de Grafana en los últimos meses, como se comentó, y ahora la barrera entre ambos componentes es mucho más difusa, como vamos a ver.

¿Cuáles son las principales capacidades que Grafana Alerting ofrece hoy en día?

Grafana Alerting te permite definir reglas de alerta definiendo los criterios bajo los cuales esta alerta debería activarse. Puede tener diferentes consultas, condiciones, frecuencia de evaluación y la duración durante la cual se cumple la condición.

Esta alerta puede generarse desde cualquiera de las fuentes soportadas en Grafana, y ese es un tema muy relevante ya que no se limita a los datos de Prometheus. Con la eclosión del stack de GrafanaLabs con muchos nuevos productos como Grafana Loki y Grafana Mimir, entre otros, esto es especialmente relevante.

Una vez que cada una de las alertas se activa, puedes definir una política de notificación para decidir dónde, cuándo y cómo se enruta cada una de estas alertas. Una política de notificación también tiene un punto de contacto asociado con uno o más notificadores.

Además, puedes silenciar alertas para dejar de recibir notificaciones de una instancia de alerta específica y silenciar alertas cuando puedes definir un período en el que no se generarán o notificarán nuevas alertas.

Todo eso con poderosas capacidades de paneles utilizando todo el poder de las características de paneles de Grafana.

Grafana Alerting vs AlertManager: Una Comparación de Dos Herramientas de Monitoreo Líderes

Grafana Alerting vs Prometheus Alert Manager

Después de leer la sección anterior probablemente estés confundido porque la mayoría de las nuevas características añadidas son muy similares a las que tenemos disponibles en Prometheus AlertManager.

Entonces, en ese caso, ¿qué herramienta deberíamos usar? ¿Deberíamos reemplazar Prometheus AlertManager y comenzar a usar Grafana Alerting? ¿Deberíamos usar ambos? Como puedes imaginar, esta es una de esas preguntas que no tiene respuestas claras ya que dependerá mucho del contexto y tu escenario específico, pero permíteme darte algunas indicaciones al respecto.

  • Grafana Alerting puede ser muy poderoso si ya estás dentro del stack de Grafana. Si ya estás usando Grafana Loki (y necesitas generar alertas desde él), Grafana Mimir, o directamente Grafana cloud, probablemente Grafana Alert proporcionará un mejor ajuste para tu ecosistema.
  • Si necesitas alertas complejas definidas con consultas y cálculos complejos, Prometheus AlertManager proporcionará un ecosistema mucho más complejo y rico para generar tus alertas.
  • Si estás buscando un enfoque SaaS, Grafana Alerting también se proporciona como parte de Grafana Cloud, por lo que se puede usar sin la necesidad de ser instalado en tu ecosistema.
  • Si estás usando Grafana Alerting, necesitas considerar que el mismo componente que sirve los paneles está computando y generando las alertas, lo que requeriría capacidades adicionales de HA. Habrá una relación inevitable entre ambas características (paneles y alertas). Supongamos que eso no resuena bien contigo porque la criticidad de tu panel no es la misma que la de las alertas, o piensas que el uso de tu panel puede afectar el rendimiento de las alertas. En ese caso, Prometheus Alert Manager proporcionará un mejor enfoque ya que se ejecuta en un pod específico en aislamiento.
  • En este momento, Grafana Alerting utiliza una base de datos SQL para gestionar la duplicación entre otras características, por lo que dependiendo del número de alertas con las que necesites trabajar, podría no ser suficiente en términos de rendimiento, y el uso de la base de datos de series temporales de Prometheus puede ser una mejor opción.

Resumen

Grafana Alerting es un progreso increíble en el camino del equipo de Grafana Labs para proporcionar un stack de observabilidad de extremo a extremo con un gran ajuste en el resto del ecosistema con la opción de ejecutarlo en modo SaaS y centrarse en la facilidad de uso. Pero hay mejores opciones dependiendo de tus necesidades.

Grafana Alerting vs AlertManager: A Comparison of Two Leading Monitoring Tools

Introduction

Grafana Alerting capabilities continue to improve in each new release the GrafanaLabs team does. Especially with the changes done in Grafana 8 and Grafana 9, many questions have been raised regarding its usage, the capabilities supported, and the comparison with other alternatives.

We want to start setting the context about Grafana Alerting based on the usual stack we deployed to improve the observability of our workloads. Grafana can be used for any workload; there is a preference for some specific ones being the most used solution when we talk about Kubernetes workloads.

In this kind of deployment, the stack we usually deploy is Grafana as the visualization tool and Prometheus as the core to gather all metrics, so all responsibilities are differentiated. Grafana draws all the information using its excellent dashboarding capabilities, gathering the information from Prometheus.

Grafana Alerting vs AlertManager: A Comparison of Two Leading Monitoring Tools

When we plan to start including alerts, as we cannot accept that we need to have a specific team just watching dashboards to detect where something is going wrong, we need to implement a way to push alerts.

Alerting capabilities in Grafana have been present since the beginning, but its capabilities in the early stages have been limited to generating graphical alerts focused on the dashboards. Instead of that, Prometheus acting as the brain, includes a side-card component called AlertManager that can handle the creation and notification of any alerts generated from all the information stored in Prometheus.

As main capabilities that Alert Manager provides are the definition of the alerts, a grouping of the alerts, dismiss rules to mute some notifications, and finally, the way to send that alert to any system based on a plugin system and a webhook to be able to extend it to any component available.

Grafana Alerting vs AlertManager: A Comparison of Two Leading Monitoring Tools

So, this is the initial stage, but this has been changed with the latest releases of Grafana in the last months, as commented, and now the barrier between both components is much fuzzier, as we’re going to see.

What are the main capabilities Grafana Alerting provides today?

Grafana Alerting allows you to define Alert rules defining the criteria under which this alert should fire. It can have different queries, conditions, evaluation frequency, and the duration over which the condition is met.

This alert can be generated from any of the sources supported in Grafana, and that’s a very relevant topic as this is not limited to the Prometheus data. With the eclosion of the GrafanaLabs stack with many new products such as Grafana Loki and Grafana Mimir, among others, this is especially relevant.

Once each of the alerts once it fires, you can define a Notification policy to decide where, when, and how each of these alerts is routed to. A notification policy also has a contact point associated with one or more notifiers.

Additionally, you can silence alerts to stop receiving notifications of a specific alert instance and mute alerts when you can define some period where new alerts will not be generated or notified.

All of that with powerful dashboarding capabilities using all the power of the Grafana dashboard features.

Grafana Alerting vs AlertManager: A Comparison of Two Leading Monitoring Tools

 Grafana Alerting vs Prometheus Alert Manager

After reading the previous section probably, you are confused because most of the new features added are very similar to the ones we have available on Prometheus AlertManager.

So, in that case, what tool should we use? Should we replace Prometheus AlertManager and start using Grafana Alerting? Should we use both? As you can imagine, this is one of these questions that doesn’t have clear answers as it will depend a lot on the context and your specific scenario, but let me give you some pointers around it.

  • Grafana Alerting can be very powerful if you are already inside the Grafana stack. If you are already using Grafana Loki (and require to generate alerts from it), Grafana Mimir, or directly Grafana cloud, probably Grafana Alert would provide a better fit for your ecosystem.
  • If you require complex alerts defined with complex queries and calculations, Prometheus AlertManager will provide a much more complex and rich ecosystem to generate your alerts.
  • If you are looking for a SaaS approach, Grafana Alerting is also provided as part of Grafana Cloud, so it can be used without the requirement to be installed in your ecosystem.
  • If you are using Grafana Alerting, you need to consider that the same component serving the dashboards is computing and generating the alerts, which would require additional HA capabilities. It will be a non-evitable relationship between both features (dashboards and alerts). Suppose that doesn’t resonate well with you because the criticality of your dashboard is not the same as the alerts, or you think your dashboard’s usage can affect the alerts’ performance. In that case, Prometheus Alert Manager will provide a better approach as it runs in a specific pod in isolation.
  • At this moment, Grafana Alerting uses a SQL Database to manage duplication among other features, so depending on the number of alerts you need to work on could not be enough in terms of performance, and the usage of the time series database from Prometheus can be a better fit.

Summary

Grafana Alerting is incredible progress on the journey of the Grafana Labs team to provide an end-to-end observability stack with a great fit on the rest of the ecosystem with the option to run it in SaaS mode and focus on ease of use. But there are better options than depending on your needs.

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *