Bug 218197

Summary: [NEW PORT] net-mgmt/unbound_exporter: Prometheus metrics exporter for the Unbound DNS resolver
Product: Ports & Packages Reporter: Athanasios Douitsis <aduitsis>
Component: Individual Port(s)Assignee: Boris Samorodov <bsam>
Status: Closed FIXED    
Severity: Affects Many People CC: aduitsis, bsam
Priority: --- Flags: bsam: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Shar archive of the port none

Description Athanasios Douitsis 2017-03-28 21:53:01 UTC
Created attachment 181282 [details]
Shar archive of the port

Unbound_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.
Comment 1 Athanasios Douitsis 2017-03-30 21:07:41 UTC
If anyone reviewing this code can suggest a better way of handling the output of the process, I'd be obliged for any suggestions. I think that right now, redirecting stdout and stderr should suffice.
Comment 2 Boris Samorodov freebsd_committer freebsd_triage 2017-07-17 20:48:32 UTC
Take.
Comment 3 Boris Samorodov freebsd_committer freebsd_triage 2017-07-17 21:55:32 UTC
Hi Athanasios,

I get an error while building the port with poudriere:
=======================<phase: build          >============================
===>  Building for unbound_exporter-0.1
go: missing Git command. See https://golang.org/s/gogetcmd
package github.com/prometheus/client_golang/prometheus: exec: "git": executable file not found in $PATH
*** Error code 1

The approach you've taken (to fetch something by "go get" command) seems to be not the best/acceptable. For more help please use freebsd-ports@ mail list.
Comment 4 Athanasios Douitsis 2017-07-17 22:15:01 UTC
(In reply to Boris Samorodov from comment #3)

I have a new version that only accesses the network when fetching. This is the correct behaviour and will build correctly when trying to test using poudriere.

For the time being, I have it here: https://github.com/aduitsis/unbound_exporter_freebsd_port

Give me some time and I'll submit a new shar.
Comment 5 Boris Samorodov freebsd_committer freebsd_triage 2017-07-17 22:16:49 UTC
(In reply to Athanasios Douitsis from comment #4)
OK, no need in shar. I'll take it from github.
Comment 6 Athanasios Douitsis 2017-07-17 22:18:49 UTC
Wow! Thanks!
Comment 7 commit-hook freebsd_committer freebsd_triage 2017-07-17 22:27:32 UTC
A commit references this bug:

Author: bsam
Date: Mon Jul 17 22:26:34 UTC 2017
New revision: 446121
URL: https://svnweb.freebsd.org/changeset/ports/446121

Log:
  Unbound_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.

  WWW: https://github.com/kumina/unbound_exporter

  PR:		218197
  Submitted by:	Athanasios Douitsis <aduitsis@cpan.org>

Changes:
  head/net-mgmt/Makefile
  head/net-mgmt/unbound_exporter/
  head/net-mgmt/unbound_exporter/Makefile
  head/net-mgmt/unbound_exporter/distinfo
  head/net-mgmt/unbound_exporter/files/
  head/net-mgmt/unbound_exporter/files/unbound_exporter.in
  head/net-mgmt/unbound_exporter/pkg-descr
Comment 8 Boris Samorodov freebsd_committer freebsd_triage 2017-07-17 22:31:41 UTC
Committed, thanks!

As a side note: seems that there is an extra tab at each line at Makefile. I've changed it at your other port, but this port slipped my eye. I'll leave it for you whether to fix it or not.
Comment 9 Boris Samorodov freebsd_committer freebsd_triage 2017-07-17 22:32:21 UTC
Close.