Log and Monitoring

Promgen – Prometheus config generator

0

Promgen is a configuration file generator for Prometheus. Promgen is a web application written with Django and can help you do the following jobs.

  • Create and manage Prometheus configuration files
  • Configure alert rules and notification options

See the Promgen introduction slides for more details.

Contributing

Below are the steps to get started with Promgen.

Please see CONTRIBUTING.md for contributing to Promgen.

If you believe you have discovered a vulnerability or have an issue related to security, please DO NOT open a public issue. Instead, send us a mail to dl_oss_dev@linecorp.com.

1. Initialize Promgen

Initialize Promgen using Docker.

# Create promgen setting directory.
mkdir -p ~/.config/promgen
chmod 777 ~/.config/promgen

# Initialize required settings with Docker container
# This will prompt you for connection settings for your database and Redis broker
# using the standard DSN syntax.
# Database example: mysql://username:password@hostname/databasename
# Broker example: redis://localhost:6379/0
docker run --rm -it -v ~/.config/promgen:/etc/promgen/ line/promgen bootstrap

# Apply database updates
docker run --rm -v ~/.config/promgen:/etc/promgen/ line/promgen migrate

# Create initial login user. This is the same as the default django-admin command
# https://docs.djangoproject.com/en/1.10/ref/django-admin/#django-admin-createsuperuser
docker run --rm -it -v ~/.config/promgen:/etc/promgen/ line/promgen createsuperuser

You can then use your favorite configuration management system to deploy to each worker.

Note: Promgen aims to use the XDG specs and follows suggestions made by the 12-Factor App.

2. Configure Prometheus

Configure Prometheus to load the target file from Prometheus and configure AlertManager to send notifications back to Promgen.

See the example settings files for proper configuration of Prometheus and AlertManager.

3. Run Promgen

Run Promgen using the following command.

# Run Promgen web worker. This is typically balanced behind an NGINX instance
docker run --rm -p 8000:8000 -v ~/.config/promgen:/etc/promgen/ line/promgen

# Run Promgen celery worker. Make sure to run it on the same machine as your Prometheus server to manage the config settings
docker run --rm -v ~/.config/promgen:/etc/promgen/ -v /etc/prometheus:/etc/prometheus line/promgen worker

# Or if using docker-compose you can spin up a complete test environment
docker-compose up -d
# Create initial user
docker-compose run web createsuperuser


Github

cwe_checker

Previous article

VictoriaMetrics – cost-effective and scalable monitoring solution

Next article

You may also like

Comments

Leave a reply

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir