Project that seeks to provide a guide for the necessary configurations and base files that integrate the tools:
Read this in other languages: English, Spanish.
For the project to work you need:
- Docker Engine
- Docker Compose (Comes by default in the latest versions)
There are two use cases:
- Test: Give an example with basic configurations
- Production: Requires advanced settings
The test case is used to see a simple example with everything preconfigured, it works by default with the docker-compose.yml file.
Enter the TESTS folder.
Execute
docker-compose up -d
The production case is used to create an almost production-ready environment, it works by default with the docker-compose.yml file.
Two files must be configured:
- .env: Environment variables, ports (Example in PRODUCCION > .env.example)
- .grafana-env: Grafana server variables (Example in PRODUCCION > .grafana-env.example)
.env
- PROM_HOST_PORT: Host port for prometheus (Our team)
- PROM_CONTAINER_PORT: Container port for prometheus
- GF_HOST_PORT: Host port for grafana (Our team)
- GF_CONTAINER_PORT: Container port for grafana
.grafana-env
- GF_SECURITY_ADMIN_USER: Grafana admin user
- GF_SECURITY_ADMIN_PASSWORD: Admin password
Enter the folder PRODUCCION
Execute
docker-compose up -d
Structure of files:
- TEST (Example environment - Pre-configurations made)
- Grafana: Directory containing Grafana configurations
- Prometheus: Directory containing Prometheus configurations
- docker-compose.yml (Basic): File containing the docker images used for the example case
- PRODUCTION
- Grafana: Directory containing Grafana configurations
- Prometheus: Directory containing Prometheus configurations
- docker-compose-prod.yml (Advanced): File that contains the docker images, as it is intended for production, it will request more data and will assemble separate volumes
Contains basic configurations of grafana server
- datasource.yml:
- grafana.ini: Configuration obtained fromhere
Setting
- prometheus.yml: Basic configuration of prometheus (The targets to monitor are found)
I attach some guides that helped me to enrich, understand and assemble the examples:
- How To Run Prometheus and Grafana using Docker Compose (v3.7 Docker Compose):
- Monitoring a Linux host with Prometheus, Node Exporter, and Docker Compose (v3.8 Docker Compose)
- Server Monitoring // Prometheus and Grafana Tutorial (YouTube)
- Guia avanzada de Docker Compose (Esta guia me ayudo para el uso de multiples docker-compose.yml)
- Guia para uso de variables de entorno
- Guia Video - Monitoreo con Docker (Grafana, Prometheus, Node-Exporter, cAdvisor)
- Guia Video - WMI Exporter para Windows
Official links of Docker images used in the project:
- Grafana: https://hub.docker.com/r/grafana/grafana-enterprise
- Prometheus: https://hub.docker.com/r/prom/prometheus
- Node Exporter : https://hub.docker.com/r/prom/node-exporter