prometheus-community / windows_exporter

Prometheus exporter for Windows machines
MIT License
2.78k stars 675 forks source link

can read custom files TEXTFILE_DIRS="C:\custom_metrics\" #1461

Open morshaq opened 2 months ago

morshaq commented 2 months ago

I'm encountering an issue with the Prometheus Windows Exporter where metrics aren't being scraped despite configuring the exporter with specific collectors and providing custom metric files.

Here's the command I'm using to install and configure the exporter:

msiexec /i C:\Users\Administrator\Downloads\windows_exporter.msi ENABLED_COLLECTORS="ad,iis,logon,memory,process,tcp,textfile,thermalzone" TEXTFILE_DIRS="C:\custom_metrics\" I've also tried specifying the full path to the custom metric file like so:

C:\custom_metrics\custom.txt However, even after adding files to the specified directory and ensuring their accessibility, none of the metrics are appearing in the Prometheus scraping.

Could you please assist me in resolving this issue and ensuring that the Prometheus Windows Exporter correctly scrapes the specified metrics?

jkroepke commented 2 months ago

Sure, please provides logs from event log

morshaq commented 2 months ago

cant find anything in event viewer . can you please share with me a command that can read a log.txt file and collect memory and process ?

jkroepke commented 2 months ago

log file isn't supported

morshaq commented 2 months ago

Is there a way I can collect default collector data and get custom data from a text file? How can I get data that is not in the default collectors, and what is TEXTFILE_DIRS used for?

jkroepke commented 2 months ago

You can use the textfile collector to collect metrics from a text file. Ensure that the text file has the OpenMetrics format