Working of Textfile Collector.

449 views
Skip to first unread message

Yagyansh S. Kumar

unread,
Mar 7, 2020, 12:01:41 PM3/7/20
to Prometheus Users
Hi. I am just now able to get my head around the working of textfile collector. Can someone explain or provide a good link to understand its working?

Thanks!

Murali Krishna Kanagala

unread,
Mar 7, 2020, 1:31:35 PM3/7/20
to Yagyansh S. Kumar, Prometheus Users
Just drop a text file with data in Prometheus format and pass it as a command line arguments on your node exporter. 



On Sat, Mar 7, 2020, 11:01 AM Yagyansh S. Kumar <yagyans...@gmail.com> wrote:
Hi. I am just now able to get my head around the working of textfile collector. Can someone explain or provide a good link to understand its working?

Thanks!

--
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-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/19715622-31e6-402e-8497-49448f6f0b95%40googlegroups.com.

Yagyansh S. Kumar

unread,
Mar 7, 2020, 3:16:16 PM3/7/20
to Prometheus Users
Is it necessary that the output should be a float value? What if I want to scrape something else?
For eg. I want to scrape the version of VMWare-Tools running in the VM. I have stored that in a file in Prometheus format but I am getting the below error:
text format parsing error in line 1: expected float as value, got "'10.3.10.10540'"
The bold is the output that I need to push to prometheus.

On Sunday, March 8, 2020 at 12:01:35 AM UTC+5:30, Murali Krishna Kanagala wrote:
Just drop a text file with data in Prometheus format and pass it as a command line arguments on your node exporter. 



On Sat, Mar 7, 2020, 11:01 AM Yagyansh S. Kumar <yagyans...@gmail.com> wrote:
Hi. I am just now able to get my head around the working of textfile collector. Can someone explain or provide a good link to understand its working?

Thanks!

--
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 promethe...@googlegroups.com.

Stuart Clark

unread,
Mar 7, 2020, 3:17:55 PM3/7/20
to Yagyansh S. Kumar, Prometheus Users
On 07/03/2020 20:16, Yagyansh S. Kumar wrote:
Is it necessary that the output should be a float value? What if I want to scrape something else?
For eg. I want to scrape the version of VMWare-Tools running in the VM. I have stored that in a file in Prometheus format but I am getting the below error:
text format parsing error in line 1: expected float as value, got "'10.3.10.10540'"
The bold is the output that I need to push to prometheus.


Prometheus only deals in floats, but labels can be any string.

So for this case it's common to set the value to "1" and then have a "version" tag.


On Sunday, March 8, 2020 at 12:01:35 AM UTC+5:30, Murali Krishna Kanagala wrote:
Just drop a text file with data in Prometheus format and pass it as a command line arguments on your node exporter. 



On Sat, Mar 7, 2020, 11:01 AM Yagyansh S. Kumar <yagyans...@gmail.com> wrote:
Hi. I am just now able to get my head around the working of textfile collector. Can someone explain or provide a good link to understand its working?

Thanks!
--
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 promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/19715622-31e6-402e-8497-49448f6f0b95%40googlegroups.com.
--
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-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/71c47c5f-2c24-4714-a675-c3368b81086b%40googlegroups.com.


-- 
Stuart Clark

Murali Krishna Kanagala

unread,
Mar 7, 2020, 4:03:30 PM3/7/20
to Yagyansh S. Kumar, Prometheus Users
Also, did you try using the vmstat command line flag on node exporter? 

Brian Candler

unread,
Mar 8, 2020, 3:52:21 AM3/8/20
to Prometheus Users
The vmstat collector isn't anything to do with VMWare: it returns stats about the Linux virtual memory subsystem from /proc/vmstat.

$ curl ..../metrics | grep -i vmstat
...
node_scrape_collector_duration_seconds{collector="vmstat"} 0.000644674
node_scrape_collector_success{collector="vmstat"} 1
# HELP node_vmstat_oom_kill /proc/vmstat information field oom_kill.
# TYPE node_vmstat_oom_kill untyped
node_vmstat_oom_kill 0
# HELP node_vmstat_pgfault /proc/vmstat information field pgfault.
# TYPE node_vmstat_pgfault untyped
node_vmstat_pgfault 2.48255587e+09
# HELP node_vmstat_pgmajfault /proc/vmstat information field pgmajfault.
# TYPE node_vmstat_pgmajfault untyped
node_vmstat_pgmajfault 1.4914231e+07
# HELP node_vmstat_pgpgin /proc/vmstat information field pgpgin.
# TYPE node_vmstat_pgpgin untyped
node_vmstat_pgpgin 1.4020742e+08
# HELP node_vmstat_pgpgout /proc/vmstat information field pgpgout.
# TYPE node_vmstat_pgpgout untyped
node_vmstat_pgpgout 1.040636696e+09
# HELP node_vmstat_pswpin /proc/vmstat information field pswpin.
# TYPE node_vmstat_pswpin untyped
node_vmstat_pswpin 19131
# HELP node_vmstat_pswpout /proc/vmstat information field pswpout.
# TYPE node_vmstat_pswpout untyped
node_vmstat_pswpout 311500

For examples of exposing the software version as a prometheus label, see:


Murali Krishna Kanagala

unread,
Mar 8, 2020, 8:39:48 AM3/8/20
to Brian Candler, Prometheus Users
Good to know that vmstat is for a different purpose. 

--
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-use...@googlegroups.com.

Rishiraj khandelwal

unread,
Apr 14, 2020, 1:58:16 PM4/14/20
to Prometheus Users
Hi Stuart ,

Can you also suggest me which matric or exporter will be useful for the following scenario  where I wish to monitor my SIEBEL application component status and display them in different colors in grafana.

(Component_Name: EAI, Status : Online l ServerName: XNZ)
(Component_Name: WF, Status : Shutdown l ServerName: XNZ)
(Component_Name: JMS, Status : Online l ServerName: XNZ)

Thanks,
Rishi


On Sunday, 8 March 2020 01:47:55 UTC+5:30, Stuart Clark wrote:
On 07/03/2020 20:16, Yagyansh S. Kumar wrote:
Is it necessary that the output should be a float value? What if I want to scrape something else?
For eg. I want to scrape the version of VMWare-Tools running in the VM. I have stored that in a file in Prometheus format but I am getting the below error:
text format parsing error in line 1: expected float as value, got "'10.3.10.10540'"
The bold is the output that I need to push to prometheus.


Prometheus only deals in floats, but labels can be any string.

So for this case it's common to set the value to "1" and then have a "version" tag.


On Sunday, March 8, 2020 at 12:01:35 AM UTC+5:30, Murali Krishna Kanagala wrote:
Just drop a text file with data in Prometheus format and pass it as a command line arguments on your node exporter. 



On Sat, Mar 7, 2020, 11:01 AM Yagyansh S. Kumar <yagyans...@gmail.com> wrote:
Hi. I am just now able to get my head around the working of textfile collector. Can someone explain or provide a good link to understand its working?

Thanks!
--
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 promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/19715622-31e6-402e-8497-49448f6f0b95%40googlegroups.com.
--
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 promethe...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages