nsr_exporter

command module
v0.12.4 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 18 Imported by: 0

README

nsr_exporter

CI Release Go Report Card Go License Docs

A Prometheus + OTLP metrics exporter for Dell EMC NetWorker backup servers.

A single process polls every configured NetWorker system on a background interval, caches an immutable snapshot, and serves /metrics (and an OTLP push) instantly from cache — so scrapes never reach the backend. Ships as a static, dependency-free binary.

Features

  • Decoupled snapshot model — backend API load is constant regardless of scraper count.
  • Dual export — Prometheus /metrics and OTLP push, from the same snapshot.
  • Multi-system — one process serves many servers; every metric carries system="<name>".
  • Safe on large catalogs — the /backups sizing query is time-bounded (never the full catalog).
  • Operable--once --debug sample dump, credential-safe --trace, SIGHUP reload, /health.

Quick start

# Build
make cli

# Try it offline against the bundled mock NetWorker server
go run ./cmd/mocknw &                 # listens on :9090
cp config.yaml my.yaml                # point a system at http://127.0.0.1:9090
NSR1_USERNAME=admin NSR1_PASSWORD=test ./bin/nsr_exporter --config my.yaml --once --debug

Then scrape http://localhost:9447/metrics. See docs/metrics.md for the metric catalog and config.yaml for configuration.

Configuration

config.yaml is the source of truth; ${ENV_VAR} references in host/username/password expand at load (fail-fast on unset), and passwordFile supplies secrets out-of-band. A .env beside the config is a quickstart convenience and never overrides real env vars.

Authentication

NetWorker uses HTTP Basic auth on every request against /nwrestapi/v3/global (no token dance). insecureSkipVerify is an operator opt-in for self-signed appliance certificates. See ADR-0007.

Development

make ci        # the gate: fmt-check, vet, lint, test-race, govulncheck
make sure      # local convenience: fmt, vet, test, build, lint
make test      # unit tests (httptest mock; no appliance needed)

Field-name validation. Collectors for serverstatistics, jobs, sessions, volumes, datadomainsystems use field names inferred from the NetWorker REST convention (marked // INFERRED in code). Confirm them against a live appliance with nsr_exporter --config real.yaml --once --debug --trace 2>trace.log | sort > samples.txt; a wrong guess surfaces as a missing metric, never a false zero.

License

MIT

Documentation

Overview

Command nsr_exporter is a Prometheus + OTLP exporter for Dell EMC NetWorker.

It runs one background loop that polls every configured NetWorker system on an interval, publishes an immutable snapshot, and serves /metrics (and OTLP push) from that snapshot so scrapes never reach the backend.

Directories

Path Synopsis
cmd
mocknw command
Command mocknw is a self-contained, offline NetWorker REST API emulator for local development and testing.
Command mocknw is a self-contained, offline NetWorker REST API emulator for local development and testing.
internal
config
Package config loads and validates the exporter's YAML configuration.
Package config loads and validates the exporter's YAML configuration.
logging
Package logging configures the shared logrus logger.
Package logging configures the shared logrus logger.
models
Package models holds the backend-agnostic data types shared across the exporter: the unified metric Sample emitted by collectors and the immutable Snapshot that both export paths read from.
Package models holds the backend-agnostic data types shared across the exporter: the unified metric Sample emitted by collectors and the immutable Snapshot that both export paths read from.
nsr
Package nsr implements the NetWorker collection layer: the background collection loop, the immutable snapshot store, the per-domain resource collectors, and the two export paths (Prometheus unchecked collector and OTLP observable gauges) that both read the same snapshot.
Package nsr implements the NetWorker collection layer: the background collection loop, the immutable snapshot store, the per-domain resource collectors, and the two export paths (Prometheus unchecked collector and OTLP observable gauges) that both read the same snapshot.
nsrclient
Package nsrclient is a lean go-resty/resty/v2 wrapper for the NetWorker REST API.
Package nsrclient is a lean go-resty/resty/v2 wrapper for the NetWorker REST API.

Jump to

Keyboard shortcuts

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