Rancher - Monitoring
Rancher cuenta con una configuración para agregar Monitoring junto con Graphana, Prometheus y Alert Manager. A continuación te diremos cómo agregarlo.
Agregar monitoring
Para agregar monitoring a nuestro Cluster, debemos dar clic en el botón Explore.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Al dar clic en Explore, Rancher te llevará al Rancher Explorer, dónde deberemos ubicar el menú superior izquierdo.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Daremos clic sobre el menú superior izquierdo y seleccionaremos la opción Apps & Marketplace.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Al dar clic en Apps & Marketplace, Rancher nos mostrará una lista de Aplicaciones que podemos agregar a nuestro Cluster, en nuestro caso para agregar Monitoreo, deberemos seleccionar Monitoring.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Rancher nos mostrará las opciones para configurar Monitoring. Para agregar Monitoring da clic sobre el botón Install.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Una vez que des clic en el botón Install, Rancher comenzará a instalar Monitoring, al instalarse se abrirá una subventana que estará mostrando los comandos para instalar Monitoring. Al final podrás visualizar un resultado como este:
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Igualmente, al terminar la instalación, en el menú superior izquierdo podrás visualizar la opción Monitoring, deberás seleccionar esta opción.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Al dar clic en la opción Monitoring, Rancher te llevará a la configuración de la aplicación, del lado izquierdo podrás acceder a Graphana, Alertmanager o Prometheus.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Agregar canal de Slack a Alertmanager
Mediante Monitoring es posible recibir alertas en un canal de Slack por medio de Alertmanager. Para ello, debemos ingresar a la aplicación Monitoring que instalamos previamente y seleccionar la opción Receivers en el menú lateral izquierdo y dar clic en Create.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Posteriormente, seleccionaremos Slack entre las diferentes opciones.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Adicionalmente, daremos clic en el botón Add Slack.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Después, deberás agregar el Webhook URL y un nombre. Al introducir la información, da clic en Create.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Obtener Webhook URL
A continuación te mostraremos como obtener el Webhook URL.
Primero, deberás dar clic en el enlace que esta debajo de Webhook URL.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Ese enlace abrirá una ventana de Slack, en ella da clic en el botón Añadir a Slack. En caso de que en la ventana no aparezca la opción Añadir a Slack, es porque tienes que ingresar con tu cuenta de Slack previamente.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Posteriormente, deberás elegir el canal donde te llegarán las notificaciones.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Una vez que hayas elegido el Canal, da clic en el botón Añadir integración con WebHooks entrantes.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Finalmente, Slack te mostrará la información de tu WebHook en especifico la URL. Una vez que tengas la URL, cópiala y pégala en la configuración de Slack de Rancher.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Agregar canal de Slack a Alertmanager (Cont)
Una vez que hayas agregado la configuración de Slack en los Receivers. Deberás agregar el canal de Slack a la ruta principal. Para ello, selecciona Routers en el menú lateral izquierdo. Posteriormente, ubica la fila con el nombre root y da clic en el botón con los 3 puntos y selecciona Edit Config.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Por último, selecciona la configuración de Slack que acabas de crear en el select de Receiver, una vez que lo selecciones da clic en el botón Save.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Añade reglas a Prometheus
Con la configuración anterior de Alertmanager podrás recibir alertas configuradas por defecto, pero en caso de que quieras agregar alertas más específicas, deberás añadir algunas reglas.
Para ello, selecciona Prometheus rules en el menú lateral izquierdo y posteriormente da clic en Create.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
En la vista de Create, selecciona el Namespace en el que quieras aplicar la nueva regla, asignale un nombre, un nombre grupal y da clic en el botón Add Alert.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Posteriormente, deberás ingresar la información de la alerta, al concluir, da clic en el botón Create.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Example
Primero, selecciona el namespace de la alerta, coloca un nombre y un nombre de grupo.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Después, define el nombre de la alerta, el tiempo de espera y selecciona el nivel de importancia de la alerta.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Finalmente, agrega las anotaciones, que será la información que se despliegue en la alerta.