Skip to content

Commit 5536568

Browse files
authored
Merge pull request #2874 from herver/export_build_info
prometheus: expose "build_info" gauge
2 parents 3687181 + b7c2ddc commit 5536568

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

dnscrypt-proxy/monitoring_ui.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"html"
88
"net"
99
"net/http"
10+
"runtime"
1011
"sort"
1112
"strings"
1213
"sync"
@@ -473,6 +474,10 @@ func (mc *MetricsCollector) generatePrometheusMetrics() string {
473474
var result strings.Builder
474475

475476
// Write help and type information for each metric
477+
result.WriteString("# HELP dnscrypt_proxy_build_info A metric with a constant '1' value labeled by version, goversion from which dnscrypt_proxy was built, and the goos and goarch for the build.\n")
478+
result.WriteString("# TYPE dnscrypt_proxy_build_info gauge\n")
479+
result.WriteString(fmt.Sprintf("dnscrypt_proxy_build_info{goarch=\"%s\" goos=\"%s\" goversion=\"%s\" version=\"%s\"} 1\n", runtime.GOARCH, runtime.GOOS, runtime.Version(), AppVersion))
480+
476481
result.WriteString("# HELP dnscrypt_proxy_queries_total Total number of DNS queries processed\n")
477482
result.WriteString("# TYPE dnscrypt_proxy_queries_total counter\n")
478483
result.WriteString(fmt.Sprintf("dnscrypt_proxy_queries_total %d\n", totalQueries))

0 commit comments

Comments
 (0)