Sign inSign up

lknappich/exporterhub-k8s-networkpolicy-exporter

By lknappich

•Updated 6 months ago

Image
0

1.5K

lknappich/exporterhub-k8s-networkpolicy-exporter repository overview

⁠K8s NetworkPolicy Exporter

Monitors Kubernetes NetworkPolicy coverage and rule counts

Part of the Exporter Hub⁠ — a collection of 50 production-grade Prometheus exporters.

⁠Quick start

docker run -d \
  -p 9132:9132 \
  lknappich/exporterhub-k8s-networkpolicy-exporter:latest

⁠What it monitors

Monitors Kubernetes NetworkPolicy coverage and rule counts.

⁠Metrics exposed

MetricTypeLabelsDescription
k8s-networkpolicy-exporter_scrape_duration_secondshistogram-Duration of each scrape cycle
k8s-networkpolicy-exporter_scrape_successgauge-Whether the last scrape succeeded (1=ok, 0=fail)
k8s-networkpolicy-exporter_scrape_errors_totalcountererror_typeTotal number of scrape errors by type
k8s-networkpolicy-exporter_build_infogaugeversion, commit, goversion, builddateBuild metadata

⁠Configuration

Environment variableDefaultDescription
EXPORTER_PORT9132HTTP listen port
EXPORTER_LOG_LEVELinfoLog verbosity: debug/info/warn/error
SCRAPE_INTERVAL15sHow often to collect metrics
SCRAPE_TIMEOUT10sPer-scrape timeout
TLS_CERT_FILE—Path to TLS cert (enables HTTPS)
TLS_KEY_FILE—Path to TLS key (enables HTTPS)

⁠Standard endpoints

EndpointDescription
/metricsPrometheus text format metrics
/healthzHealth check (200 if last scrape < 60s ago)
/readyzReadiness check (200 after first successful scrape)
/versionJSON with version, commit, buildDate

⁠Prometheus scrape config

scrape_configs:
  - job_name: 'k8s-networkpolicy-exporter'
    static_configs:
      - targets: ['localhost:9132']
    scrape_interval: 15s

⁠Platforms

linux/amd64, linux/arm64

⁠Source

github.com/lknappich/exporterhub⁠

Tag summary

Content type

Image

Digest

sha256:55e3b54db…

Size

12.1 MB

Last updated

6 months ago

docker pull lknappich/exporterhub-k8s-networkpolicy-exporter