diff --git a/collector/fixtures/e2e-output.txt b/collector/fixtures/e2e-output.txt index 1610ab60..599b53c0 100644 --- a/collector/fixtures/e2e-output.txt +++ b/collector/fixtures/e2e-output.txt @@ -2699,8 +2699,8 @@ node_sockstat_UDP_mem_bytes 0 # HELP node_sockstat_sockets_used Number of sockets sockets in state used. # TYPE node_sockstat_sockets_used gauge node_sockstat_sockets_used 229 -# HELP node_textfile_mtime Unixtime mtime of textfiles successfully read. -# TYPE node_textfile_mtime gauge +# HELP node_textfile_mtime_seconds Unixtime mtime of textfiles successfully read. +# TYPE node_textfile_mtime_seconds gauge # HELP node_textfile_scrape_error 1 if there was an error opening or reading a file, 0 otherwise # TYPE node_textfile_scrape_error gauge node_textfile_scrape_error 0 diff --git a/collector/fixtures/e2e-ppc64le-output.txt b/collector/fixtures/e2e-ppc64le-output.txt index cc38869f..f1df736c 100644 --- a/collector/fixtures/e2e-ppc64le-output.txt +++ b/collector/fixtures/e2e-ppc64le-output.txt @@ -2729,8 +2729,8 @@ node_sockstat_UDP_mem_bytes 0 # HELP node_sockstat_sockets_used Number of sockets sockets in state used. # TYPE node_sockstat_sockets_used gauge node_sockstat_sockets_used 229 -# HELP node_textfile_mtime Unixtime mtime of textfiles successfully read. -# TYPE node_textfile_mtime gauge +# HELP node_textfile_mtime_seconds Unixtime mtime of textfiles successfully read. +# TYPE node_textfile_mtime_seconds gauge # HELP node_textfile_scrape_error 1 if there was an error opening or reading a file, 0 otherwise # TYPE node_textfile_scrape_error gauge node_textfile_scrape_error 0 diff --git a/collector/fixtures/textfile/different_metric_types.out b/collector/fixtures/textfile/different_metric_types.out index e158c0d0..83211e91 100644 --- a/collector/fixtures/textfile/different_metric_types.out +++ b/collector/fixtures/textfile/different_metric_types.out @@ -24,9 +24,9 @@ event_duration_seconds_total_count{baz="result_sort"} 1.427647e+06 # TYPE events_total counter events_total{foo="bar"} 10 events_total{foo="baz"} 20 -# HELP node_textfile_mtime Unixtime mtime of textfiles successfully read. -# TYPE node_textfile_mtime gauge -node_textfile_mtime{file="metrics.prom"} 1 +# HELP node_textfile_mtime_seconds Unixtime mtime of textfiles successfully read. +# TYPE node_textfile_mtime_seconds gauge +node_textfile_mtime_seconds{file="metrics.prom"} 1 # HELP node_textfile_scrape_error 1 if there was an error opening or reading a file, 0 otherwise # TYPE node_textfile_scrape_error gauge node_textfile_scrape_error 0 diff --git a/collector/fixtures/textfile/histogram.out b/collector/fixtures/textfile/histogram.out index 116c2827..f7977d45 100644 --- a/collector/fixtures/textfile/histogram.out +++ b/collector/fixtures/textfile/histogram.out @@ -1,6 +1,6 @@ -# HELP node_textfile_mtime Unixtime mtime of textfiles successfully read. -# TYPE node_textfile_mtime gauge -node_textfile_mtime{file="metrics.prom"} 1 +# HELP node_textfile_mtime_seconds Unixtime mtime of textfiles successfully read. +# TYPE node_textfile_mtime_seconds gauge +node_textfile_mtime_seconds{file="metrics.prom"} 1 # HELP node_textfile_scrape_error 1 if there was an error opening or reading a file, 0 otherwise # TYPE node_textfile_scrape_error gauge node_textfile_scrape_error 0 diff --git a/collector/fixtures/textfile/histogram_extra_dimension.out b/collector/fixtures/textfile/histogram_extra_dimension.out index cc800e5b..6125e8c1 100644 --- a/collector/fixtures/textfile/histogram_extra_dimension.out +++ b/collector/fixtures/textfile/histogram_extra_dimension.out @@ -1,6 +1,6 @@ -# HELP node_textfile_mtime Unixtime mtime of textfiles successfully read. -# TYPE node_textfile_mtime gauge -node_textfile_mtime{file="metrics.prom"} 1 +# HELP node_textfile_mtime_seconds Unixtime mtime of textfiles successfully read. +# TYPE node_textfile_mtime_seconds gauge +node_textfile_mtime_seconds{file="metrics.prom"} 1 # HELP node_textfile_scrape_error 1 if there was an error opening or reading a file, 0 otherwise # TYPE node_textfile_scrape_error gauge node_textfile_scrape_error 0 diff --git a/collector/fixtures/textfile/inconsistent_metrics.out b/collector/fixtures/textfile/inconsistent_metrics.out index 968238ec..987a5a5a 100644 --- a/collector/fixtures/textfile/inconsistent_metrics.out +++ b/collector/fixtures/textfile/inconsistent_metrics.out @@ -21,9 +21,9 @@ http_requests_total{baz="",code="206",foo="",handler="static",method="get"} 2 http_requests_total{baz="",code="400",foo="",handler="query_range",method="get"} 40 http_requests_total{baz="",code="503",foo="",handler="query_range",method="get"} 3 http_requests_total{baz="bar",code="200",foo="",handler="",method="get"} 93 -# HELP node_textfile_mtime Unixtime mtime of textfiles successfully read. -# TYPE node_textfile_mtime gauge -node_textfile_mtime{file="metrics.prom"} 1 +# HELP node_textfile_mtime_seconds Unixtime mtime of textfiles successfully read. +# TYPE node_textfile_mtime_seconds gauge +node_textfile_mtime_seconds{file="metrics.prom"} 1 # HELP node_textfile_scrape_error 1 if there was an error opening or reading a file, 0 otherwise # TYPE node_textfile_scrape_error gauge node_textfile_scrape_error 0 diff --git a/collector/fixtures/textfile/summary.out b/collector/fixtures/textfile/summary.out index 2f89fb09..0e1ac6a2 100644 --- a/collector/fixtures/textfile/summary.out +++ b/collector/fixtures/textfile/summary.out @@ -20,9 +20,9 @@ event_duration_seconds_total{baz="result_sort",quantile="0.9"} 2.975e-06 event_duration_seconds_total{baz="result_sort",quantile="0.99"} 4.08e-06 event_duration_seconds_total_sum{baz="result_sort"} 3.4123187829998307 event_duration_seconds_total_count{baz="result_sort"} 1.427647e+06 -# HELP node_textfile_mtime Unixtime mtime of textfiles successfully read. -# TYPE node_textfile_mtime gauge -node_textfile_mtime{file="metrics.prom"} 1 +# HELP node_textfile_mtime_seconds Unixtime mtime of textfiles successfully read. +# TYPE node_textfile_mtime_seconds gauge +node_textfile_mtime_seconds{file="metrics.prom"} 1 # HELP node_textfile_scrape_error 1 if there was an error opening or reading a file, 0 otherwise # TYPE node_textfile_scrape_error gauge node_textfile_scrape_error 0 diff --git a/collector/fixtures/textfile/summary_extra_dimension.out b/collector/fixtures/textfile/summary_extra_dimension.out index 4ffb9236..032c0339 100644 --- a/collector/fixtures/textfile/summary_extra_dimension.out +++ b/collector/fixtures/textfile/summary_extra_dimension.out @@ -1,6 +1,6 @@ -# HELP node_textfile_mtime Unixtime mtime of textfiles successfully read. -# TYPE node_textfile_mtime gauge -node_textfile_mtime{file="metrics.prom"} 1 +# HELP node_textfile_mtime_seconds Unixtime mtime of textfiles successfully read. +# TYPE node_textfile_mtime_seconds gauge +node_textfile_mtime_seconds{file="metrics.prom"} 1 # HELP node_textfile_scrape_error 1 if there was an error opening or reading a file, 0 otherwise # TYPE node_textfile_scrape_error gauge node_textfile_scrape_error 0 diff --git a/collector/fixtures/textfile/two_metric_files.out b/collector/fixtures/textfile/two_metric_files.out index 097247ed..d8bb7b93 100644 --- a/collector/fixtures/textfile/two_metric_files.out +++ b/collector/fixtures/textfile/two_metric_files.out @@ -1,7 +1,7 @@ -# HELP node_textfile_mtime Unixtime mtime of textfiles successfully read. -# TYPE node_textfile_mtime gauge -node_textfile_mtime{file="metrics1.prom"} 1 -node_textfile_mtime{file="metrics2.prom"} 1 +# HELP node_textfile_mtime_seconds Unixtime mtime of textfiles successfully read. +# TYPE node_textfile_mtime_seconds gauge +node_textfile_mtime_seconds{file="metrics1.prom"} 1 +node_textfile_mtime_seconds{file="metrics2.prom"} 1 # HELP node_textfile_scrape_error 1 if there was an error opening or reading a file, 0 otherwise # TYPE node_textfile_scrape_error gauge node_textfile_scrape_error 0 diff --git a/collector/textfile.go b/collector/textfile.go index 7922000f..a066e086 100644 --- a/collector/textfile.go +++ b/collector/textfile.go @@ -36,7 +36,7 @@ var ( textFileDirectory = kingpin.Flag("collector.textfile.directory", "Directory to read text files with metrics from.").Default("").String() textFileAddOnce sync.Once mtimeDesc = prometheus.NewDesc( - "node_textfile_mtime", + "node_textfile_mtime_seconds", "Unixtime mtime of textfiles successfully read.", []string{"file"}, nil, diff --git a/end-to-end-test.sh b/end-to-end-test.sh index c60008ee..545703fc 100755 --- a/end-to-end-test.sh +++ b/end-to-end-test.sh @@ -50,7 +50,7 @@ cd "$(dirname $0)" port="$((10000 + (RANDOM % 10000)))" tmpdir=$(mktemp -d /tmp/node_exporter_e2e_test.XXXXXX) -skip_re="^(go_|node_exporter_build_info|node_scrape_collector_duration_seconds|process_|node_textfile_mtime)" +skip_re="^(go_|node_exporter_build_info|node_scrape_collector_duration_seconds|process_|node_textfile_mtime_seconds)" arch="$(uname -m)"