This application was created as a practice project to learn the process of building custom Prometheus metrics with PromEx. It was primarily based on the following articles:
- Building Your Own Prometheus Metrics with PromEx
- How to Monitor PostgreSQL with Prometheus and Grafana (Docker)
This application demonstrates how to use PromEx to create custom Prometheus metrics. It also includes a Docker Compose setup for running the application along with Grafana and PostgreSQL, and for monitoring PostgreSQL with Prometheus and Grafana.
To get started with this application, you'll need to have Docker and Docker Compose installed on your machine.
- Clone the repository:
git clone https://github.com/gabrielpedepera/prometheus_metrics_with_promex.git
- Navigate to the project directory:
cd prometheus_metrics_with_promex
- Create a
.env
file in the root directory of the project and add your environment variables:
SECRET_KEY_BASE=your_secret_key_base
DATABASE_URL=ecto://postgres:postgres@postgres:5432/prometheus_metrics_with_promex
GRAFANA_URL=http://grafana:3000
The SECRET_KEY_BASE
can be generated through the command mix phx.gen.secret
.
- Build and start the Docker containers:
docker-compose up --build
The application will be available at http://localhost:4000
, Grafana at http://localhost:3000
, and Prometheus at http://localhost:9090
.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.