Flag -collector.textfile.directory is in conflict with flag -collectors.enabled

1,426 views
Skip to first unread message

ZhongCheng Zuo

unread,
Mar 22, 2017, 5:57:38 AM3/22/17
to Prometheus Users
Seems flag "-collector.textfile.directory" is in conflict with flag "-collectors.enabled". Is this expected? Or is there a way I can use those two flags at same time? Thank you.

Here is what I try and get:

I set "-collector.textfile.directory" to directory "/var/lib/node_exporter/textfile_collector" and will create a prom file named "gpfs_mount_time.prom" there and then my script will write metric "gpfs_mount_time" records into it. So if things go smoothly, I will get the metric stream when I curl the node exporter.

But when I run node_exporter with flags both "-collector.textfile.directory" and "-collectors.enabled", the textfile collector will not work. See below scenarioes:

Scenario 1: those two flags, -collector.textfile.directory and -collectors.enabled.

If I add those two flags, there will be no metric `gpfs_mount_time` collected.

[root@dev-repo scripts]# nohup /root/node_exporter -collector.textfile.directory /var/lib/node_exporter/textfile_collector -collectors.enabled nfs &

[root@dev-repo scripts]# curl http://localhost:9100/metrics -s -S | grep gpfs
[root@dev-repo scripts]#

Scenario 2: only flag, -collector.textfile.directory

the metric I wanna get can be collcted by node exporter if I just add flag `-collector.textfile.directory`.

[root@dev-repo scripts]# nohup /root/node_exporter -collector.textfile.directory /var/lib/node_exporter/textfile_collector &
[root@dev-repo scripts]#

[root@dev-repo scripts]# curl http://localhost:9100/metrics -s -S | grep gpfs
# HELP gpfs_mount_time Metric read from /var/lib/node_exporter/textfile_collector/gpfs_mount_time.prom
# TYPE gpfs_mount_time untyped
gpfs_mount_time
{check_result_msg="Mount timeout",gpfs_node="node1"} 1
gpfs_mount_time
{check_result_msg="Mount timeout",gpfs_node="node2"} 1
gpfs_mount_time
{check_result_msg="Mount timeout",gpfs_node="node3"} 1
node_textfile_mtime
{file="gpfs_mount_time.prom"} 1.4901663641650345e+09
[root@dev-repo scripts]#

System and software info

[root@dev-repo scripts]# /root/node_exporter --version
node_exporter
, version 0.14.0-rc.1 (branch: master, revision: 6fa6f476c71ca71c0bc4c20713b7082452b58d9f)
  build user
:       *****
  build date
:       20170303-07:15:11
  go version
:       go1.7.1
[root@dev-repo scripts]# uname -r
3.10.0-514.6.1.el7.x86_64


Additional info

I downloaded the newest version of node_exporter and repeated the test above with the newest binary node_exporter and got the same result.

[root@dev-repo scripts]# ./node_exporter --version
node_exporter
, version 0.14.0 (branch: master, revision: 840ba5dcc71a084a3bc63cb6063003c1f94435a6)
  build user
:       root@bb6d0678e7f3
  build date
:       20170321-12:12:54
  go version
:       go1.7.5

 

Brian Brazil

unread,
Mar 22, 2017, 6:15:35 AM3/22/17
to ZhongCheng Zuo, Prometheus Users
On 22 March 2017 at 09:50, ZhongCheng Zuo <zzc...@gmail.com> wrote:
Seems flag `-collector.textfile.directory` is in conflict with flag `-collectors.enabled`. Is this expected? or is it a bug? Or is there a way I can use those two flags at same time? Thank you.

Here is what I try and get:

I set `-collector.textfile.directory` to directory `/var/lib/node_exporter/textfile_collector` and will create a `prom` file named `gpfs_mount_time.prom` there and then my script will write metric `gpfs_mount_time` records into it. So if things go smoothly, I will get the metric stream when I curl the node exporter.

But when I run node_exporter with flags both `-collector.textfile.directory` and `-collectors.enabled`, the textfile collector will not work. See below scenarioes:

### Scenario 1: those two flags, -collector.textfile.directory and -collectors.enabled.

If I add those two flags, there will be no metric `gpfs_mount_time` collected.

```
[root@dev-repo scripts]# nohup /root/node_exporter -collector.textfile.directory /var/lib/node_exporter/textfile_collector -collectors.enabled nfs &

You've only enabled the nfs collector, which means the textfile collector is disabled. You need to list all the collectors you want to run.

Brian
 
```

```
[root@dev-repo scripts]# curl http://localhost:9100/metrics -s -S | grep gpfs
[root@dev-repo scripts]#
```

### Scenario 2: only flag, -collector.textfile.directory

the metric I wanna get can be collcted by node exporter if I just add flag `-collector.textfile.directory`.

```
[root@dev-repo scripts]# nohup /root/node_exporter -collector.textfile.directory /var/lib/node_exporter/textfile_collector &
[root@dev-repo scripts]# 
```

