Go to file
J.C. Jones 43dfb18ca7
Build and Release Action (#38)
Co-authored-by: James Renken <jrenken@letsencrypt.org>
2022-04-22 11:28:46 -07:00
.github/workflows Build and Release Action (#38) 2022-04-22 11:28:46 -07:00
.gitignore Refactored the unbound histogram metrics from gauge metrics into 2017-10-19 16:10:25 +02:00
LICENSE Add a proper license. 2017-01-09 09:35:52 +01:00
README.md Fix lints, add testing file, and update go mod and sum files (#28) 2021-11-17 14:32:28 -05:00
go.mod Update repository name in go.mod (#29) 2021-11-17 15:11:42 -05:00
go.sum Fix lints, add testing file, and update go mod and sum files (#28) 2021-11-17 14:32:28 -05:00
nfpm.yaml Build and Release Action (#38) 2022-04-22 11:28:46 -07:00
unbound_exporter.go Fix lints, add testing file, and update go mod and sum files (#28) 2021-11-17 14:32:28 -05:00
unbound_exporter_test.go Fix lints, add testing file, and update go mod and sum files (#28) 2021-11-17 14:32:28 -05:00

README.md

Prometheus Unbound exporter

This repository provides code for a simple Prometheus metrics exporter for the Unbound DNS resolver. This exporter connects to Unbounds TLS control socket and sends the stats_noreset command, causing Unbound to return metrics as key-value pairs. The metrics exporter converts Unbound metric names to Prometheus metric names and labels by using a set of regular expressions.


Installation

To install this code and in your go environment. You can then add the binary to your PATH.

go get github.com/letsencrypt/unbound_exporter
go install github.com/letsencrypt/unbound_exporter

Updating dependencies

go get -u
go mod tidy

Usage

To show all CLI flags available

$ unbound_exporter -h

Scrape metrics from the exporter

$ curl 127.0.0.1:9167/metrics | grep '^unbound_up'
unbound_up 1

From the Unbound statistics doc: Unbound has an option to enable extended statistics collection. If enabled, more statistics are collected, for example what types of queries are sent to the resolver. Otherwise, only the total number of queries is collected. Add the following to your unbound.conf.

server:
    extended-statistics: yes