Skip to content

diegogslomp/api_exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

76 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

api_exporter

API Exporter for Prometheus. Read temperatures and set gauges every minute.

  1. Local development
git clone --single-branch https://github.com/diegogslomp/api_exporter
cd api_exporter

# Create and activate a virtual environment (optional)
python -m pipenv install
python -m pipenv shell

# Copy and edit enviroment variables file
cp .example.env .env

# Install dependencies
pip install -r requirements

# Run script
python exporter/exporter.py
  1. Docker image
docker run \
  -e API_HOST="10.0.0.10" \
  -e API_PORT="8002" \
  -e API_USER="admin" \
  -e API_PASSWORD="SecretTempP4ss!" \
  -p 8083:8083 \
  --name exporter diegogslomp/api_exporter
  1. Docker compose (Ctrl+c to exit logs)
git clone --single-branch https://github.com/diegogslomp/api_exporter
cd api_exporter

# Copy and edit enviroment variables file
cp .example.env .env

docker compose up -d
docker compose logs -f