Change metric namespace from wmi to windows

This commit is contained in:
Calle Pettersson
2020-05-24 20:36:25 +02:00
parent 6f90d83b83
commit eaa23705d0
4 changed files with 9 additions and 9 deletions

View File

@@ -14,7 +14,7 @@ import (
// ... // ...
const ( const (
// TODO: Make package-local // TODO: Make package-local
Namespace = "wmi" Namespace = "windows"
// Conversion factors // Conversion factors
ticksToSecondsScaleFactor = 1 / 1e7 ticksToSecondsScaleFactor = 1 / 1e7

View File

@@ -396,13 +396,13 @@ func NewMSSQLCollector() (Collector, error) {
// meta // meta
mssqlScrapeDurationDesc: prometheus.NewDesc( mssqlScrapeDurationDesc: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "collector_duration_seconds"), prometheus.BuildFQName(Namespace, subsystem, "collector_duration_seconds"),
"wmi_exporter: Duration of an mssql child collection.", "windows_exporter: Duration of an mssql child collection.",
[]string{"collector", "instance"}, []string{"collector", "instance"},
nil, nil,
), ),
mssqlScrapeSuccessDesc: prometheus.NewDesc( mssqlScrapeSuccessDesc: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "collector_success"), prometheus.BuildFQName(Namespace, subsystem, "collector_success"),
"wmi_exporter: Whether a mssql child collector was successful.", "windows_exporter: Whether a mssql child collector was successful.",
[]string{"collector", "instance"}, []string{"collector", "instance"},
nil, nil,
), ),

View File

@@ -40,7 +40,7 @@ var (
).Default("C:\\Program Files\\wmi_exporter\\textfile_inputs").String() ).Default("C:\\Program Files\\wmi_exporter\\textfile_inputs").String()
mtimeDesc = prometheus.NewDesc( mtimeDesc = prometheus.NewDesc(
"wmi_textfile_mtime_seconds", prometheus.BuildFQName(Namespace, "textfile", "mtime_seconds"),
"Unixtime mtime of textfiles successfully read.", "Unixtime mtime of textfiles successfully read.",
[]string{"file"}, []string{"file"},
nil, nil,
@@ -281,7 +281,7 @@ fileLoop:
// Export if there were errors. // Export if there were errors.
ch <- prometheus.MustNewConstMetric( ch <- prometheus.MustNewConstMetric(
prometheus.NewDesc( prometheus.NewDesc(
"wmi_textfile_scrape_error", prometheus.BuildFQName(Namespace, "textfile", "scrape_error"),
"1 if there was an error opening or reading a file, 0 otherwise", "1 if there was an error opening or reading a file, 0 otherwise",
nil, nil, nil, nil,
), ),

View File

@@ -38,19 +38,19 @@ const (
var ( var (
scrapeDurationDesc = prometheus.NewDesc( scrapeDurationDesc = prometheus.NewDesc(
prometheus.BuildFQName(collector.Namespace, "exporter", "collector_duration_seconds"), prometheus.BuildFQName(collector.Namespace, "exporter", "collector_duration_seconds"),
"wmi_exporter: Duration of a collection.", "windows_exporter: Duration of a collection.",
[]string{"collector"}, []string{"collector"},
nil, nil,
) )
scrapeSuccessDesc = prometheus.NewDesc( scrapeSuccessDesc = prometheus.NewDesc(
prometheus.BuildFQName(collector.Namespace, "exporter", "collector_success"), prometheus.BuildFQName(collector.Namespace, "exporter", "collector_success"),
"wmi_exporter: Whether the collector was successful.", "windows_exporter: Whether the collector was successful.",
[]string{"collector"}, []string{"collector"},
nil, nil,
) )
scrapeTimeoutDesc = prometheus.NewDesc( scrapeTimeoutDesc = prometheus.NewDesc(
prometheus.BuildFQName(collector.Namespace, "exporter", "collector_timeout"), prometheus.BuildFQName(collector.Namespace, "exporter", "collector_timeout"),
"wmi_exporter: Whether the collector timed out.", "windows_exporter: Whether the collector timed out.",
[]string{"collector"}, []string{"collector"},
nil, nil,
) )
@@ -452,7 +452,7 @@ func (mh *metricsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
reg.MustRegister( reg.MustRegister(
prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{}), prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{}),
prometheus.NewGoCollector(), prometheus.NewGoCollector(),
version.NewCollector("wmi_exporter"), version.NewCollector("windows_exporter"),
) )
h := promhttp.HandlerFor(reg, promhttp.HandlerOpts{}) h := promhttp.HandlerFor(reg, promhttp.HandlerOpts{})