> do we have any existing node exporter which can read csv file?
No. But if you write a simple script to read the csv file and write it back out in openmetrics format, then you can use node_exporter's textfile collector. For example:
total_bytes{interface_name="abc"} 600
incoming_bytes{interface_name="abc"} 200
outgoing_bytes{interface_name="abc"} 400
error_bytes{interface_name="abc"} 10
invalid_bytes{interface_name="abc"} 0
rejected_bytes{interface_name="abc"} 20
But you should beware that:
1. Having different filenames for different times of day won't work. You should create a single metrics file which has the *current* values, and let prometheus scrape it periodically. It will timestamp the values with the scrape time. In general, you cannot import historical data into prometheus except as part of a one-time backfill operation.
2. You should not export the value which represents the counts from the last 5 minute period. Rather, you should record monotonically incrementing counters, i.e. the counter value which represents to *total* bytes since the system started up or was last reset.
If your data source can only generate individual counts per 5-minute period, then change your integration: use something like statsd_exporter to maintain the counts, and push data to statsd_exporter every accounting period. statsd_exporter will accumulate the values, and then get prometheus to scrape that.
If you're not prepared to do that, then prometheus is probably not the right system for you. Use a SQL database or similar instead.
> if not, any reference on how to write new node exporter?
Exporters simply respond to HTTP requests and return values in openmetrics format. There are client libraries available in many languages.