From 7b0396d83bc16e2000d3480ca23df4c36468bb42 Mon Sep 17 00:00:00 2001 From: Matias Pi Date: Sat, 6 Jul 2024 19:10:18 -0300 Subject: [PATCH] Updated README.md --- README.md | 70 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 61 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 7d9d485..ce07b0d 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,71 @@ # Basic Monitoring System with Grafana and Prometheus -This project sets up a basic monitoring system using Grafana and Prometheus with Docker. +This project sets up a monitoring system using Grafana and Prometheus with Docker. It includes CI/CD configuration with GitHub Actions to ensure the services are always up-to-date and functioning correctly. + +## Features + +- **Prometheus**: Collects and stores metrics. +- **Grafana**: Visualizes the metrics collected by Prometheus. +- **Node Exporter**: Provides OS metrics for Prometheus. +- **Alertmanager**: Manages alerts sent by Prometheus. +- **CI/CD with GitHub Actions**: Automates the deployment and testing of the system. + +## Prerequisites + +- Docker and Docker Compose installed on the system. +- A Docker Hub account. +- Environment variables configured for Docker Hub and Grafana authentication. + +## Configuration + +### Environment Variables + +Create a `.env` file in the root of the project with the following variables: +GF_SECURITY_ADMIN_USER=admin +GF_SECURITY_ADMIN_PASSWORD=admin ## Instructions 1. Clone the repository. 2. Navigate to the project folder. -3. Run `docker-compose up`. -4. Access Grafana at `http://localhost:3000` +3. Create a .env file in the root directory with the necessary environment variables. +4. Run docker-compose up -d to start the services. +5. Access Prometheus at http://localhost:9090. +6. Access Grafana at http://localhost:3000 and use the credentials defined in the .env file. + +## CI/CD + +The CI/CD pipeline is defined in .github/workflows/ci-cd.yml and performs the following actions: + +- Builds and pushes Docker images. +- Deploys the system using Docker Compose. +- Checks that the services are running correctly. +- Checks that the out of the box dashboards are working with data from the datasource(prometheus). + + +### Setting Up GitHub Secrets + +To set up GitHub secrets for the CI/CD pipeline, follow these steps: + +1. Navigate to your forked repository on GitHub. +2. Go to **Settings** > **Secrets and variables** > **Actions**. +3. Add the following secrets: + - `DOCKER_USERNAME`: Your Docker Hub username. + - `DOCKER_PASSWORD`: Your Docker Hub password. + - `GF_SECURITY_ADMIN_USER`: Your Grafana admin username. + - `GF_SECURITY_ADMIN_PASSWORD`: Your Grafana admin password. + + +## Monitoring + +- Prometheus: Access Prometheus at http://localhost:9090. +- Grafana: Access Grafana at http://localhost:3000 and use the credentials defined in the .env file. + +## Contributions + +Contributions are welcome. Please open an issue or submit a pull request. -## Files +## License -- `docker-compose.yml`: Docker Compose configuration. -- `prometheus/prometheus.yml`: Prometheus configuration. -- `grafana/provisioning/datasources/datasource.yaml`: Grafana datasource for Prometheus. -- `grafana/provisioning/dashboards/dashboard.yaml`: Grafana dashboard configuration. -- `grafana/dashboards/dashboard.yml`: Out of the box dashboard to check if Prometheus is up. +This project is licensed under the MIT License.