All Projects → infinityworks → Guide_rancher_monitoring

infinityworks / Guide_rancher_monitoring

Easy to follow guide on how to deploy and make the best use of the Rancher community catalog template for Prometheus.

Projects that are alternatives of or similar to Guide rancher monitoring

skalogs-bundle
Open Source data and event driven real time Monitoring and Analytics Platform
Stars: ✭ 16 (-86.09%)
Mutual labels:  prometheus, rancher
Client java
Prometheus instrumentation library for JVM applications
Stars: ✭ 1,644 (+1329.57%)
Mutual labels:  prometheus
Tomcat exporter
A Prometheus exporter for Apache Tomcat
Stars: ✭ 99 (-13.91%)
Mutual labels:  prometheus
Prometheus
The Prometheus monitoring system and time series database.
Stars: ✭ 40,114 (+34781.74%)
Mutual labels:  prometheus
Kitsvc
⚙ 一個基於 Golang、Consul、Prometheus、EventStore、Gin、Gorm、NSQ 的微服務起始結構。
Stars: ✭ 101 (-12.17%)
Mutual labels:  prometheus
Haproxy Configs
80+ HAProxy Configs for Hadoop, Big Data, NoSQL, Docker, Elasticsearch, SolrCloud, HBase, MySQL, PostgreSQL, Apache Drill, Hive, Presto, Impala, Hue, ZooKeeper, SSH, RabbitMQ, Redis, Riak, Cloudera, OpenTSDB, InfluxDB, Prometheus, Kibana, Graphite, Rancher etc.
Stars: ✭ 106 (-7.83%)
Mutual labels:  prometheus
Gaucho
A Python CLI tool for Rancher's API
Stars: ✭ 96 (-16.52%)
Mutual labels:  rancher
Jira Prometheus Exporter
Prometheus Exporter For JIRA
Stars: ✭ 113 (-1.74%)
Mutual labels:  prometheus
Heplify Server
HEP Capture Server
Stars: ✭ 110 (-4.35%)
Mutual labels:  prometheus
Pingprom
Prometheus uptime monitoring quickstart
Stars: ✭ 107 (-6.96%)
Mutual labels:  prometheus
Container Monitor
容器监控方案汇总
Stars: ✭ 107 (-6.96%)
Mutual labels:  prometheus
Jmeter Prometheus Plugin
A Prometheus Listener for Apache JMeter that exposes results in an http API
Stars: ✭ 101 (-12.17%)
Mutual labels:  prometheus
Openitcockpit
openITCOCKPIT is an Open Source system monitoring tool built for different monitoring engines like Nagios, Naemon and Prometheus.
Stars: ✭ 108 (-6.09%)
Mutual labels:  prometheus
Prometheus Boshrelease
Prometheus BOSH Release
Stars: ✭ 99 (-13.91%)
Mutual labels:  prometheus
Prometheus Basics
A beginner friendly introduction to prometheus 🔥
Stars: ✭ 1,533 (+1233.04%)
Mutual labels:  prometheus
Prometheus Course
Course files for Monitoring and Alerting with Prometheus
Stars: ✭ 97 (-15.65%)
Mutual labels:  prometheus
Libvirt K8s Provisioner
Automate your k8s installation
Stars: ✭ 106 (-7.83%)
Mutual labels:  rancher
Grafana
The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
Stars: ✭ 45,930 (+39839.13%)
Mutual labels:  prometheus
Microservice App
A microservices architecture app powered by golang.
Stars: ✭ 114 (-0.87%)
Mutual labels:  prometheus
Kubernetes Book
Mastering Kubernetes with Real Life Lessons from Deploying Production Systems
Stars: ✭ 113 (-1.74%)
Mutual labels:  prometheus

Monitoring Guide - Prometheus/Grafana/Rancher

An easy to follow guide on deploying and making the best use of the Rancher community catalog template for Prometheus. Updated for Rancher 1.5.5+ and catalog entry version 3.0.0

Screens

Objectives

Over the last few years, the quality of products available to monitor your systems and services has increased dramatically. The adoption of technologies such as Docker has enabled us to lower the barrier for running these cool new technologies.

