scross01 / prometheus-klipper-exporter

Prometheus Exporter for Klipper
MIT License
51 stars 11 forks source link

add `temperature_sensor` metrics to `printer_objects` module #3

Closed scross01 closed 2 years ago

scross01 commented 2 years ago

Add metric collection for custom temperature_sensor objects.

https://moonraker.readthedocs.io/en/latest/printer_objects/

temperature_sensor sensor_name

Enabled when [temperature_sensor sensor_name] is included in printer.cfg. It is possible for multiple temperature sensors to be configured.


{
    "temperature": 0.0,
    "measured_min_temp": 0.0,
    "measured_max_temp": 0.0
}
`
A temperature_sensor reports the following state:
`temperature`: Sensor's current reported temperature
`measured_min_temp`: The mimimum temperature read from the sensor
`measured_max_temp`: The maximum temperature read from the sensor
Ramalama2 commented 2 years ago

@scross01 Sry to nerv again, may i ask how exactly i can add my own cutom temperature sensor? I mean sth like an example? I have 4 Frame sensors / Chamber sensor etc...

scrape_configs:

  - job_name: "voron2"
    scrape_interval: 5s
    metrics_path: /probe
    static_configs:
      - targets: [ 'voron2.user.mwpp.eu:7125' ]
    params:
      modules: [ "process_stats", "job_queue", "system_info", "network_stats", "directory_info", "printer_objects" ]
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: docker.mwpp.eu:9101

  # optional exporter metrics
  - job_name: "klipper-exporter"
    scrape_interval: 5s
    metrics_path: /metrics
    static_configs:
      - targets: [ 'docker.mwpp.eu:9101' ]

Thats the example config im using :-)

For the moment i could replace printer_objects with temperature, just then i would miss some things :-(

Thank you!

scross01 commented 2 years ago

Release v0.6.0 adds support for temperature_sensor, temperate_fan, and output_pin metrics