Prometheus Adapter for HWiNFO (+ Grafana Dashboard)

Would be awfully nice if someone put together a basic guide on how to get any of this working.... I've got grafana, prometheus, promdapter, and hwinfo installed with shared memory support on... cannot figure out how to make any of it work together, but I have no metrics appearing in prometheus?

I've tried to set it up numerous times over the past few months and im getting nowhere
 
Would be awfully nice if someone put together a basic guide on how to get any of this working.... I've got grafana, prometheus, promdapter, and hwinfo installed with shared memory support on... cannot figure out how to make any of it work together, but I have no metrics appearing in prometheus?

I've tried to set it up numerous times over the past few months and im getting nowhere

You can split the task to three logical separated steps.

1. Setting up Prometheus and Grafana

This part is independent of the HWiNFO part, and you should get it running on without any additional parts. Prometheus publishes its own metrics that should be visible on Grafana as-is, so you can verify it works.

2. Setting up HWiNFO and PromDapter on the computer(s) to monitor

You can test that it's working initially on the computer itself from the URL:

You can then further test it by expanding from Prometheus computer with changing the localhost to according computer.

3. Setting up the Prometheus scraping to target that same url for each of the computer(s)

Prometheus will report the scrape results as succesful from the configuration page. After confirming it works, the stats should be immediately available on Grafana panel side.

If you say which parts you have problems with and which are working, we can then try to assist more on that part.
 
Much appreciated, I think the part I was missing was editing the Prometheus config to scrape localhost:10445

On to figuring out how to add metrics, I'm good with regex, but as you said earlier in the thread, its a pita.. I'm sure I'll figure it out eventually

Thanks for this!

Edit; would i need to edit the json config in order to add values aswell as a regex to match?
 
Last edited:
Much appreciated, I think the part I was missing was editing the Prometheus config to scrape localhost:10445

On to figuring out how to add metrics, I'm good with regex, but as you said earlier in the thread, its a pita.. I'm sure I'll figure it out eventually

Thanks for this!

Edit; would i need to edit the json config in order to add values aswell as a regex to match?

Actually it's C:\ProgramData\PromDapter\Prometheusmapping.yaml that needs to be edited. The default config should give you set of values and examples of how to get them.
 
Hi.

Thanks for the guide - I've managed to set up a dashboard which monitors 3 machines, individually showing the power draw of each machines GPU's, as well as the total power draw of them all combined. How can I calculate the total KWH? I've tried messing around with some transform fields but the numbers seem insane.

TIA
 
Hi.

Thanks for the guide - I've managed to set up a dashboard which monitors 3 machines, individually showing the power draw of each machines GPU's, as well as the total power draw of them all combined. How can I calculate the total KWH? I've tried messing around with some transform fields but the numbers seem insane.

TIA

Sorry for late reply. You can only calculate the estimated kWh based on some average over interval - or simpler by current values.

So you take the current power usage in Watts and divide it by 1000 (to get the kW). Then if you run that for an hour, there's your kWh for that specific load.

Daily kWh you get by multiplying then with 24 and yearly estimate kWh multiplaying that one with 365. So for my current three systems the formula for CPU + GPU usage is as following:

(sum(hwi_cpu_package_power_w) + sum(hwi_gpu_power_w))*24*365/1000

Then if you multiply that with your energy costs per kWH, you get the cost estimate graph from that. I'm not sure if I included that in the initial Grafana dashboard example that was downloadable. I can export my current one if that one was outdated.
 
Just note that summing of CPU and GPU power won't tell you the total system power as there are several other voltage/power rails which cannot be monitored.
 
Just note that summing of CPU and GPU power won't tell you the total system power as there are several other voltage/power rails which cannot be monitored.

True. On my system I have sources for PSU level (current load on mostly idle 142W) and the smart socket (around same time load 162W). So there's 10-20W of energy usage somewhere between socket and PSU reporting.
 
Sorry for late reply. You can only calculate the estimated kWh based on some average over interval - or simpler by current values.

So you take the current power usage in Watts and divide it by 1000 (to get the kW). Then if you run that for an hour, there's your kWh for that specific load.

Daily kWh you get by multiplying then with 24 and yearly estimate kWh multiplaying that one with 365. So for my current three systems the formula for CPU + GPU usage is as following:

(sum(hwi_cpu_package_power_w) + sum(hwi_gpu_power_w))*24*365/1000

Then if you multiply that with your energy costs per kWH, you get the cost estimate graph from that. I'm not sure if I included that in the initial Grafana dashboard example that was downloadable. I can export my current one if that one was outdated.
Thanks for this..! I'll give it a go :)


