From 85078163335c50e710a4aec22bc8d90dd8354396 Mon Sep 17 00:00:00 2001 From: Ralph Soika Date: Sun, 31 Aug 2025 17:34:05 +0200 Subject: [PATCH] integration Imixs Metrics --- .../prometheus/imixs-dashboard.json | 474 ++++++++++++++++++ .../imixs-office-workflow-1552316781753.json | 291 +++++++++++ .../configuration/prometheus/prometheus.yml | 22 + docker/docker-compose-dev.yaml | 62 ++- docker/docker-compose-metrics.yaml | 52 ++ dynamixs-ai-app/pom.xml | 6 + dynamixs-ai-rag/pom.xml | 7 +- pom.xml | 9 + 8 files changed, 901 insertions(+), 22 deletions(-) create mode 100644 docker/configuration/prometheus/imixs-dashboard.json create mode 100644 docker/configuration/prometheus/imixs-office-workflow-1552316781753.json create mode 100644 docker/configuration/prometheus/prometheus.yml create mode 100644 docker/docker-compose-metrics.yaml diff --git a/docker/configuration/prometheus/imixs-dashboard.json b/docker/configuration/prometheus/imixs-dashboard.json new file mode 100644 index 0000000..a4b07cd --- /dev/null +++ b/docker/configuration/prometheus/imixs-dashboard.json @@ -0,0 +1,474 @@ +{ + "__inputs": [ + { + "name": "DS_PROMETHEUS", + "label": "Prometheus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "7.1.0" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": null, + "links": [], + "panels": [ + { + "datasource": "${DS_PROMETHEUS}", + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 0, + "y": 0 + }, + "id": 8, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "7.1.0", + "targets": [ + { + "expr": "count(application_workitems_total{ job='imixs'})", + "hide": false, + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Active Workflows", + "type": "stat" + }, + { + "datasource": "${DS_PROMETHEUS}", + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 4, + "y": 0 + }, + "id": 12, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "7.1.0", + "targets": [ + { + "expr": "count(application_workitems_total{ job='imixs'})", + "hide": false, + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Active Models", + "type": "stat" + }, + { + "datasource": "${DS_PROMETHEUS}", + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 8, + "y": 0 + }, + "id": 11, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "7.1.0", + "targets": [ + { + "expr": "application_transactions_total", + "hide": false, + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Total Transactions", + "type": "stat" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "decimals": null, + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 3 + }, + "hiddenSeries": false, + "id": 4, + "legend": { + "alignAsTable": true, + "avg": true, + "current": false, + "max": true, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.0", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum by (workflowgroup) (sum_over_time(application_workitems_total[1m]))", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{workflowgroup}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Workflow Transactions", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 11 + }, + "hiddenSeries": false, + "id": 2, + "legend": { + "alignAsTable": true, + "avg": true, + "current": false, + "max": true, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.0", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum by (method) (rate(application_documents_total[5m]))", + "format": "time_series", + "hide": false, + "instant": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{method}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Data Transactions", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": null, + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": false, + "schemaVersion": 26, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "imixs-office-workflow", + "uid": "RI5UNGPiz", + "version": 2 +} \ No newline at end of file diff --git a/docker/configuration/prometheus/imixs-office-workflow-1552316781753.json b/docker/configuration/prometheus/imixs-office-workflow-1552316781753.json new file mode 100644 index 0000000..03207a9 --- /dev/null +++ b/docker/configuration/prometheus/imixs-office-workflow-1552316781753.json @@ -0,0 +1,291 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 1, + "links": [], + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "imixs-office-workflow", + "fill": 1, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 2, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum by (method) (rate(documents_total[5m]))", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Documents", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "transparent": false, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": null, + "fill": 1, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 4, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum by (workflowgroup) (sum_over_time(workitems_processed_total[1m]))", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "{{workflowgroup}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Workflows", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "cards": { + "cardPadding": null, + "cardRound": null + }, + "color": { + "cardColor": "#b4ff00", + "colorScale": "sqrt", + "colorScheme": "interpolateOranges", + "exponent": 0.5, + "mode": "spectrum" + }, + "dataFormat": "timeseries", + "datasource": null, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 9 + }, + "heatmap": {}, + "highlightCards": true, + "id": 6, + "legend": { + "show": false + }, + "links": [], + "targets": [ + { + "expr": "rate(workitems_processed_total[5m])", + "format": "heatmap", + "intervalFactor": 1, + "refId": "A" + } + ], + "title": "Workflow Processing Heat Map", + "tooltip": { + "show": true, + "showHistogram": false + }, + "type": "heatmap", + "xAxis": { + "show": true + }, + "xBucketNumber": null, + "xBucketSize": null, + "yAxis": { + "decimals": null, + "format": "short", + "logBase": 1, + "max": null, + "min": null, + "show": true, + "splitFactor": null + }, + "yBucketBound": "auto", + "yBucketNumber": null, + "yBucketSize": null + } + ], + "refresh": false, + "schemaVersion": 16, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "2019-03-11T14:47:07.483Z", + "to": "2019-03-11T14:53:39.050Z" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "imixs-office-workflow", + "uid": "RI5UNGPiz", + "version": 10 +} diff --git a/docker/configuration/prometheus/prometheus.yml b/docker/configuration/prometheus/prometheus.yml new file mode 100644 index 0000000..d36101a --- /dev/null +++ b/docker/configuration/prometheus/prometheus.yml @@ -0,0 +1,22 @@ +global: + scrape_interval: 15s # By default, scrape targets every 15 seconds. + + # Attach these labels to any time series or alerts when communicating with + # external systems (federation, remote storage, Alertmanager). + external_labels: + monitor: 'imixs-monitor' + +scrape_configs: + # Prometheus itself + - job_name: 'prometheus' + scrape_interval: 5s + static_configs: + - targets: ['localhost:9090'] + + + # Imixs-Office-Workflow Job (Wildfly Metrics) + - job_name: 'imixs' + scrape_interval: 5s + metrics_path: /metrics + static_configs: + - targets: ['app:9990'] \ No newline at end of file diff --git a/docker/docker-compose-dev.yaml b/docker/docker-compose-dev.yaml index e78e0a0..0eb092d 100644 --- a/docker/docker-compose-dev.yaml +++ b/docker/docker-compose-dev.yaml @@ -27,6 +27,9 @@ services: MAILGATEWAY: "localhost" ASYNCEVENT_PROCESSOR_ENABLED: "true" ASYNCEVENT_PROCESSOR_INITIALDELAY: "30000" + # Metrics + METRICS_ENABLED: "true" + # OCR OCR_SERVICE_ENDPOINT: "http://tika:9998/tika" OCR_SERVICE_MODE: "MODEL" #OCR_STRATEGY: "NO_OCR, OCR_ONLY, OCR_AND_TEXT_EXTRACTION, AUTO (default)" @@ -37,9 +40,6 @@ services: WOPI_HOST_ENDPOINT: "http://imixs-documents:8080/api/wopi/" COLLABORA_CONVERTER_URL: "http://collabora:9980/lool/convert-to/" - # Imixs-Archive - # ARCHIVE_SERVICE_ENDPOINT: "http://imixs-archive:8080/api" - # Imixs-AI # Optional configured via imixs.properties LLM_SERVICE_ENDPOINT: "https://llama.cpp.imixs.com/" @@ -102,30 +102,50 @@ services: ####################### # collabora Office Online ####################### - collabora: - image: collabora/code:23.05.0.5.1 - #expose: - # - 9980 - ports: - - "9980:9980" - environment: - - username=admin - - password=adminadmin - - extra_params=--o:ssl.enable=false - - aliasgroup1=http://imixs-documents:8080 - volumes: - - ./configuration/collabora/fonts:/usr/share/fonts/truetype/more/ - - ./configuration/collabora/fonts:/opt/cool/systemplate/usr/share/fonts/truetype/more/ + # collabora: + # image: collabora/code:23.05.0.5.1 + # #expose: + # # - 9980 + # ports: + # - "9980:9980" + # environment: + # - username=admin + # - password=adminadmin + # - extra_params=--o:ssl.enable=false + # - aliasgroup1=http://imixs-documents:8080 + # volumes: + # - ./configuration/collabora/fonts:/usr/share/fonts/truetype/more/ + # - ./configuration/collabora/fonts:/opt/cool/systemplate/usr/share/fonts/truetype/more/ ####################### # Imixs Admin Client ####################### - imixsadmin: - image: imixs/imixs-admin - ports: - - "8888:8080" + # imixsadmin: + # image: imixs/imixs-admin + # ports: + # - "8888:8080" + + + + + + # prometheus: + # image: prom/prometheus:latest + # ports: + # - "9090:9090" + # volumes: + # - ./configuration/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml + # - prometheusdata:/prometheus/ + + + # grafana: + # image: grafana/grafana:7.1.0 + # ports: + # - "3000:3000" + volumes: dbdata-hai: dbkeycloak: cassandra_data: + prometheusdata: \ No newline at end of file diff --git a/docker/docker-compose-metrics.yaml b/docker/docker-compose-metrics.yaml new file mode 100644 index 0000000..4a74abc --- /dev/null +++ b/docker/docker-compose-metrics.yaml @@ -0,0 +1,52 @@ +version: "3.1" +services: + + db: + image: postgres:9.6.1 + environment: + POSTGRES_PASSWORD: adminadmin + POSTGRES_DB: office + volumes: + - dbdata:/var/lib/postgresql/data + app: + image: imixs/imixs-office-workflow + depends_on: + - db + environment: + TZ: "Europe/Berlin" + JAVA_OPTS: "-Dnashorn.args=--no-deprecation-warning" + MAILGATEWAY: "localhost" + POSTGRES_USER: "postgres" + POSTGRES_PASSWORD: "adminadmin" + POSTGRES_CONNECTION: "jdbc:postgresql://db/office" + METRICS_ENABLED: "true" + ports: + - "8080:8080" + - "9990:9990" + - "8787:8787" + volumes: + - ./deployments:/opt/jboss/wildfly/standalone/deployments/ + +# imixsadmin: +# image: imixs/imixs-admin +# ports: +# - "8888:8080" + + prometheus: + image: prom/prometheus:latest + ports: + - "9090:9090" + volumes: + - ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml + - prometheusdata:/prometheus/ + + + grafana: + image: grafana/grafana:7.1.0 + ports: + - "3000:3000" + + +volumes: + prometheusdata: + dbdata: diff --git a/dynamixs-ai-app/pom.xml b/dynamixs-ai-app/pom.xml index 67e65b5..7c33131 100644 --- a/dynamixs-ai-app/pom.xml +++ b/dynamixs-ai-app/pom.xml @@ -266,6 +266,12 @@ imixs-marty + + + org.imixs.workflow + imixs-metrics-monitor + + org.imixs.workflow diff --git a/dynamixs-ai-rag/pom.xml b/dynamixs-ai-rag/pom.xml index 6b0b659..7ed471f 100644 --- a/dynamixs-ai-rag/pom.xml +++ b/dynamixs-ai-rag/pom.xml @@ -137,6 +137,11 @@ ${apache.cassandra.driver.version} - + \ No newline at end of file diff --git a/pom.xml b/pom.xml index d80e433..a0d67f4 100644 --- a/pom.xml +++ b/pom.xml @@ -63,6 +63,7 @@ 10.0.0 6.0 + 6.2.3-SNAPSHOT 3.1.3-SNAPSHOT 1.0.0-SNAPSHOT @@ -70,6 +71,7 @@ 5.0.3 3.0.1 1.1.2-SNAPSHOT + 1.0.0-SNAPSHOT 1.0.0 9.9.1-4 2.0.24 @@ -253,6 +255,13 @@ ${org.imixs.archive.version} + + + org.imixs.workflow + imixs-metrics-monitor + ${org.imixs.metrics.version} + + org.apache.pdfbox