With this in mind, I put together this auto-discovering monitoring platform to demonstrate what can be done, and to get people using these great products. The solution is built around monitoring a Docker environment under the control of Rancher. If your not familiar with Rancher then i'd recommend checking out their website for more information.

Rancher provides a community catalog where people can submit example technology stacks that allow people to get up and running within minutes. I've chosen to leverage this and have submitted this build as a pull-request to Rancher for incoporation into their catalog.

All that aside, it's been a cool personal project to work on, and gives me an opportunity to contribute back to the community that supports us all.

Technologies

In this catalog item, the following technologies are utilised to make this as useful as possible;

  • Prometheus - Used to scrape and store metrics from our data sources.
  • Prometheus Node Exporter - Gets host level metrics and exposes them to Prometheus.
  • cAdvisor - Deploys and Exposes the cadvsior stats used by Rancher's agent container, to Prometheus.
  • Grafana - Used to visualise the data from Prometheus and InfluxDB.
  • Prometheus Rancher Exporter - Allows Prometheus to access the Rancher API and return the status of any stack or service in the rancher environment associated with the API key used.

Deployment

Pre-Requisites

This template will work out of the box to give you host and container monitoring through numerous sources. If you also wish to monitor the Rancher server its-self, prometheus metrics need enabling for the server instance. Details on how to do this are listed below.

Deployment Steps:

  1. Select Prometheus from the community catalog.
  2. Enter the IP Address of your Rancher server (used for accessing Ranchers own metrics, optional)
  3. Click deploy.

Usage

Once deployed, all the services should be green in Rancher and your new monitoring platform should be ready to use! Depending upon your specific implementation, you may need to open up the firewall for ports 9090 for Prometheus and 3000 for Grafana.

  • Prometheus will now be available, running on port 9090. Have a play around with some of the data. For more information on Prometheus, check out their documentation.
  • Grafana will now be available, running on port 3000. I've added a number of dashboards to help get you started. Authenticate with the default admin/admin account and password

Alerting

Depending on preference, Alerting can be achieved through making use of Prometheus's alert-manager service, or through Grafana's own alerting capability. Alerts are a very bespoke output in most cases, as such i've not attempted to pre-bake anything into this guide or catalog item. The good news however is that both are good solutions and can be configured easily.

Enabling Prometheus metrics for the Rancher Server

  1. Set the environment variable CATTLE_PROMETHEUS_EXPORTER to true for the Rancher server container.
  2. Expose the metric port on the container as such -p 9108:9108 so that prometheus can scrape the container

With those commands in-mind, starting a rancher server looks something akin to this:

sudo docker run -d --restart=unless-stopped -e CATTLE_PROMETHEUS_EXPORTER=true -p 8080:8080 -p 9108:9108 rancher/server

How is it Done?

API Integration

We use API keys so that we can query Rancher over it's API for service/stack/host status's, an example of this is through the Prometheus Dashboard in Grafana. The actual process doing this is called the prometheus-rancher-exporter.

To provide access to the API, We make use of the following lables in Rancher:

      io.rancher.container.create_agent: true
      io.rancher.container.agent.role: environment

This API interaction means you can easily build service/stack status graphs for your key applications and expose them to a wider audience without needing to give them access to Rancher itsself.

Troubleshooting

Expected Data is missing?

First, load up Prometheus on port 9090 and click on the status page at the top. This should show you the scrape status of all of your end-points. If everything looks good there, have a look at grafana and perform a test of it's data sources to ensure connectivity is there.

Rancher Server Metrics aren't showing in Grafana?

Have you followed the steps listed for 'Enabling Prometheus metrics for the Rancher Server'? If so, you might want to check that your mapping through the port correctly.

Acknowledgements

  • James Barwell - For all his efforts first introducing me to Prometheus and for the original rancher-api integration.
  • Jolyon Brown - For his efforts in adding in further functionality to the API integration.
  • Rancher Labs - For providing awesome support and details on how to effectivley montior Rancher server.

And of course, all the guys behind Prometheus/Grafana for making such great tools.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].