Prometheus Exporter
A Prometheus exporter that exposes Generator Labs API results as Prometheus metrics at /metrics. On each scrape, it calls the Generator Labs API and translates the results into Prometheus gauge metrics.
Source: https://github.com/generator-labs/prometheus-exporter
Supported Products
- RBL Monitoring — blacklist listing count across all monitored IPs/domains
- Certificate Monitoring — SSL/TLS certificate error count across all monitored hosts
Metrics
| Metric | Type | Labels | Description |
|---|---|---|---|
generatorlabs_rbl_listings | gauge | — | RBL listing count (0=clean, >0=listed, -1=API error) |
generatorlabs_cert_errors | gauge | — | Certificate error count (0=clean, >0=errors, -1=API error) |
generatorlabs_api_up | gauge | check | Whether the API is reachable (1=yes, 0=no) |
generatorlabs_api_duration_seconds | gauge | check | API call latency in seconds |
generatorlabs_exporter_info | gauge | version | Exporter version information |
Requirements
- HTTPS connectivity to
api.generatorlabs.com - Go 1.21+ (if building from source)
Installation
Pre-built Binaries
Download the latest release for your platform from the Releases page.
Docker
docker run -d \
-p 9786:9786 \
-e GENERATOR_LABS_ACCOUNT_SID=your_account_sid \
-e GENERATOR_LABS_AUTH_TOKEN=your_auth_token \
ghcr.io/generator-labs/prometheus-exporter:latest
From Source
git clone https://github.com/generator-labs/prometheus-exporter.git
cd prometheus-exporter
make build
Configuration
Configuration is available via command-line flags or environment variables. Flags take precedence.
| Flag | Environment Variable | Default | Description |
|---|---|---|---|
--version | — | — | Print version and exit |
--account-sid | GENERATOR_LABS_ACCOUNT_SID | (required) | Generator Labs Account SID |
--auth-token | GENERATOR_LABS_AUTH_TOKEN | (required) | Generator Labs Auth Token |
--listen-address | GENERATOR_LABS_LISTEN_ADDRESS | :9786 | Address to listen on |
--api-timeout | GENERATOR_LABS_API_TIMEOUT | 30s | Timeout for API requests |
--enable-rbl | GENERATOR_LABS_ENABLE_RBL | true | Enable RBL listing check |
--enable-cert | GENERATOR_LABS_ENABLE_CERT | true | Enable certificate error check |
Your Account SID and Auth Token are available from the Generator Labs Portal.
Prometheus Configuration
Add a scrape job to your prometheus.yml:
scrape_configs:
- job_name: generatorlabs
scrape_interval: 5m
scrape_timeout: 60s
static_configs:
- targets:
- localhost:9786
Alerting Rules
Example alerting rules:
groups:
- name: generatorlabs
rules:
- alert: RBLListingsDetected
expr: generatorlabs_rbl_listings > 0
for: 0m
labels:
severity: critical
annotations:
summary: "IP/domain found on {{ $value }} RBL blacklists"
- alert: CertificateErrors
expr: generatorlabs_cert_errors > 0
for: 0m
labels:
severity: warning
annotations:
summary: "{{ $value }} SSL certificate errors detected"
- alert: GeneratorLabsAPIDown
expr: generatorlabs_api_up == 0
for: 10m
labels:
severity: warning
annotations:
summary: "Generator Labs API unreachable for check {{ $labels.check }}"
- alert: GeneratorLabsAPIError
expr: generatorlabs_rbl_listings == -1 or generatorlabs_cert_errors == -1
for: 10m
labels:
severity: warning
annotations:
summary: "Generator Labs API returning error value"