Summary
Create a Prometheus exporter that reads PLC values and exposes them as Prometheus metrics, enabling integration with Grafana and modern monitoring stacks.
Background
A very common use case in IIoT (Industrial Internet of Things) is monitoring PLC values in Grafana dashboards. Currently users must build custom scripts to bridge PLC data to Prometheus. A built-in exporter would serve this use case out of the box.
What needs to be done
Example Configuration
plcs:
- name: plc_line1
host: 192.168.1.10
rack: 0
slot: 1
metrics:
- name: motor_speed_rpm
type: gauge
area: DB
db: 1
offset: 0
datatype: real
help: "Motor speed in RPM"
- name: tank_level_percent
type: gauge
area: DB
db: 1
offset: 4
datatype: real
help: "Tank level percentage"
exporter:
port: 9400
poll_interval: 5
Notes
- This could be a separate package (
python-snap7-exporter) or an extra in this repo
- Should support both pull (HTTP endpoint) and optionally push (Pushgateway) modes
- Consider also supporting OpenTelemetry metrics as an alternative
- Labels should include PLC name, IP, and any user-defined labels
Summary
Create a Prometheus exporter that reads PLC values and exposes them as Prometheus metrics, enabling integration with Grafana and modern monitoring stacks.
Background
A very common use case in IIoT (Industrial Internet of Things) is monitoring PLC values in Grafana dashboards. Currently users must build custom scripts to bridge PLC data to Prometheus. A built-in exporter would serve this use case out of the box.
What needs to be done
prometheus_clientlibrary for metrics expositionpip install python-snap7[prometheus]snap7 export --config metrics.yamlExample Configuration
Notes
python-snap7-exporter) or an extra in this repo