OPC UA exporter for Prometheus written in Python using opcua-asyncio and prometheus-client. Based on prometheus_opcua_exporter.
- Can read values of multiple nodes from multiple OPC UA servers.
- Publishes values as Prometheus metrics (gauge type).
- Returns NaN in case of errors.
- Can be run as a container.
Clone this repository and install required libraries:
pip3 install -r requirements.txt
Adjust config.yaml to your needs and run the exporter with
python3 exporter.py
Prometheus metrics will then be available at http://localhost:9840/.
Build Docker image:
docker build -t prometheus_asyncua_exporter .
Edit config.yaml
and start the container:
docker run -v ./config.yaml:/app/config.yaml -p 9101:9840 prometheus_asyncua_exporter
Or pull the pre-built package:
docker run -v ./config.yaml:/app/config.yaml -p 9101:9840 ghcr.io/ainglessi/prometheus_asyncua_exporter
Prometheus metrics will then be available at http://localhost:9101/.
This software is distributed under Apache License 2.0.