Skip to main content

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

MetricTypeLabelsDescription
generatorlabs_rbl_listingsgaugeRBL listing count (0=clean, >0=listed, -1=API error)
generatorlabs_cert_errorsgaugeCertificate error count (0=clean, >0=errors, -1=API error)
generatorlabs_api_upgaugecheckWhether the API is reachable (1=yes, 0=no)
generatorlabs_api_duration_secondsgaugecheckAPI call latency in seconds
generatorlabs_exporter_infogaugeversionExporter 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.

FlagEnvironment VariableDefaultDescription
--versionPrint version and exit
--account-sidGENERATOR_LABS_ACCOUNT_SID(required)Generator Labs Account SID
--auth-tokenGENERATOR_LABS_AUTH_TOKEN(required)Generator Labs Auth Token
--listen-addressGENERATOR_LABS_LISTEN_ADDRESS:9786Address to listen on
--api-timeoutGENERATOR_LABS_API_TIMEOUT30sTimeout for API requests
--enable-rblGENERATOR_LABS_ENABLE_RBLtrueEnable RBL listing check
--enable-certGENERATOR_LABS_ENABLE_CERTtrueEnable 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"