/prometheus-aas-router

Pushing machine's metric data into the Asset Administration Shell

Primary LanguageJava

Prometheus AAS Router

This Router App pushes data from Prometheus to the Asset Administation Shell, the Digital Twin Solution for Industry 4.0.

It is based on the AAS solution of Eclipse Basyx, the Basyx AAS Updater.

Note: This app is currently using a fork of said Basyx Updater, where the Prometheus component is already integrated. The integration to the upstream repository will follow soon.

The easiest way to try it out is by running the docker-compose stack containing the Router App.

Goal

Integrate device metric data, eg. performance metrics, in its digital twin representation: the Asset Administation Shell.

Requirements

Configuration

The Prometheus component, the AAS component, the Jsonata transformer, the timer as well as the route can be configured using the config files in the resource folder.

A detailed description of the configuration can be found in the project's docs.

Running in IDE

If all requirements are met, the app can be launched within the prefered IDE.

Building JAR

The aim of this project is to deploy the app within large environments of heterogeneous devices to monitor their current state. Building a fat JAR (JAR with dependencies integrated) allows for easy deployment on a large variety of devices, only requiring a java 8 runtime environment.

A mvn package command results in a jar, built with all dependencies within.

Running JAR

To run the JAR, place it inside a dir together with the config file folder. Building this JAR results in such a setup within the target folder by default. The JAR can be executed with
java -jar prometheus-updater-1.0-SNAPSHOT-jar-with-dependencies.jar

A minimal dir-setup in deployment would look like this:

prometheus-aas-router-example/
├── config
│   ├── aasserver.json
│   ├── jsonataA.json
│   ├── jsonatatransformer.json
│   ├── logback.xml
│   ├── prometheus.json
│   ├── routes.json
│   └── timerconsumer.json
└── prometheus-aas-router-1.0-SNAPSHOT-jar-with-dependencies.jar

Docker

Docker makes deployment even easier.

The Prometheus-AAS-Router app is available as Docker image on Docker Hub. Download the image using
docker pull n14s/prometheus-aas-router

Run the image by moving into the dir, where your config folder resides, and executing
docker run --network="host" -v $(pwd)/config:/app/config prometheus-aas-router:1.0.0

Docker Compose

A ready to run Docker Compose stack including the Prometheus-AAS-Router, Prometheus, Node exporter and the AAS-server can be found under
https://github.com/n14s/prometheus-aas-docker