Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cherrysuryp/node-exporter-secure

Secured forwarder API for Prometheus Node Exporter
https://github.com/cherrysuryp/node-exporter-secure

exporter grafana prometheus prometheus-metrics

Last synced: 27 days ago
JSON representation

Secured forwarder API for Prometheus Node Exporter

Awesome Lists containing this project

README

        

# Node Exporter Secure
This is a custom API written with FastAPI Python framework that forwards [Prometheus Node-Exporter](https://github.com/prometheus/node_exporter) metrics data over secured endpoint with Bearer Auth

## Installation
### Docker-Compose
Fully complete `docker-compose.yml` ready to deploy, you only need to update `API_BEARER_TOKEN` env variable
```yaml
services:
node-exporter:
image: quay.io/prometheus/node-exporter:latest
container_name: node-exporter
command:
- '--path.rootfs=/host'
pid: host
restart: unless-stopped
volumes:
- /:/host:ro,rslave

api:
image: abelodev/node-exporter-secure:latest
container_name: node-exporter-secure
environment:
API_BEARER_TOKEN: "token"
command: ["sh", "-c", "uvicorn app.main:app --host=0.0.0.0 --port=8000"]
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://node-exporter-secure:8000/debug/healthcheck"]
interval: 1m
timeout: 10s
ports:
- "9100:8000"
depends_on:
- node-exporter

```

## Environment Variables
- `ENV` - `DEV` or `PROD`. Production env disables `/docs`, `/redoc` and `/openapi.json` endpoints. `PROD` is set by default.
- `API_BEARER_TOKEN` - Your Bearer token auth
- `METRICS_ROUTE` - Metrics route. Default set to `/metrics`
- `NODE_EXPORTER_METRICS_PATH` - Node-Exporter endpoint path. Default set to `http://node-exporter:9100/metrics`