Just note that summing of CPU and GPU power won't tell you the total system power as there are several other voltage/power rails which cannot be monitored.
Yep, I appreciate that - just wanting to get a baseline usage.. they are all render servers so the 3090's are the by far the bulk of the power draw.
 
Hi! First off, thanks for the PromDapter, its great!

It looks like all temperature sensor values broke. It worked fine for me with HWiNFO 7.16, but not anymore with HWiNFO 7.22-4731.

The metrics are mangled, and Prometheus is unable to scrape with the error "help text is not a valid utf8 string"

Example of some metrics (all the temps are broken like this):

# HELP hwi_core_max_âc Core Max °C - CPU [#0]: Intel Core i7-12700KF: DTS
hwi_core_max_âc{unit="°C",sensor_type="SENSOR_TYPE_TEMP",sensor="Core Max",source="CPU [#0]: Intel Core i7-12700KF: DTS",host="mycomputer"} 35
# HELP hwi_cpu_âc CPU °C - GIGABYTE Z690 GAMING X DDR4 (ITE IT8689E)
hwi_cpu_âc{unit="°C",sensor_type="SENSOR_TYPE_TEMP",sensor="CPU",source="GIGABYTE Z690 GAMING X DDR4 (ITE IT8689E)",host="mycomputer"} 35
# HELP hwi_cpu_ia_cores_âc CPU IA Cores °C - CPU [#0]: Intel Core i7-12700KF: Enhanced
hwi_cpu_ia_cores_âc{unit="°C",sensor_type="SENSOR_TYPE_TEMP",sensor="CPU IA Cores",source="CPU [#0]: Intel Core i7-12700KF: Enhanced",host="mycomputer"} 36
# HELP hwi_cpu_package_âc CPU Package °C - (multiple sources)
hwi_cpu_package_âc{unit="°C",sensor_type="SENSOR_TYPE_TEMP",sensor="CPU Package",source="CPU [#0]: Intel Core i7-12700KF: DTS",host="mycomputer"} 35
hwi_cpu_package_âc{unit="°C",sensor_type="SENSOR_TYPE_TEMP",sensor="CPU Package",source="CPU [#0]: Intel Core i7-12700KF: Enhanced",host="mycomputer"} 36
 
Hi! First off, thanks for the PromDapter, its great!

It looks like all temperature sensor values broke. It worked fine for me with HWiNFO 7.16, but not anymore with HWiNFO 7.22-4731.

The metrics are mangled, and Prometheus is unable to scrape with the error "help text is not a valid utf8 string"

Example of some metrics (all the temps are broken like this):

# HELP hwi_core_max_âc Core Max °C - CPU [#0]: Intel Core i7-12700KF: DTS
hwi_core_max_âc{unit="°C",sensor_type="SENSOR_TYPE_TEMP",sensor="Core Max",source="CPU [#0]: Intel Core i7-12700KF: DTS",host="mycomputer"} 35
# HELP hwi_cpu_âc CPU °C - GIGABYTE Z690 GAMING X DDR4 (ITE IT8689E)
hwi_cpu_âc{unit="°C",sensor_type="SENSOR_TYPE_TEMP",sensor="CPU",source="GIGABYTE Z690 GAMING X DDR4 (ITE IT8689E)",host="mycomputer"} 35
# HELP hwi_cpu_ia_cores_âc CPU IA Cores °C - CPU [#0]: Intel Core i7-12700KF: Enhanced
hwi_cpu_ia_cores_âc{unit="°C",sensor_type="SENSOR_TYPE_TEMP",sensor="CPU IA Cores",source="CPU [#0]: Intel Core i7-12700KF: Enhanced",host="mycomputer"} 36
# HELP hwi_cpu_package_âc CPU Package °C - (multiple sources)
hwi_cpu_package_âc{unit="°C",sensor_type="SENSOR_TYPE_TEMP",sensor="CPU Package",source="CPU [#0]: Intel Core i7-12700KF: DTS",host="mycomputer"} 35
hwi_cpu_package_âc{unit="°C",sensor_type="SENSOR_TYPE_TEMP",sensor="CPU Package",source="CPU [#0]: Intel Core i7-12700KF: Enhanced",host="mycomputer"} 36

Check this: https://www.hwinfo.com/forum/threads/prometheus-adapter-for-hwinfo-grafana-dashboard.6281/post-34262
 
True. On my system I have sources for PSU level (current load on mostly idle 142W) and the smart socket (around same time load 162W). So there's 10-20W of energy usage somewhere between socket and PSU reporting.
I would like to do that too, how do I have to edit the Prometheusmapping.yaml to include my psu metric? And, more broadly, how can I manage to add every sensor I wish to the config? I don't know the value name that matches a certain sensor like (?<Entity>CPU) for cpu sensor, how do I extract that? Thank you
 
