Node prometheus export - Values from Temp sensors on Arduino

I'am using Node-Red V1.3.5 on Windows10.
I'am collecting values from a temperature sensor taken from Arduino.
Its easy to collect values from Serialport to Node-Red.
But I really can't understand how to configure "Node prometheus export" in way to export values later to prometheus.
If any anyone can give me some assistance, I will appreciate.
Thanks

I've putted a function, between Serial In (which receives values from Aduino,) and Prometheus Out, with the following code:


m={
"op": "set",
"val": parseInt(msg.payload),
"Labels": {
"tag_1": "Temp_Value"
}
}
return m


But a get error code from Prometheus node:
"Missing Payload or metric type gauge"

The node expects the data to be in msg.payload so probably you want

msg.payload = {
  "op": "set",
  "val": parseInt(msg.payload),
  "Labels": {
  "tag_1": "Temp_Value"
}
return msg

Perfect man ! It works.
(I'am new on this business)
Any way to clean all the "garbage" that i've writen on "localhost:1880/metrics" during my experiments ?

Do you mean delete stuff from the database? If so then no, I don't know anything about Prometheus.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.