https://github.com/raylas/nextdns-exporter
Export NextDNS metrics
https://github.com/raylas/nextdns-exporter
Last synced: 5 months ago
JSON representation
Export NextDNS metrics
- Host: GitHub
- URL: https://github.com/raylas/nextdns-exporter
- Owner: raylas
- License: mit
- Created: 2022-11-20T01:01:29.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-06T21:40:58.000Z (over 1 year ago)
- Last Synced: 2025-03-06T22:27:56.520Z (over 1 year ago)
- Language: Go
- Size: 761 KB
- Stars: 56
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nextdns-exporter
[](https://github.com/raylas/nextdns-exporter/actions/workflows/main.yml)
[](https://goreportcard.com/report/github.com/raylas/nextdns-exporter)
A [Prometheus exporter](https://prometheus.io/docs/instrumenting/exporters/) for [NextDNS data](https://nextdns.github.io/api/#analytics).
## Configuration
- `LOG_LEVEL` (default: `INFO`)
- `METRICS_PORT` (default: `9948`)
- `METRICS_PATH` (default: `/metrics`)
- `NEXTDNS_RESULT_WINDOW` (default: `-5m`)
- `NEXTDNS_RESULT_LIMIT` (default: `50`)
- `NEXTDNS_PROFILE` (required: [docs](https://nextdns.github.io/api/#profile). You can provide multiple profiles separated by commas)
- `NEXTDNS_API_KEY` (required: [docs](https://nextdns.github.io/api/#authentication))
For most accurate data, the scrape interval _should_ match the value set via `NEXTDNS_RESULT_WINDOW`.
Recommended scrape timeout is `10` seconds.
## Usage
### Binary
Either [download a recent release](https://github.com/raylas/nextdns-exporter/releases) or compile the binary yourself (`go build -o nextdns-exporter`) and run:
```sh
export NEXTDNS_PROFILE=
export NEXTDNS_API_KEY=
./nextdns-exporter
2022-11-19T12:39:34.479-0800 [INFO] starting exporter: port=:9948 path=/metrics
```
### Docker
```sh
docker run -d \
-p 9948:9948 \
-e NEXTDNS_PROFILE= \
-e NEXTDNS_API_KEY= \
ghcr.io/raylas/nextdns-exporter
```
### Compose
The following will create a local stack of the exporter, Prometheus, and Grafana:
```sh
NEXTDNS_PROFILE= \
NEXTDNS_API_KEY= \
docker-compose up -d
```
Access Grafana by navigating to [http://localhost:3000](http://localhost:3000).
**Note:** Data will take a few minutes to trickle in.
## Dashboard
A basic Grafana dashboard is found [here](/grafana/dashboards/nextdns.json).