```
[root@dev-repo scripts]# curl http://localhost:9100/metrics -s -S | grep gpfs
# HELP gpfs_mount_time Metric read from /var/lib/node_exporter/textfile_collector/gpfs_mount_time.prom
# TYPE gpfs_mount_time untyped
gpfs_mount_time{check_result_msg="Mount timeout",gpfs_node="node1"} 1
gpfs_mount_time{check_result_msg="Mount timeout",gpfs_node="node2"} 1
gpfs_mount_time{check_result_msg="Mount timeout",gpfs_node="node3"} 1
node_textfile_mtime{file="gpfs_mount_time.prom"} 1.4901663641650345e+09
[root@dev-repo scripts]# 
```

### System and software info

```
[root@dev-repo scripts]# /root/node_exporter --version
node_exporter, version 0.14.0-rc.1 (branch: master, revision: 6fa6f476c71ca71c0bc4c20713b7082452b58d9f)
  build user:       *****
  build date:       20170303-07:15:11
  go version:       go1.7.1
[root@dev-repo scripts]# uname -r
3.10.0-514.6.1.el7.x86_64
```

### Additional info

I downloaded the newest version of [node_exporter](https://github.com/prometheus/node_exporter/releases/download/v0.14.0/node_exporter-0.14.0.linux-amd64.tar.gz) and repeated the test above with the newest binary `node_exporter` and got the same result.

```
[root@dev-repo scripts]# ./node_exporter --version
node_exporter, version 0.14.0 (branch: master, revision: 840ba5dcc71a084a3bc63cb6063003c1f94435a6)
  build user:       root@bb6d0678e7f3
  build date:       20170321-12:12:54
  go version:       go1.7.5
```
 

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/d3b7bcee-ba0c-4ca2-9168-013bebe63533%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

ZhongCheng Zuo

unread,
Mar 22, 2017, 9:22:26 AM3/22/17
to Prometheus Users, zzc...@gmail.com
Thank you Brian
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.



--

kavya.kul...@gmail.com

unread,
Mar 23, 2017, 4:23:48 AM3/23/17
to Prometheus Users, zzc...@gmail.com


On Wednesday, 22 March 2017 15:45:35 UTC+5:30, Brian Brazil wrote:
On 22 March 2017 at 09:50, ZhongCheng Zuo <zzc...@gmail.com> wrote:
Seems flag `-collector.textfile.directory` is in conflict with flag `-collectors.enabled`. Is this expected? or is it a bug? Or is there a way I can use those two flags at same time? Thank you.

Here is what I try and get:

I set `-collector.textfile.directory` to directory `/var/lib/node_exporter/textfile_collector` and will create a `prom` file named `gpfs_mount_time.prom` there and then my script will write metric `gpfs_mount_time` records into it. So if things go smoothly, I will get the metric stream when I curl the node exporter.

But when I run node_exporter with flags both `-collector.textfile.directory` and `-collectors.enabled`, the textfile collector will not work. See below scenarioes:

### Scenario 1: those two flags, -collector.textfile.directory and -collectors.enabled.

If I add those two flags, there will be no metric `gpfs_mount_time` collected.

```
[root@dev-repo scripts]# nohup /root/node_exporter -collector.textfile.directory /var/lib/node_exporter/textfile_collector -collectors.enabled nfs &

You've only enabled the nfs collector, which means the textfile collector is disabled. You need to list all the collectors you want to run.

Hi Brian,
The documentation says textfile collector is enabled by default. Do we need to specify "textfile" collector or any other collector which is enabled by default if using -collectors.enabled?

Regards,
Kavya K


Brian
 
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.



--

Brian Brazil

unread,
Mar 23, 2017, 4:37:24 AM3/23/17
to kavya KULSHRESHTHA, Prometheus Users, ZhongCheng Zuo
On 23 March 2017 at 08:23, <kavya.kul...@gmail.com> wrote:


On Wednesday, 22 March 2017 15:45:35 UTC+5:30, Brian Brazil wrote:
On 22 March 2017 at 09:50, ZhongCheng Zuo <zzc...@gmail.com> wrote:
Seems flag `-collector.textfile.directory` is in conflict with flag `-collectors.enabled`. Is this expected? or is it a bug? Or is there a way I can use those two flags at same time? Thank you.

Here is what I try and get:

I set `-collector.textfile.directory` to directory `/var/lib/node_exporter/textfile_collector` and will create a `prom` file named `gpfs_mount_time.prom` there and then my script will write metric `gpfs_mount_time` records into it. So if things go smoothly, I will get the metric stream when I curl the node exporter.

But when I run node_exporter with flags both `-collector.textfile.directory` and `-collectors.enabled`, the textfile collector will not work. See below scenarioes:

### Scenario 1: those two flags, -collector.textfile.directory and -collectors.enabled.

If I add those two flags, there will be no metric `gpfs_mount_time` collected.

```
[root@dev-repo scripts]# nohup /root/node_exporter -collector.textfile.directory /var/lib/node_exporter/textfile_collector -collectors.enabled nfs &

You've only enabled the nfs collector, which means the textfile collector is disabled. You need to list all the collectors you want to run.

Hi Brian,
The documentation says textfile collector is enabled by default. Do we need to specify "textfile" collector or any other collector which is enabled by default if using -collectors.enabled?

Yes.

Brian
 
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/10b8d285-a97c-45d6-af6e-df7140a6944b%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages