Commit 9a3ff487 authored by Robert Jacob's avatar Robert Jacob

Extract metric prefix into constant.

parent b54ecefa
......@@ -12,29 +12,33 @@ import (
const (
metricPrefix = "nextcloud_"
var (
usersDesc = prometheus.NewDesc(
"Number of users of the instance.",
nil, nil)
filesDesc = prometheus.NewDesc(
"Number of files served by the instance.",
nil, nil)
freeSpaceDesc = prometheus.NewDesc(
"Number of bytes of free space on the instance.",
nil, nil)
sharesDesc = prometheus.NewDesc(
"Number of shares by type.",
[]string{"type"}, nil)
federationsDesc = prometheus.NewDesc(
"Number of federated shares by direction.",
[]string{"direction"}, nil)
activeUsersDesc = prometheus.NewDesc(
"Number of active users for the last five minutes.",
nil, nil)
......@@ -58,15 +62,15 @@ func newCollector(infoURL *url.URL, username, password string, timeout time.Dura
Timeout: timeout,
upMetric: prometheus.NewGauge(prometheus.GaugeOpts{
Name: "nextcloud_up",
Name: metricPrefix + "up",
Help: "Shows if nextcloud is deemed up by the collector.",
authErrorsMetric: prometheus.NewCounter(prometheus.CounterOpts{
Name: "nextcloud_auth_errors_total",
Name: metricPrefix + "auth_errors_total",
Help: "Counts number of authentication errors encountered by the collector.",
scrapeErrorsMetric: prometheus.NewCounter(prometheus.CounterOpts{
Name: "nextcloud_scrape_errors_total",
Name: metricPrefix + "scrape_errors_total",
Help: "Counts the number of scrape errors by this collector.",
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment