porkbun-exporter

command module
v0.0.0-...-8097060 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

README

A Prometheus Exporter for Porkbun

build Go Reference Go Report Card

Run

The exporter requires Porkbun API key and secret values provided by the environment. The exports accepts flags for domains to be queried, endpoint of the exporter, and metrics path:

export APIKEY="..."
export SECRET="..."

HOST_PORT="8080"
CONT_PORT="8080"

# Replace with your list of Porbun API-enabled domains
DOMAINS="example.com,example,org"

podman run \
--interactive --tty --rm \
--name=porkbun-exporter \
--env=APIKEY=${APIKEY} \
--env=SECRET=${SECRET} \
--publish=${HOST_PORT}:${CONT_PORT}/tcp \
ghcr.io/dazwilkin/porkbun-exporter:8b24c5729c86faa03fe5767fd53a9cc72c4bc091 \
--domains=${DOMAINS} \
--endpoint=:${CONT_PORT} \
--path=/metrics

Build

Prometheus

VERS="v2.46.0"

# Binds to host network to scrape Porkbun Exporter
podman run \
--interactive --tty --rm \
--net=host \
--volume=${PWD}/prometheus.yml:/etc/prometheus/prometheus.yml \
--volume=${PWD}/rules.yml:/etc/alertmanager/rules.yml \
quay.io/prometheus/prometheus:${VERS} \
  --config.file=/etc/prometheus/prometheus.yml \
  --web.enable-lifecycle

Metrics

All metrics are prefixed porkbun_exporter_

Name Type Description
porkbun_exporter_build_info Counter A metric with a constant '1' value labeled by OS version, Go version, and the Git commit of the exporter
porkbun_exporter_ssl_bundle Gauge A metric with a constant value of 1 if bundle exists
porkbun_exporter_dns_type Gauge A metric that totals a domain's DNS records by type
porkbun_exporter_start_time Gauge Exporter start time in Unix epoch seconds

Alertmanager

groups:
  - name: porkbun-exporter
    rules:
    - alert: porkbun_ssl_certs
      expr: sum without(domain) (porkbun_exporter_ssl_bundle{}) != X
      for: 1h
      labels:
        severity: warning
      annotations:
        summary: "Porkbun SSL certificates {{ $value }} (expect X)"
    - alert: porkbun_dns_records
      expr: |
            sum without(name,type) (porkbun_exporter_dns_type{domain="D1"}) != X or
            sum without(name,type) (porkbun_exporter_dns_type{domain="D2"}) != Y
      for: 1h
      labels:
        severity: page
      annotations:
        summary: "Porkbun DNS records changed for {{ $labels.domain }} now {{ $value }} records"

Sigstore

porkbun-exporter container images are being signed by Sigstore and may be verified:

cosign verify \
--key=./cosign.pub \
ghcr.io/dazwilkin/porkbun-exporter:8b24c5729c86faa03fe5767fd53a9cc72c4bc091

NOTE cosign.pub may be downloaded here

To install cosign, e.g.:

go install github.com/sigstore/cosign/cmd/cosign@latest

Similar Exporters



Buy Me A Coffee

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL