~sirn/aquacomputer-mqtt-exporter

Export Aquacomputer MQTT payload as Prometheus metrics
Make functions private
Prune stale data every given interval

clone

read-only
https://git.sr.ht/~sirn/aquacomputer-mqtt-exporter
read/write
git@git.sr.ht:~sirn/aquacomputer-mqtt-exporter

You can also use your local clone with git send-email.

#Aquacomputer MQTT Exporter

Export Aquacomputer MQTT payload as Prometheus metrics.

#Usage

$ podman run -p 9110:9110 -v "./config.toml:/config.toml" --rm -it docker.io/sirn/aquacomputer-mqtt-exporter

For configuration options, see config.sample.toml.

Configure Prometheus to scrape from this endpoint:

scrape_configs:
  - job_name: "aquacomputer"
    scrape_interval: 15s
    static_configs:
      - targets: ["localhost:9110"]

#Example

This program turns this message:

{
  "Id": "47f11ea4-ce83-42f0-950a-e980ebdc47bc",
  "Topic": "aquacomputer/temp_celsius/terra",
  "Title": "temp_celsius",
  "Message": "",
  "Data": [
    {
      "Name": "Intake Temp.",
      "Id": "data\\temperatures\\0",
      "Unit": "°C",
      "Value": 23.65
    },
    {
      "Name": "Case Temp.",
      "Id": "data\\temperatures\\1",
      "Unit": "°C",
      "Value": 35.05
    },
    {
      "Name": "Delta Temp.",
      "Id": "data\\temperatures\\24",
      "Unit": "°C",
      "Value": 10.31
    },
    {
      "Name": "Coolant Avg. Temp.",
      "Id": "data\\temperatures\\26",
      "Unit": "°C",
      "Value": 33.96
    },
    {
      "Name": "Highflow Temp.",
      "Id": "data\\temperatures\\29",
      "Unit": "°C",
      "Value": 34.7
    },
    {
      "Name": "Pump Temp.",
      "Id": "data\\temperatures\\36",
      "Unit": "°C",
      "Value": 33.23
    }
  ]
}

Into:

aquacomputer_temp_celsius{device="terra",name="Case Temp.",sensor="data\\temperatures\\1"} 35.05
aquacomputer_temp_celsius{device="terra",name="Coolant Avg. Temp.",sensor="data\\temperatures\\26"} 33.96
aquacomputer_temp_celsius{device="terra",name="Delta Temp.",sensor="data\\temperatures\\24"} 10.31
aquacomputer_temp_celsius{device="terra",name="Highflow Temp.",sensor="data\\temperatures\\29"} 34.7
aquacomputer_temp_celsius{device="terra",name="Intake Temp.",sensor="data\\temperatures\\0"} 23.65
aquacomputer_temp_celsius{device="terra",name="Pump Temp.",sensor="data\\temperatures\\36"} 33.23