diff --git a/resources/grafana/MainDashboard.json b/resources/grafana/MainDashboard.json new file mode 100644 index 0000000000..82201440bd --- /dev/null +++ b/resources/grafana/MainDashboard.json @@ -0,0 +1,449 @@ +{ + "__inputs": [ + { + "name": "DS_PROMETHEUS-PM-SPRING-2025", + "label": "prometheus-pm-spring-2025", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "panel", + "id": "barchart", + "name": "Bar chart", + "version": "" + }, + { + "type": "panel", + "id": "bargauge", + "name": "Bar gauge", + "version": "" + }, + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "11.4.0" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "Different metrics from ProcessMaker", + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": null, + "links": [], + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + }, + "description": "Visual representation of cache performance showing the hit and miss rates for screens.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 1, + "options": { + "displayMode": "gradient", + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "maxVizHeight": 300, + "minVizHeight": 16, + "minVizWidth": 8, + "namePlacement": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showUnfilled": true, + "sizing": "auto", + "valueMode": "color" + }, + "pluginVersion": "11.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + }, + "disableTextWrap": false, + "editorMode": "code", + "expr": "max(processmaker_cache_hits_total{cache_key=~\"pid_.*\"})", + "fullMetaSearch": false, + "includeNullMetadata": true, + "legendFormat": "Hits", + "range": true, + "refId": "A", + "useBackend": false + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + }, + "disableTextWrap": false, + "editorMode": "code", + "expr": "max(processmaker_cache_misses_total{cache_key=~\"pid_.*\"})", + "fullMetaSearch": false, + "hide": false, + "includeNullMetadata": true, + "instant": false, + "legendFormat": "Misses", + "range": true, + "refId": "B", + "useBackend": false + } + ], + "title": "Screen Cache Hit/Miss Rates", + "type": "bargauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + }, + "description": "Visual representation of cache performance showing the hit and miss rates for settings.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 2, + "options": { + "displayMode": "gradient", + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "maxVizHeight": 300, + "minVizHeight": 16, + "minVizWidth": 8, + "namePlacement": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showUnfilled": true, + "sizing": "auto", + "valueMode": "color" + }, + "pluginVersion": "11.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + }, + "disableTextWrap": false, + "editorMode": "code", + "expr": "max(processmaker_cache_hits_total{cache_key=~\"setting_.*\"})", + "fullMetaSearch": false, + "includeNullMetadata": true, + "legendFormat": "Hits", + "range": true, + "refId": "A", + "useBackend": false + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + }, + "disableTextWrap": false, + "editorMode": "code", + "expr": "max(processmaker_cache_misses_total{cache_key=~\"setting_.*\"})", + "fullMetaSearch": false, + "hide": false, + "includeNullMetadata": true, + "instant": false, + "legendFormat": "Misses", + "range": true, + "refId": "B", + "useBackend": false + } + ], + "title": "Settings Cache Hit/Miss Rates", + "type": "bargauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + }, + "description": "Visual representation of cache performance showing the hit and miss rates for screens.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 8 + }, + "id": 3, + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "sum" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" + }, + "pluginVersion": "11.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + }, + "disableTextWrap": false, + "editorMode": "code", + "expr": "topk(5, processmaker_cache_memory_bytes{label=~\"screen.*\"})", + "fullMetaSearch": false, + "includeNullMetadata": true, + "interval": "", + "legendFormat": "{{label}}", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "Screen Cache Sizes", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + }, + "description": "Visual representation of cache performance showing the hit and miss rates for screens.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-blues" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 8 + }, + "id": 4, + "interval": "30m", + "options": { + "barRadius": 0, + "barWidth": 0.97, + "fullHighlight": false, + "groupWidth": 0.7, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "orientation": "auto", + "showValue": "auto", + "stacking": "none", + "tooltip": { + "mode": "single", + "sort": "none" + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 0 + }, + "pluginVersion": "11.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS-PM-SPRING-2025}" + }, + "disableTextWrap": false, + "editorMode": "code", + "expr": "sum(processmaker_activity_completed_total)", + "fullMetaSearch": false, + "includeNullMetadata": true, + "legendFormat": "Tasks completed", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "Tasks Completed", + "type": "barchart" + } + ], + "schemaVersion": 40, + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-3h", + "to": "now" + }, + "timepicker": {}, + "timezone": "browser", + "title": "ProcessMaker Dashboard", + "uid": "be96wxsnlmn7kc", + "version": 23, + "weekStart": "" +} \ No newline at end of file diff --git a/resources/grafana/README.md b/resources/grafana/README.md new file mode 100644 index 0000000000..321b955331 --- /dev/null +++ b/resources/grafana/README.md @@ -0,0 +1,44 @@ +# Grafana Dashboards + +This folder contains exported JSON files of Grafana dashboards. Each JSON file represents a configured dashboard that can be imported into Grafana to visualize metrics and data. + +## 📁 Folder Contents + +- **Dashboard JSON Files**: These files contain the configuration of various Grafana dashboards. Each file is a snapshot of a Grafana dashboard, including its panels, data sources, and visualizations. +- Example: `MainDashboard.json` – A JSON file for monitoring cache hit/miss rates. + +--- + +## 🔄 How to Import a Dashboard to Grafana + +Follow these steps to import any of the dashboards from this folder into your Grafana instance: + +### 1. Open Grafana +- Log in to your Grafana instance. + +### 2. Go to Import Dashboard +- From the left-hand menu, select **Dashboards**. +- On the top right, click **+ Plus button** > **Import Dashboard**. + +### 3. Upload the JSON File +- **Option 1**: Click **Upload JSON file** and select the desired `.json` file from this folder. +- **Option 2**: Open the JSON file in a text editor, copy its content, and paste it into the **Import via panel JSON** section. + +### 4. Configure Data Source +- If the dashboard relies on specific data sources (e.g., Prometheus), you may need to reassign them during the import process. + - Example: The exported JSON might reference a data source like `prometheus-pm-spring-2025`. Ensure you have a compatible data source configured in Grafana. + +### 5. Save and View the Dashboard +- Once imported, you can save and view the dashboard in your Grafana instance. + +--- + +## ⚙️ Customization +After importing a dashboard, you can: +- Update queries to match your metrics. +- Adjust visualization settings to fit your requirements. +- Modify the layout or add/remove panels. + +--- + +Enjoy visualizing your metrics! 🚀 \ No newline at end of file