Hi, thanks for the awesome work!

I have an Aquacomputer Octo and I can see the values reported from it in HWiNFO under a grouping titled "Aquacomputer Octo" and I'm trying to modify the yaml file to include sensor items from the Octo in the prometheus feed. Here is what I have tried to get a temperature sensor included:

YAML:
    # Octo
    - '(?<Entity>Aquacomputer_Octo) (?<MetricName>Temperature 1)'

    # Octo
    - '(?<Entity>Aquacomputer Octo) (?<MetricName>Temperature 1)'

I have also noticed that some items in the yaml file are <Entity>CPU and some are <Entity_CPU> I looked at the list of sensors in HWiNFO and can't seem to figure out why some items are the first way and others are the second way. (Apologies if this has been covered in the thread, I scanned stuff but didn't see it.)
 
Hello, I would like help if possible, I need to monitor some servers... Some on Windows and others on linux but anyway, let's go for the easiest for me that is Windows...

Is there any tutorial on how I can do these monitoring services via the web using this tool? I'm not from the area as I see many here who know a lot, I just need to monitor these machines I mentioned, I have a very comprehensive knowledge but not with the languages I saw here.

Thanks in advance.
 
Hello, I would like help if possible, I need to monitor some servers... Some on Windows and others on linux but anyway, let's go for the easiest for me that is Windows...

Is there any tutorial on how I can do these monitoring services via the web using this tool? I'm not from the area as I see many here who know a lot, I just need to monitor these machines I mentioned, I have a very comprehensive knowledge but not with the languages I saw here.

Thanks in advance.

Sorry for late reply. Had forgotten the post notification and thus forgot to reply.

I'm introducing the WMI (Windows Management Instrumentation) support to PromDapter very soon. That lead me to consider also testing and refining the Grafana alerts for exactly that; server state monitoring.

If you can describe your needs a bit more in detail, ie. the number of servers, the things to monitor and the need of alerts, we could together see if this stack is suitable for that.
 
I would like to do that too, how do I have to edit the Prometheusmapping.yaml to include my psu metric? And, more broadly, how can I manage to add every sensor I wish to the config? I don't know the value name that matches a certain sensor like (?<Entity>CPU) for cpu sensor, how do I extract that? Thank you

There's the "catch all" phrase described, that I don't recall now off my head. You can use that to get the raw version of ALL the metrics and then refine the Entity etc categorizing off that. I'll get to this asap again, sorry for late reply.
 
Hi, thanks for the awesome work!

I have an Aquacomputer Octo and I can see the values reported from it in HWiNFO under a grouping titled "Aquacomputer Octo" and I'm trying to modify the yaml file to include sensor items from the Octo in the prometheus feed. Here is what I have tried to get a temperature sensor included:

YAML:
    # Octo
    - '(?<Entity>Aquacomputer_Octo) (?<MetricName>Temperature 1)'

    # Octo
    - '(?<Entity>Aquacomputer Octo) (?<MetricName>Temperature 1)'

I have also noticed that some items in the yaml file are <Entity>CPU and some are <Entity_CPU> I looked at the list of sensors in HWiNFO and can't seem to figure out why some items are the first way and others are the second way. (Apologies if this has been covered in the thread, I scanned stuff but didn't see it.)

The Entity_CPU ones are the ones, where there is no CPU in the metricname to recognize/grab the value from. The Entity - tag is when there is CPU in the text to recognize. So in your case it would be Entity_CPU, as/if you want to categorize them "under" CPU when there is no CPU in the "Aquacomputer Octo" name.
 
Added WMI support for the newest beta.

NOTE! JSON support is broken in this version, so if you're relying on it and want to use WMI, please let me know and I hurry up the fix for this version. Otherwise just stick with the earlier release for now.

Example configuration added to the bottom of the config file. The "source" is the WMI class name, "ids" is the list of fields that uniquely identify the set, as every property is it's own value for Prometheus. For limiting the results "values" collection is added for property + unit pairs. If "values" is not given, select * is used for query, returning all the properties, which might be quite a bit of data for example for processes.

YAML:
wmiService:
  sources:
  - source: Win32_Process
    ids:
    - Name
    - ProcessId
    values:
    - name: ThreadCount
  - source: Win32_LogicalDisk
    name: Disk
    ids:
    - DeviceID
    values:
    - name: Size
      unit: Byte
    - name: FreeSpace
      unit: Byte
  - source: Win32_PerfFormattedData_PerfProc_Process
    name: Process
    ids:
    - Name
    values:
    - name: WorkingSetPrivate
      unit: Byte

I plan to add flexible config editor for running dynamic WMI queries and testing them out and being able to pick the ids and values collections from the resulted properties.
 
Back
Top