One easy way might be to utilise the Textfile Collector, which is part of
the Node Exporter, and allows you to expose files on your system for
collection by Prometheus.

In this case, you would need to write some kind of script that reads your
statistics files, then spits out textfile that contains the metrics, and
Node exporter will then serve them.

You can find example scripts here
<https://github.com/prometheus-community/node-exporter-textfile-collector-scripts>
that will give you examples of how to create the text file.

On Fri, Dec 13, 2024 at 8:26 PM Navjyot Ramteke <navjyot.ramt...@gmail.com>
wrote:

> Hi All,
>           We have a process which periodically writes all the stats into a
> CSV file in one folder(in linux virtual machine). The name of the file will
> contain the date and timestamp to distinguish different files.
>
> folder contents:
> stats_13_12_12_00.csv >>> 13th dec, 12 am
> stats_13_12_12_05.csv
> stats_13_12_12_10.csv
> stats_13_12_12_15.csv
> stats_13_12_12_20.csv
> stats_13_12_12_25.csv
>
> in this example, our process will keep writing new file every 5 min. so
> next file will be written at time 12:30.
> the format of the file is given below.
>
> csv file format:
> 720,500,300,10,"abc",0,,120
>
> this file will contains values corresponding to various stats. the
> ordering is fixed.
> in this example
> total_bytes = 720
> input_bytes =  500
> output_bytes = 300
> dropped_bytes =  10
> interface_name = abc
> error_count = 0
> invalid_pkt =  <not applicable. hence its value is NULL>
> charged_bytes = 120
>
> we will have 3000-5000 such variables in each file.
> Now we wanted to fed these variables in Prometheus so that it can be
> viewed on Grafana.
> is there any existing exporter which we can use it?
> if no, can we enhance some existing exporter?
> else any help in writing exporter from scratch.
>
>
> Regards
> Navjyot.
>
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Prometheus Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to prometheus-developers+unsubscr...@googlegroups.com.
> To view this discussion visit
> https://groups.google.com/d/msgid/prometheus-developers/0607f0e7-201a-4b8c-b286-a39648bbb1f5n%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-developers/0607f0e7-201a-4b8c-b286-a39648bbb1f5n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prometheus-developers+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/prometheus-developers/CABaapw%2Bmo0QTcmEmxh3BtKq%2B-r1u4rPAMbYgMbww%3DOKgCOZ9Vw%40mail.gmail.com.

Reply via email to