/prometheus-service-discovery

A repo that contains a prometheus, grafana, consul service discovery configuration along with alertmanager

Primary LanguageShell

Service Discovery using Consul for Prometheus as Docker containers

WHY this?

I found several examples of prometheus and grafana within docker containers. However, I could not find one example where Prometheus Service Discovery via Consul worked completely within Docker containers including Alert Manager. Had to put this together to ensure it helped someone who needed it.

Description

A simple docker-compose configuration that allows the following services to run as docker containers

  • prometheus
  • grafana
  • cadvisor
  • consul
  • node-exporter
  • alert-manager sending alerts to slack

All the configuration items are there. Alert Manager rules can be extended and when new serivces are registered with Consul, Prometheus auto discovers the services.

Installation

  • Edit the file data/alertmanager.yml
  • Replace the placeholder <<API_URL>> with your Slack webhook URL
api_url: <<API_URL>> ##webhook url
  • Replace the placeholder <> with your Slack channel. Leave the # Symbol in
channel: "#<<CHANNEL>>"
  • Run the following from the root folder
docker-compose up -d

Removing the containers

  • Run the following from the root folder
docker-compose down --remove-orphans

URLs to access

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT