Skip to content

Commit

Permalink
Updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
maty314 committed Jul 6, 2024
1 parent 7b11b81 commit 7b0396d
Showing 1 changed file with 61 additions and 9 deletions.
70 changes: 61 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 7b0396d

Please sign in to comment.