prometheus-node-exporter-lua: add unbound stats collector#28784
Closed
marinierb wants to merge 2 commits into
Closed
prometheus-node-exporter-lua: add unbound stats collector#28784marinierb wants to merge 2 commits into
marinierb wants to merge 2 commits into
Conversation
Signed-off-by: Bruno Marinier <bmgm41@gmail.com>
Author
|
@champtar Monsieur Champetier, merci de bien vouloir jeter un coup d'oeil à ce PR. C'est mon tout premier! |
champtar
reviewed
Mar 27, 2026
| ["total.recursion.time.median" ] = metric("unbound_recursion_time_median_total", "counter"), | ||
| } | ||
|
|
||
| local handle = io.popen("/usr/sbin/unbound-control stats_noreset | sed 's/_/./g'") |
Member
There was a problem hiding this comment.
popen'ing 3 binaries (sh / unbound-control / sed) is "extremely" costly
You should be able to use unbound unix socket
https://github.com/letsencrypt/unbound_exporter/blob/01314cb6b51ed429f3e583d26b41d37754483084/exporter/unbound_exporter.go#L567
Untested (not a unbound user), but here is a try
socket = require("socket")
socket.unix = require("socket.unix")
c = assert(socket.unix())
assert(c:connect("/run/unbound-remote-control.sock"))
assert(c:send("UBCT1 stats_noreset\n"))
local out = c:receive("*a")
c:close()
Signed-off-by: marinierb <bmgm41@gmail.com> Signed-off-by: marinierb <notareal@email.address>
Author
|
@champtar Made the switch to unix socket. Please review. Thanks! |
Author
|
Question: For this to work requires configuration changes to unbound, i.e. How do I document that? A comment in the unbound.lua file? |
Member
|
@marinierb why are you closing ? |
Author
|
@champtar That was a mistake. Will resubmit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📦 prometheus-node-exporter-lua
Maintainer: @champtar
Description: Add a collector for unbound statistics
🧪 Run Testing Details
Signed-off-by: Bruno Marinier bmgm41@gmail.com