3EPMZBJkoh_Sv;^eA%n$6L_T&sC`KThxC!xn7)-11R8$a<21K=m+yDh7iotPc_
z1D>fW9(4gf5gMQ>0n2Le@wGVI4a%5U`2v^Sg6xgJuyV;9^Fx5~uK&=u{$3at-um|_
zsv0k29ynhrj0aCI6wt4mVd@LIA2qlWEx<9(Eb{06UO=5|R_l$VQ?I8GV~@wYmIg%}
z`J~^t4cSf-^t^B|;^Z~dy9XGm`QwDU{o>0Oyej8syKFitv<
z0)JF7ov&6;eZn@9HQ<5|Q!gdK6qdP}LC#E#ZqxXcd>8mYcPG4oVb>$~Jjaa`BUP2z
z)(3Ua>9VZt>U{wfB#heTZuAAhJzYx93d!f_;Az4n+|tBff{pG{f?Jr-c6v9-?`n-k
zTL*k(th)s%P?=x%(6IFveY-tJ*`3Juy?e=4fOEjA=fpl;)a1Zm!#5Rv7f`sjnBMRU
z8+F6TbZuwJdtB7dU$zwzHg)y9XpDOm%OL>Vc_}Jjp<`SNy#b>v)lab`BKq#BDC$L;
zJD0_f?ck!`xuzsU56BGG`Kj2H&y9kVh*6RKT2QTuj>`M#O~0uYu)SnU-g?G3(ZCAr
zOx;wbT!w7FyY+F)go2NV(B~SVU-gZLd3n*ik1yA0MItql
z7izlFnx24HV!Fryuk5a|GBsEpIrChl9bqK4i==NVl6Q|bEdpa)zFgG1^#EUUC=9Y@
z5PR{LD5}__kfL-zOO0!eaUwuK&FO;I%|(4ozlOUC08o89A)FR9`E?W9MV)kBV_-uK
zMPk$!*LMA#ACjC%Z6Gn0oKZ_VVAFqp{}x74O?Qmc07_%J}WK0MLvl=d+SjI0WA9M`1?NJ?Kf;4xND&+_Y8;m
zjjCst%gv*Xl=w&iv(iW;IBM`v6DfC)bPjh3pmd%ZEENay;+kedhK33DSb$)>zNpn(7K`JjP+p
z?Lo_`Clz<4Na%H?x`MmsFD8^s@$-c!d5h4=PMnrtBNsR~*d_GBZGJF}gh#J(%IT;Z
zL`bh4e@59=JQXomd{$hqxQEU%`EcMd)k-VD}&q*V#YX9OR(1D!+-ke@-_oLSB-TrxaSRe#0a>4Um~R+Xsf&1{Mt!J0xmy;;NeK4&{R(~k8G4s8BCUwD=hT1Q5tU1fbBob;5%K8w=UgtzjIW$j4Tv)`?N^!hR*EtF-aS7oo!
z7T|0gV;Uv!^)j7MB43K91Ja`uvMVX%ASK>xg`hiSc~3Ai0U!?PcZ@>E3=c9-y3X3Y
z-i67BdR{Gd+*H6db7MktdT2A%RG5HwkE1A3pTS8@DK8QPkl{+V@)cN#M65CY^@Gg@}D##$ob&6M|>qI2wfr%FMzfnO)iSGgY?@v
zyxcq1;U+B+C|$d{CsbQ4FnOEVg)ni3j`U%+pmF<~?SE_?dVQYg1P-2D
q{LyJ(_S!`{;r~|P_y6SD>yt2q?MdW2>6pg<
+
+
diff --git a/apps/liteprotocoltester/monitoring/configuration/dashboards.yaml b/apps/liteprotocoltester/monitoring/configuration/dashboards.yaml
new file mode 100644
index 000000000..e59ac96b3
--- /dev/null
+++ b/apps/liteprotocoltester/monitoring/configuration/dashboards.yaml
@@ -0,0 +1,9 @@
+apiVersion: 1
+
+providers:
+- name: 'Prometheus'
+ orgId: 1
+ folder: ''
+ type: file
+ options:
+ path: /var/lib/grafana/dashboards
\ No newline at end of file
diff --git a/apps/liteprotocoltester/monitoring/configuration/dashboards/nwaku-monitoring.json b/apps/liteprotocoltester/monitoring/configuration/dashboards/nwaku-monitoring.json
new file mode 100644
index 000000000..2b024e32f
--- /dev/null
+++ b/apps/liteprotocoltester/monitoring/configuration/dashboards/nwaku-monitoring.json
@@ -0,0 +1,5303 @@
+{
+ "annotations": {
+ "list": [
+ {
+ "builtIn": 1,
+ "datasource": {
+ "type": "grafana",
+ "uid": "-- Grafana --"
+ },
+ "enable": true,
+ "hide": true,
+ "iconColor": "rgba(0, 211, 255, 1)",
+ "name": "Annotations & Alerts",
+ "target": {
+ "limit": 100,
+ "matchAny": false,
+ "tags": [],
+ "type": "dashboard"
+ },
+ "type": "dashboard"
+ }
+ ]
+ },
+ "editable": true,
+ "fiscalYearStartMonth": 0,
+ "gnetId": 12485,
+ "graphTooltip": 0,
+ "links": [],
+ "liveNow": false,
+ "panels": [
+ {
+ "collapsed": false,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 0
+ },
+ "id": 45,
+ "panels": [],
+ "title": "Waku Node",
+ "type": "row"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ }
+ ]
+ },
+ "unit": "none"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 9,
+ "x": 0,
+ "y": 1
+ },
+ "id": 41,
+ "options": {
+ "displayMode": "gradient",
+ "maxVizHeight": 300,
+ "minVizHeight": 10,
+ "minVizWidth": 0,
+ "namePlacement": "auto",
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": [],
+ "fields": "",
+ "values": false
+ },
+ "showUnfilled": true,
+ "sizing": "auto",
+ "valueMode": "color"
+ },
+ "pluginVersion": "10.2.3",
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "editorMode": "code",
+ "exemplar": false,
+ "expr": "rate(waku_histogram_message_size_bucket[1h])/scalar(rate(waku_histogram_message_size_count[1h]))*100",
+ "format": "heatmap",
+ "instant": true,
+ "legendFormat": "__auto",
+ "range": false,
+ "refId": "A"
+ }
+ ],
+ "title": "Message distrubution %/kBytes (Last Hour)",
+ "type": "bargauge"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "deckbytes"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 4,
+ "w": 9,
+ "x": 9,
+ "y": 1
+ },
+ "id": 38,
+ "options": {
+ "colorMode": "none",
+ "graphMode": "none",
+ "justifyMode": "auto",
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "10.2.3",
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "editorMode": "code",
+ "expr": "rate(waku_histogram_message_size_sum[1h])/rate(waku_histogram_message_size_count[1h])",
+ "legendFormat": "__auto",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "Average Msg Size (Last Hour)",
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ }
+ ]
+ },
+ "unit": "deckbytes"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 4,
+ "w": 5,
+ "x": 9,
+ "y": 5
+ },
+ "id": 42,
+ "options": {
+ "colorMode": "none",
+ "graphMode": "none",
+ "justifyMode": "auto",
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "10.2.3",
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "editorMode": "code",
+ "expr": "histogram_quantile(0.75, rate(waku_histogram_message_size_bucket[1h]))",
+ "legendFormat": "__auto",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "75% Percentile (Last hour)",
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "deckbytes"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 4,
+ "w": 4,
+ "x": 14,
+ "y": 5
+ },
+ "id": 39,
+ "options": {
+ "colorMode": "none",
+ "graphMode": "none",
+ "justifyMode": "auto",
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "10.2.3",
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "editorMode": "code",
+ "expr": "histogram_quantile(0.99, rate(waku_histogram_message_size_bucket[1h]))",
+ "legendFormat": "__auto",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "99% Percentile (Last Hour)",
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 7,
+ "w": 9,
+ "x": 0,
+ "y": 9
+ },
+ "id": 12,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "editorMode": "code",
+ "expr": "(increase(waku_node_messages_total[1m]))/60",
+ "legendFormat": "{{instance}}",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "Messages/second",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ }
+ ]
+ },
+ "unit": "deckbytes"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 7,
+ "w": 9,
+ "x": 9,
+ "y": 9
+ },
+ "id": 43,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "pluginVersion": "9.4.7",
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "editorMode": "code",
+ "exemplar": false,
+ "expr": "waku_histogram_message_size_sum/waku_histogram_message_size_count",
+ "format": "heatmap",
+ "instant": false,
+ "legendFormat": "{{instance}}",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "Average msg size (kBytes)",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "custom": {
+ "align": "auto",
+ "cellOptions": {
+ "type": "auto"
+ },
+ "inspect": false
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 5,
+ "w": 3,
+ "x": 0,
+ "y": 16
+ },
+ "id": 2,
+ "options": {
+ "cellHeight": "sm",
+ "footer": {
+ "countRows": false,
+ "fields": "",
+ "reducer": [
+ "sum"
+ ],
+ "show": false
+ },
+ "showHeader": true
+ },
+ "pluginVersion": "10.2.3",
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "editorMode": "builder",
+ "exemplar": false,
+ "expr": "waku_version{instance=\"nwaku:8003\"}",
+ "format": "table",
+ "instant": true,
+ "legendFormat": "__auto",
+ "range": false,
+ "refId": "A"
+ }
+ ],
+ "title": "Version",
+ "transformations": [
+ {
+ "id": "filterFieldsByName",
+ "options": {
+ "include": {
+ "names": [
+ "version"
+ ]
+ }
+ }
+ }
+ ],
+ "type": "table"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 5,
+ "w": 3,
+ "x": 3,
+ "y": 16
+ },
+ "id": 22,
+ "options": {
+ "colorMode": "value",
+ "graphMode": "area",
+ "justifyMode": "auto",
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "10.2.3",
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "editorMode": "code",
+ "expr": "libp2p_autonat_reachability_confidence",
+ "legendFormat": "{{reachability}}",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "Reachability",
+ "transformations": [
+ {
+ "id": "reduce",
+ "options": {
+ "includeTimeField": false,
+ "mode": "reduceFields",
+ "reducers": [
+ "max"
+ ]
+ }
+ }
+ ],
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 5,
+ "w": 3,
+ "x": 6,
+ "y": 16
+ },
+ "id": 32,
+ "options": {
+ "colorMode": "value",
+ "graphMode": "none",
+ "justifyMode": "auto",
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "10.2.3",
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "editorMode": "code",
+ "expr": "routing_table_nodes{state=\"seen\"}",
+ "legendFormat": "__auto",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "Discv5 (Seen Nodes)",
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 5,
+ "w": 3,
+ "x": 9,
+ "y": 16
+ },
+ "id": 33,
+ "options": {
+ "colorMode": "value",
+ "graphMode": "none",
+ "justifyMode": "auto",
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "10.2.3",
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "editorMode": "code",
+ "expr": "routing_table_nodes",
+ "legendFormat": "{{label_name}}",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "Discv5 (Nodes)",
+ "transformations": [
+ {
+ "id": "filterFieldsByName",
+ "options": {
+ "include": {
+ "names": [
+ "Time",
+ "{__name__=\"routing_table_nodes\", instance=\"nwaku:8003\", job=\"nwaku\"}"
+ ]
+ }
+ }
+ }
+ ],
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 5,
+ "w": 3,
+ "x": 12,
+ "y": 16
+ },
+ "id": 25,
+ "options": {
+ "colorMode": "value",
+ "graphMode": "none",
+ "justifyMode": "auto",
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "10.2.3",
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "editorMode": "builder",
+ "expr": "libp2p_peers",
+ "legendFormat": "__auto",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "Connected Peers",
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 5,
+ "w": 3,
+ "x": 15,
+ "y": 16
+ },
+ "id": 28,
+ "options": {
+ "colorMode": "value",
+ "graphMode": "none",
+ "justifyMode": "auto",
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "10.2.3",
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "editorMode": "code",
+ "expr": "libp2p_pubsub_topics",
+ "legendFormat": "__auto",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "Number Pubsub Topics",
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ }
+ ]
+ },
+ "unit": "dateTimeAsIso"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 5,
+ "w": 3,
+ "x": 0,
+ "y": 21
+ },
+ "id": 10,
+ "options": {
+ "colorMode": "value",
+ "graphMode": "none",
+ "justifyMode": "auto",
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "10.2.3",
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "editorMode": "code",
+ "expr": "process_start_time_seconds{job=\"nwaku\"}*1000",
+ "legendFormat": "__auto",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "Start Times (UTC)",
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 10,
+ "w": 15,
+ "x": 3,
+ "y": 21
+ },
+ "id": 44,
+ "options": {
+ "colorMode": "value",
+ "graphMode": "none",
+ "justifyMode": "auto",
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "10.2.3",
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "editorMode": "code",
+ "expr": "waku_connected_peers",
+ "legendFormat": "{{direction}}_{{protocol}}",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "Connected Peers (Direction/Protocol)",
+ "transformations": [],
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 5,
+ "w": 3,
+ "x": 0,
+ "y": 26
+ },
+ "id": 36,
+ "options": {
+ "colorMode": "value",
+ "graphMode": "none",
+ "justifyMode": "auto",
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "10.2.3",
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "editorMode": "code",
+ "expr": "waku_peer_store_size",
+ "legendFormat": "__auto",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "Peer Store Size",
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 9,
+ "w": 6,
+ "x": 0,
+ "y": 31
+ },
+ "id": 4,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "pluginVersion": "9.3.2",
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "editorMode": "builder",
+ "expr": "libp2p_peers",
+ "legendFormat": "{{__name__}}",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "Connected Peers",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "binBps"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 9,
+ "w": 6,
+ "x": 6,
+ "y": 31
+ },
+ "id": 8,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "editorMode": "code",
+ "expr": "rate(libp2p_network_bytes_total{direction=\"in\"}[$__rate_interval])",
+ "legendFormat": "traffic_{{direction}}",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "libp2p traffic (in)",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "binBps"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 9,
+ "w": 6,
+ "x": 12,
+ "y": 31
+ },
+ "id": 29,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "editorMode": "code",
+ "expr": "rate(libp2p_network_bytes_total{direction=\"out\"}[$__rate_interval])",
+ "legendFormat": "traffic_{{direction}}",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "libp2p traffic (out)",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "decbytes"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 6,
+ "x": 0,
+ "y": 40
+ },
+ "id": 20,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "editorMode": "code",
+ "expr": "nim_gc_heap_instance_occupied_bytes{}",
+ "legendFormat": "{{__name__}}",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "Heap allocation",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "decbytes"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 6,
+ "x": 6,
+ "y": 40
+ },
+ "id": 18,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "editorMode": "code",
+ "expr": "nim_gc_mem_bytes{}",
+ "hide": false,
+ "legendFormat": "{{__name__}}",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "Nim Memory Usage",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 6,
+ "x": 12,
+ "y": 40
+ },
+ "id": 128,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "disableTextWrap": false,
+ "editorMode": "builder",
+ "expr": "waku_rln_number_registered_memberships",
+ "fullMetaSearch": false,
+ "includeNullMetadata": true,
+ "instant": false,
+ "legendFormat": "{{__name__}}",
+ "range": true,
+ "refId": "A",
+ "useBackend": false
+ }
+ ],
+ "title": "RLN Registered Memberships",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 0,
+ "y": 48
+ },
+ "id": 127,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "disableTextWrap": false,
+ "editorMode": "builder",
+ "expr": "waku_rln_proof_generation_duration_seconds",
+ "fullMetaSearch": false,
+ "includeNullMetadata": true,
+ "instant": false,
+ "legendFormat": "{{__name__}}",
+ "range": true,
+ "refId": "A",
+ "useBackend": false
+ }
+ ],
+ "title": "RLN Proof Generation (seconds)",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 6,
+ "y": 48
+ },
+ "id": 126,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "disableTextWrap": false,
+ "editorMode": "builder",
+ "expr": "waku_rln_proof_verification_duration_seconds",
+ "fullMetaSearch": false,
+ "includeNullMetadata": true,
+ "instant": false,
+ "legendFormat": "{{__name__}}",
+ "range": true,
+ "refId": "A",
+ "useBackend": false
+ }
+ ],
+ "title": "RLN Proof Verification (seconds)",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 12,
+ "y": 48
+ },
+ "id": 135,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "disableTextWrap": false,
+ "editorMode": "builder",
+ "expr": "waku_rln_membership_insertion_duration_seconds",
+ "fullMetaSearch": false,
+ "includeNullMetadata": true,
+ "instant": false,
+ "legendFormat": "{{__name__}}",
+ "range": true,
+ "refId": "A",
+ "useBackend": false
+ }
+ ],
+ "title": "RLN Membership Insertion (seconds)",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 0,
+ "y": 54
+ },
+ "id": 134,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "disableTextWrap": false,
+ "editorMode": "builder",
+ "expr": "waku_rln_membership_credentials_import_duration_seconds",
+ "fullMetaSearch": false,
+ "includeNullMetadata": true,
+ "instant": false,
+ "legendFormat": "{{__name__}}",
+ "range": true,
+ "refId": "A",
+ "useBackend": false
+ }
+ ],
+ "title": "RLN Credentials Import (seconds)",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 6,
+ "y": 54
+ },
+ "id": 137,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "disableTextWrap": false,
+ "editorMode": "builder",
+ "expr": "waku_rln_messages_total_total",
+ "fullMetaSearch": false,
+ "includeNullMetadata": true,
+ "instant": false,
+ "legendFormat": "{{__name__}}",
+ "range": true,
+ "refId": "A",
+ "useBackend": false
+ }
+ ],
+ "title": "RLN Messages Total",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 12,
+ "y": 54
+ },
+ "id": 136,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "disableTextWrap": false,
+ "editorMode": "builder",
+ "expr": "waku_rln_proof_verification_total_total",
+ "fullMetaSearch": false,
+ "includeNullMetadata": true,
+ "instant": false,
+ "legendFormat": "{{__name__}}",
+ "range": true,
+ "refId": "A",
+ "useBackend": false
+ }
+ ],
+ "title": "RLN Proof Verification Total",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 0,
+ "y": 60
+ },
+ "id": 133,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "disableTextWrap": false,
+ "editorMode": "builder",
+ "expr": "waku_rln_invalid_messages_total_total",
+ "fullMetaSearch": false,
+ "includeNullMetadata": true,
+ "instant": false,
+ "legendFormat": "{{__name__}}",
+ "range": true,
+ "refId": "A",
+ "useBackend": false
+ }
+ ],
+ "title": "RLN Invalid Messages Total",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 6,
+ "y": 60
+ },
+ "id": 130,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "disableTextWrap": false,
+ "editorMode": "builder",
+ "expr": "waku_rln_spam_messages_total_total",
+ "fullMetaSearch": false,
+ "includeNullMetadata": true,
+ "instant": false,
+ "legendFormat": "{{__name__}}",
+ "range": true,
+ "refId": "A",
+ "useBackend": false
+ }
+ ],
+ "title": "RLN Spam Messages Total",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 12,
+ "y": 60
+ },
+ "id": 138,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "disableTextWrap": false,
+ "editorMode": "builder",
+ "expr": "waku_rln_invalid_messages_total_total",
+ "fullMetaSearch": false,
+ "includeNullMetadata": true,
+ "instant": false,
+ "legendFormat": "{{type}}",
+ "range": true,
+ "refId": "A",
+ "useBackend": false
+ }
+ ],
+ "title": "RLN Invalid Messages",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "description": "Number of messages currently stored in the database",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "none"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 11,
+ "w": 9,
+ "x": 0,
+ "y": 66
+ },
+ "id": 141,
+ "options": {
+ "legend": {
+ "calcs": [
+ "last"
+ ],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "editorMode": "code",
+ "expr": "pg_tb_stats_messages{}",
+ "instant": false,
+ "legendFormat": "{{ pubsubtopic }}",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "# messages per shard",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "type": "postgres",
+ "uid": "e5d2e0c2-371d-4178-ac71-edc122fb459c"
+ },
+ "description": "Messages in local database per app name, as extracted from the content topic.",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "custom": {
+ "align": "auto",
+ "cellOptions": {
+ "type": "auto"
+ },
+ "inspect": false
+ },
+ "mappings": [
+ {
+ "options": {
+ "/waku/2/rs/1/0": {
+ "index": 0,
+ "text": "0"
+ },
+ "/waku/2/rs/1/1": {
+ "index": 1,
+ "text": "1"
+ },
+ "/waku/2/rs/1/2": {
+ "index": 2,
+ "text": "2"
+ },
+ "/waku/2/rs/1/3": {
+ "index": 3,
+ "text": "3"
+ },
+ "/waku/2/rs/1/4": {
+ "index": 4,
+ "text": "4"
+ },
+ "/waku/2/rs/1/5": {
+ "index": 5,
+ "text": "5"
+ },
+ "/waku/2/rs/1/6": {
+ "index": 6,
+ "text": "6"
+ },
+ "/waku/2/rs/1/7": {
+ "index": 7,
+ "text": "7"
+ }
+ },
+ "type": "value"
+ }
+ ],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "string"
+ },
+ "overrides": [
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "Number of Messages (sum)"
+ },
+ "properties": [
+ {
+ "id": "unit",
+ "value": "none"
+ }
+ ]
+ },
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "Total Payload Size (sum)"
+ },
+ "properties": [
+ {
+ "id": "unit",
+ "value": "decbytes"
+ }
+ ]
+ }
+ ]
+ },
+ "gridPos": {
+ "h": 11,
+ "w": 9,
+ "x": 9,
+ "y": 66
+ },
+ "id": 144,
+ "options": {
+ "cellHeight": "sm",
+ "footer": {
+ "countRows": false,
+ "enablePagination": false,
+ "fields": "",
+ "reducer": [
+ "sum"
+ ],
+ "show": false
+ },
+ "frameIndex": 1,
+ "showHeader": true,
+ "sortBy": []
+ },
+ "pluginVersion": "10.2.3",
+ "targets": [
+ {
+ "datasource": {
+ "type": "postgres",
+ "uid": "e5d2e0c2-371d-4178-ac71-edc122fb459c"
+ },
+ "editorMode": "code",
+ "format": "table",
+ "hide": false,
+ "rawQuery": true,
+ "rawSql": "SELECT REGEXP_REPLACE(contenttopic,'^\\/(.+)\\/(\\d+)\\/(.+)\\/(.+)$','\\1') as \"App name\", COUNT(id), pg_column_size(payload)\nFROM messages\nGROUP BY contenttopic, payload",
+ "refId": "A",
+ "sql": {
+ "columns": [
+ {
+ "parameters": [
+ {
+ "name": "pubsubtopic",
+ "type": "functionParameter"
+ }
+ ],
+ "type": "function"
+ }
+ ],
+ "groupBy": [
+ {
+ "property": {
+ "name": "pubsubtopic",
+ "type": "string"
+ },
+ "type": "groupBy"
+ }
+ ],
+ "limit": 50
+ },
+ "table": "messages"
+ }
+ ],
+ "title": "Stored Message by Content Topic App Name",
+ "transformations": [
+ {
+ "id": "organize",
+ "options": {
+ "excludeByName": {},
+ "indexByName": {},
+ "renameByName": {
+ "contenttopic": "App name",
+ "count": "Number of Messages",
+ "pg_column_size": "Total Payload Size"
+ }
+ }
+ },
+ {
+ "id": "groupBy",
+ "options": {
+ "fields": {
+ "App name": {
+ "aggregations": [
+ "uniqueValues"
+ ],
+ "operation": "groupby"
+ },
+ "Number of Messages": {
+ "aggregations": [
+ "sum"
+ ],
+ "operation": "aggregate"
+ },
+ "Total Payload Size": {
+ "aggregations": [
+ "sum"
+ ],
+ "operation": "aggregate"
+ },
+ "pg_column_size": {
+ "aggregations": [
+ "sum"
+ ],
+ "operation": "aggregate"
+ }
+ }
+ }
+ },
+ {
+ "id": "sortBy",
+ "options": {
+ "fields": {},
+ "sort": [
+ {
+ "desc": true,
+ "field": "Number of Messages (sum)"
+ }
+ ]
+ }
+ }
+ ],
+ "type": "table"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "description": "Number of messages currently stored in the database",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ }
+ ]
+ },
+ "unit": "none"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 7,
+ "w": 9,
+ "x": 0,
+ "y": 77
+ },
+ "id": 146,
+ "options": {
+ "legend": {
+ "calcs": [
+ "last"
+ ],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "editorMode": "code",
+ "exemplar": false,
+ "expr": "pg_tb_messages_count{}",
+ "instant": false,
+ "interval": "",
+ "legendFormat": "messages",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "Unique stored messages (Postgres)",
+ "type": "timeseries"
+ },
+ {
+ "collapsed": false,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 84
+ },
+ "id": 46,
+ "panels": [],
+ "title": "Postgres",
+ "type": "row"
+ },
+ {
+ "colorBackground": false,
+ "colorValue": false,
+ "datasource": "Prometheus",
+ "description": "Source: server_version_num",
+ "fieldConfig": {
+ "defaults": {
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "format": "none",
+ "gauge": {
+ "maxValue": 100,
+ "minValue": 0,
+ "show": false,
+ "thresholdLabels": false,
+ "thresholdMarkers": true
+ },
+ "gridPos": {
+ "h": 3,
+ "w": 4,
+ "x": 0,
+ "y": 85
+ },
+ "id": 11,
+ "links": [],
+ "mappingType": 1,
+ "mappingTypes": [
+ {
+ "name": "value to text",
+ "value": 1
+ },
+ {
+ "name": "range to text",
+ "value": 2
+ }
+ ],
+ "maxDataPoints": 100,
+ "nullPointMode": "connected",
+ "options": {
+ "colorMode": "value",
+ "graphMode": "area",
+ "justifyMode": "auto",
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "10.2.3",
+ "postfix": "",
+ "postfixFontSize": "50%",
+ "prefix": "",
+ "prefixFontSize": "50%",
+ "rangeMaps": [
+ {
+ "from": "null",
+ "text": "N/A",
+ "to": "null"
+ }
+ ],
+ "sparkline": {
+ "fillColor": "rgba(31, 118, 189, 0.18)",
+ "full": false,
+ "lineColor": "rgb(50, 168, 82)",
+ "show": false
+ },
+ "tableColumn": "",
+ "targets": [
+ {
+ "expr": "max(pg_settings_server_version_num)",
+ "legendFormat": "",
+ "refId": "A"
+ }
+ ],
+ "thresholds": "",
+ "title": "PostgreSQL Version",
+ "type": "stat",
+ "valueFontSize": "80%",
+ "valueMaps": [
+ {
+ "op": "=",
+ "text": "N/A",
+ "value": "null"
+ }
+ ],
+ "valueName": "current"
+ },
+ {
+ "colorBackground": false,
+ "colorValue": false,
+ "colors": [
+ "#299c46",
+ "rgba(237, 129, 40, 0.89)",
+ "#d44a3a"
+ ],
+ "datasource": "Prometheus",
+ "description": "Transactions committed + roolback per minute\n\nSource: pg_stat_database,xact_commit + xact_rollback",
+ "fieldConfig": {
+ "defaults": {
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "format": "none",
+ "gauge": {
+ "maxValue": 100,
+ "minValue": 0,
+ "show": false,
+ "thresholdLabels": false,
+ "thresholdMarkers": true
+ },
+ "gridPos": {
+ "h": 3,
+ "w": 4,
+ "x": 4,
+ "y": 85
+ },
+ "id": 14,
+ "interval": "",
+ "links": [],
+ "mappingType": 1,
+ "mappingTypes": [
+ {
+ "name": "value to text",
+ "value": 1
+ },
+ {
+ "name": "range to text",
+ "value": 2
+ }
+ ],
+ "maxDataPoints": 100,
+ "nullPointMode": "connected",
+ "options": {
+ "colorMode": "value",
+ "graphMode": "area",
+ "justifyMode": "auto",
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "10.2.3",
+ "postfix": "",
+ "postfixFontSize": "50%",
+ "prefix": "",
+ "prefixFontSize": "50%",
+ "rangeMaps": [
+ {
+ "from": "null",
+ "text": "N/A",
+ "to": "null"
+ }
+ ],
+ "sparkline": {
+ "fillColor": "rgba(31, 118, 189, 0.18)",
+ "full": false,
+ "lineColor": "rgb(31, 120, 193)",
+ "show": true
+ },
+ "tableColumn": "",
+ "targets": [
+ {
+ "expr": "sum((rate(pg_stat_database_xact_commit{instance=\"$Instance\"}[$Interval])))+sum((rate(pg_stat_database_xact_rollback{instance=\"$Instance\"}[$Interval])))",
+ "interval": "",
+ "legendFormat": "",
+ "refId": "A"
+ }
+ ],
+ "thresholds": "",
+ "title": "Transaction rate (Postgres)",
+ "type": "stat",
+ "valueFontSize": "80%",
+ "valueMaps": [
+ {
+ "op": "=",
+ "text": "N/A",
+ "value": "null"
+ }
+ ],
+ "valueName": "current"
+ },
+ {
+ "colorBackground": false,
+ "colorValue": false,
+ "colors": [
+ "#299c46",
+ "rgba(237, 129, 40, 0.89)",
+ "#d44a3a"
+ ],
+ "datasource": "Prometheus",
+ "description": "Statements executed per Minute.\n\nSource: pg_stat_statements.calls",
+ "fieldConfig": {
+ "defaults": {
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "format": "none",
+ "gauge": {
+ "maxValue": 100,
+ "minValue": 0,
+ "show": false,
+ "thresholdLabels": false,
+ "thresholdMarkers": true
+ },
+ "gridPos": {
+ "h": 3,
+ "w": 4,
+ "x": 8,
+ "y": 85
+ },
+ "id": 93,
+ "links": [],
+ "mappingType": 1,
+ "mappingTypes": [
+ {
+ "name": "value to text",
+ "value": 1
+ },
+ {
+ "name": "range to text",
+ "value": 2
+ }
+ ],
+ "maxDataPoints": 100,
+ "nullPointMode": "connected",
+ "options": {
+ "colorMode": "value",
+ "graphMode": "area",
+ "justifyMode": "auto",
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "10.2.3",
+ "postfix": "",
+ "postfixFontSize": "50%",
+ "prefix": "",
+ "prefixFontSize": "50%",
+ "rangeMaps": [
+ {
+ "from": "null",
+ "text": "N/A",
+ "to": "null"
+ }
+ ],
+ "sparkline": {
+ "fillColor": "rgba(31, 118, 189, 0.18)",
+ "full": false,
+ "lineColor": "rgb(31, 120, 193)",
+ "show": true
+ },
+ "tableColumn": "",
+ "targets": [
+ {
+ "expr": "sum((rate(pg_stat_statements_calls{instance=\"$Instance\"}[$Interval])))",
+ "interval": "",
+ "legendFormat": "",
+ "refId": "A"
+ }
+ ],
+ "thresholds": "",
+ "title": "Query rate (Postgres)",
+ "type": "stat",
+ "valueFontSize": "80%",
+ "valueMaps": [
+ {
+ "op": "=",
+ "text": "N/A",
+ "value": "null"
+ }
+ ],
+ "valueName": "current"
+ },
+ {
+ "colorBackground": false,
+ "colorValue": false,
+ "colors": [
+ "#299c46",
+ "rgba(237, 129, 40, 0.89)",
+ "#d44a3a"
+ ],
+ "datasource": "Prometheus",
+ "description": "Source: pg_stat_statements.total_time / pg_stat_statements.calls",
+ "fieldConfig": {
+ "defaults": {
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "format": "s",
+ "gauge": {
+ "maxValue": 100,
+ "minValue": 0,
+ "show": false,
+ "thresholdLabels": false,
+ "thresholdMarkers": true
+ },
+ "gridPos": {
+ "h": 3,
+ "w": 4,
+ "x": 12,
+ "y": 85
+ },
+ "id": 102,
+ "links": [],
+ "mappingType": 1,
+ "mappingTypes": [
+ {
+ "name": "value to text",
+ "value": 1
+ },
+ {
+ "name": "range to text",
+ "value": 2
+ }
+ ],
+ "maxDataPoints": 100,
+ "nullPointMode": "connected",
+ "options": {
+ "colorMode": "value",
+ "graphMode": "area",
+ "justifyMode": "auto",
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "10.2.3",
+ "postfix": "",
+ "postfixFontSize": "50%",
+ "prefix": "",
+ "prefixFontSize": "50%",
+ "rangeMaps": [
+ {
+ "from": "null",
+ "text": "N/A",
+ "to": "null"
+ }
+ ],
+ "sparkline": {
+ "fillColor": "rgba(31, 118, 189, 0.18)",
+ "full": false,
+ "lineColor": "rgb(31, 120, 193)",
+ "show": true
+ },
+ "tableColumn": "",
+ "targets": [
+ {
+ "expr": "sum((delta(pg_stat_statements_total_time_seconds{instance=\"$Instance\"}[$Interval])))/sum((delta(pg_stat_statements_calls{instance=\"$Instance\"}[$Interval])))",
+ "interval": "",
+ "legendFormat": "",
+ "refId": "A"
+ }
+ ],
+ "thresholds": "",
+ "title": "Average query runtime (Postgres)",
+ "type": "stat",
+ "valueFontSize": "80%",
+ "valueMaps": [
+ {
+ "op": "=",
+ "text": "N/A",
+ "value": "null"
+ }
+ ],
+ "valueName": "current"
+ },
+ {
+ "colorBackground": false,
+ "colorValue": false,
+ "colors": [
+ "#299c46",
+ "rgba(237, 129, 40, 0.89)",
+ "#d44a3a"
+ ],
+ "datasource": "Prometheus",
+ "decimals": 2,
+ "description": "Size of all databases in $Instance.\n\nSource: pg_database_size()",
+ "fieldConfig": {
+ "defaults": {
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ }
+ ]
+ },
+ "unit": "decbytes"
+ },
+ "overrides": []
+ },
+ "format": "bytes",
+ "gauge": {
+ "maxValue": 100,
+ "minValue": 0,
+ "show": false,
+ "thresholdLabels": false,
+ "thresholdMarkers": true
+ },
+ "gridPos": {
+ "h": 3,
+ "w": 4,
+ "x": 16,
+ "y": 85
+ },
+ "id": 37,
+ "links": [],
+ "mappingType": 1,
+ "mappingTypes": [
+ {
+ "name": "value to text",
+ "value": 1
+ },
+ {
+ "name": "range to text",
+ "value": 2
+ }
+ ],
+ "maxDataPoints": 100,
+ "nullPointMode": "connected",
+ "options": {
+ "colorMode": "value",
+ "graphMode": "area",
+ "justifyMode": "auto",
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "10.2.3",
+ "postfix": "",
+ "postfixFontSize": "50%",
+ "prefix": "",
+ "prefixFontSize": "50%",
+ "rangeMaps": [
+ {
+ "from": "null",
+ "text": "N/A",
+ "to": "null"
+ }
+ ],
+ "sparkline": {
+ "fillColor": "rgba(31, 118, 189, 0.18)",
+ "full": false,
+ "lineColor": "rgb(31, 120, 193)",
+ "show": true
+ },
+ "tableColumn": "",
+ "targets": [
+ {
+ "expr": "sum(pg_database_size_bytes{instance=\"$Instance\"})",
+ "refId": "A"
+ }
+ ],
+ "thresholds": "",
+ "title": "Total database size (Postgres)",
+ "type": "stat",
+ "valueFontSize": "80%",
+ "valueMaps": [
+ {
+ "op": "=",
+ "text": "N/A",
+ "value": "null"
+ }
+ ],
+ "valueName": "current"
+ },
+ {
+ "colorBackground": false,
+ "colorValue": false,
+ "colors": [
+ "#299c46",
+ "rgba(237, 129, 40, 0.89)",
+ "#d44a3a"
+ ],
+ "datasource": "Prometheus",
+ "description": "Max Replication lag behind master in seconds\n\nOnly available on a standby system.\n\nSource: pg_last_xact_replay_timestamp\n\nUse: pg_stat_replication for Details.",
+ "fieldConfig": {
+ "defaults": {
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "format": "s",
+ "gauge": {
+ "maxValue": 100,
+ "minValue": 0,
+ "show": false,
+ "thresholdLabels": false,
+ "thresholdMarkers": true
+ },
+ "gridPos": {
+ "h": 3,
+ "w": 4,
+ "x": 20,
+ "y": 85
+ },
+ "id": 84,
+ "links": [],
+ "mappingType": 1,
+ "mappingTypes": [
+ {
+ "name": "value to text",
+ "value": 1
+ },
+ {
+ "name": "range to text",
+ "value": 2
+ }
+ ],
+ "maxDataPoints": 100,
+ "nullPointMode": "connected",
+ "options": {
+ "colorMode": "value",
+ "graphMode": "area",
+ "justifyMode": "auto",
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "10.2.3",
+ "postfix": "",
+ "postfixFontSize": "50%",
+ "prefix": "",
+ "prefixFontSize": "50%",
+ "rangeMaps": [
+ {
+ "from": "null",
+ "text": "N/A",
+ "to": "null"
+ }
+ ],
+ "sparkline": {
+ "fillColor": "rgba(31, 118, 189, 0.18)",
+ "full": false,
+ "lineColor": "rgb(31, 120, 193)",
+ "show": true
+ },
+ "tableColumn": "",
+ "targets": [
+ {
+ "expr": "max(pg_replication_lag{instance=\"$Instance\"})",
+ "interval": "",
+ "legendFormat": "",
+ "refId": "A"
+ }
+ ],
+ "thresholds": "",
+ "title": "Max Replication Lag (Postgres)",
+ "type": "stat",
+ "valueFontSize": "80%",
+ "valueMaps": [
+ {
+ "op": "=",
+ "text": "N/A",
+ "value": "null"
+ }
+ ],
+ "valueName": "max"
+ },
+ {
+ "datasource": "Prometheus",
+ "description": "Shared buffer hits vs reads from disc",
+ "fieldConfig": {
+ "defaults": {
+ "decimals": 2,
+ "mappings": [
+ {
+ "id": 0,
+ "op": "=",
+ "text": "N/A",
+ "type": 1,
+ "value": "null"
+ }
+ ],
+ "max": 100,
+ "min": 0,
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "semi-dark-red"
+ },
+ {
+ "color": "semi-dark-yellow",
+ "value": 80
+ },
+ {
+ "color": "semi-dark-green",
+ "value": 90
+ }
+ ]
+ },
+ "unit": "percent"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 7,
+ "w": 3,
+ "x": 0,
+ "y": 88
+ },
+ "id": 16,
+ "links": [],
+ "options": {
+ "minVizHeight": 75,
+ "minVizWidth": 75,
+ "orientation": "horizontal",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "showThresholdLabels": false,
+ "showThresholdMarkers": true,
+ "sizing": "auto"
+ },
+ "pluginVersion": "10.2.3",
+ "targets": [
+ {
+ "expr": "sum(pg_stat_database_blks_hit{instance=~\"$Instance\"})/(sum(pg_stat_database_blks_hit{instance=~\"$Instance\"})+sum(pg_stat_database_blks_read{instance=~\"$Instance\"}))*100",
+ "refId": "A"
+ }
+ ],
+ "title": "Shared Buffer Hits (Postgres)",
+ "type": "gauge"
+ },
+ {
+ "datasource": "Prometheus",
+ "description": "Percentage of max_connections used",
+ "fieldConfig": {
+ "defaults": {
+ "decimals": 0,
+ "mappings": [
+ {
+ "id": 0,
+ "op": "=",
+ "text": "N/A",
+ "type": 1,
+ "value": "null"
+ }
+ ],
+ "max": 1,
+ "min": 0,
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "semi-dark-green",
+ "value": null
+ },
+ {
+ "color": "semi-dark-yellow",
+ "value": 0.75
+ },
+ {
+ "color": "semi-dark-red",
+ "value": 0.9
+ }
+ ]
+ },
+ "unit": "percentunit"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 7,
+ "w": 3,
+ "x": 3,
+ "y": 88
+ },
+ "id": 9,
+ "links": [],
+ "options": {
+ "minVizHeight": 75,
+ "minVizWidth": 75,
+ "orientation": "horizontal",
+ "reduceOptions": {
+ "calcs": [
+ "last"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "showThresholdLabels": false,
+ "showThresholdMarkers": true,
+ "sizing": "auto"
+ },
+ "pluginVersion": "10.2.3",
+ "targets": [
+ {
+ "expr": "sum(pg_stat_database_numbackends)/max(pg_settings_max_connections)",
+ "refId": "A"
+ }
+ ],
+ "title": "Connections used (Postgres)",
+ "type": "gauge"
+ },
+ {
+ "datasource": "Prometheus",
+ "description": "Transaction committed vs rollbacked",
+ "fieldConfig": {
+ "defaults": {
+ "decimals": 2,
+ "mappings": [
+ {
+ "id": 0,
+ "op": "=",
+ "text": "N/A",
+ "type": 1,
+ "value": "null"
+ }
+ ],
+ "max": 1,
+ "min": 0,
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "semi-dark-red",
+ "value": null
+ },
+ {
+ "color": "#EAB839",
+ "value": 0.75
+ },
+ {
+ "color": "semi-dark-green",
+ "value": 0.9
+ }
+ ]
+ },
+ "unit": "percentunit"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 7,
+ "w": 3,
+ "x": 6,
+ "y": 88
+ },
+ "id": 15,
+ "links": [],
+ "options": {
+ "minVizHeight": 75,
+ "minVizWidth": 75,
+ "orientation": "horizontal",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "showThresholdLabels": false,
+ "showThresholdMarkers": true,
+ "sizing": "auto"
+ },
+ "pluginVersion": "10.2.3",
+ "targets": [
+ {
+ "expr": "sum(pg_stat_database_xact_commit{instance=\"$Instance\"})/(sum(pg_stat_database_xact_commit{instance=\"$Instance\"}) + sum(pg_stat_database_xact_rollback{instance=\"$Instance\"}))",
+ "refId": "A"
+ }
+ ],
+ "title": "Commit Ratio (Postgres)",
+ "type": "gauge"
+ },
+ {
+ "colorBackground": false,
+ "colorValue": false,
+ "colors": [
+ "#299c46",
+ "rgba(237, 129, 40, 0.89)",
+ "#d44a3a"
+ ],
+ "datasource": "Prometheus",
+ "description": "Clients executing Statements.\n\nSource: pg_stat_activity",
+ "fieldConfig": {
+ "defaults": {
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "format": "none",
+ "gauge": {
+ "maxValue": 100,
+ "minValue": 0,
+ "show": false,
+ "thresholdLabels": false,
+ "thresholdMarkers": true
+ },
+ "gridPos": {
+ "h": 3,
+ "w": 4,
+ "x": 12,
+ "y": 88
+ },
+ "id": 23,
+ "links": [],
+ "mappingType": 1,
+ "mappingTypes": [
+ {
+ "name": "value to text",
+ "value": 1
+ },
+ {
+ "name": "range to text",
+ "value": 2
+ }
+ ],
+ "maxDataPoints": 100,
+ "nullPointMode": "connected",
+ "options": {
+ "colorMode": "value",
+ "graphMode": "area",
+ "justifyMode": "auto",
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "10.2.3",
+ "postfix": "",
+ "postfixFontSize": "50%",
+ "prefix": "",
+ "prefixFontSize": "50%",
+ "rangeMaps": [
+ {
+ "from": "null",
+ "text": "N/A",
+ "to": "null"
+ }
+ ],
+ "sparkline": {
+ "fillColor": "rgba(31, 118, 189, 0.18)",
+ "full": false,
+ "lineColor": "rgb(31, 120, 193)",
+ "show": true
+ },
+ "tableColumn": "",
+ "targets": [
+ {
+ "expr": "sum(pg_stat_activity_count{state=\"active\",instance=\"$Instance\"})",
+ "refId": "A"
+ }
+ ],
+ "thresholds": "",
+ "title": "Active clients (Postgres)",
+ "type": "stat",
+ "valueFontSize": "80%",
+ "valueMaps": [
+ {
+ "op": "=",
+ "text": "N/A",
+ "value": "null"
+ }
+ ],
+ "valueName": "current"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ }
+ ]
+ },
+ "unit": "dateTimeAsIso"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 3,
+ "w": 4,
+ "x": 16,
+ "y": 88
+ },
+ "id": 125,
+ "options": {
+ "colorMode": "value",
+ "graphMode": "none",
+ "justifyMode": "auto",
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "10.2.3",
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "editorMode": "code",
+ "expr": "pg_postmaster_start_time_seconds*1000",
+ "legendFormat": "__auto",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "Postgres start time",
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "description": "",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "bars",
+ "fillOpacity": 51,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 6,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "normal"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "short"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 91
+ },
+ "id": 142,
+ "options": {
+ "legend": {
+ "calcs": [
+ "last",
+ "max"
+ ],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "disableTextWrap": false,
+ "editorMode": "builder",
+ "expr": "pg_stat_user_tables_n_live_tup{datname=\"postgres\"}",
+ "fullMetaSearch": false,
+ "includeNullMetadata": true,
+ "instant": false,
+ "legendFormat": "Live",
+ "range": true,
+ "refId": "A",
+ "useBackend": false
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "disableTextWrap": false,
+ "editorMode": "builder",
+ "expr": "pg_stat_user_tables_n_dead_tup",
+ "fullMetaSearch": false,
+ "hide": false,
+ "includeNullMetadata": true,
+ "instant": false,
+ "legendFormat": "Dead",
+ "range": true,
+ "refId": "B",
+ "useBackend": false
+ }
+ ],
+ "title": "Estimated number of rows (Postgres)",
+ "type": "timeseries"
+ },
+ {
+ "aliasColors": {},
+ "bars": true,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "decimals": 0,
+ "description": "View: pg_stat_activity",
+ "fieldConfig": {
+ "defaults": {
+ "links": []
+ },
+ "overrides": []
+ },
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 9,
+ "w": 12,
+ "x": 0,
+ "y": 95
+ },
+ "hiddenSeries": false,
+ "id": 24,
+ "interval": "$Interval",
+ "legend": {
+ "alignAsTable": true,
+ "avg": true,
+ "current": true,
+ "hideEmpty": true,
+ "hideZero": true,
+ "max": true,
+ "min": false,
+ "rightSide": false,
+ "show": true,
+ "total": false,
+ "values": true
+ },
+ "lines": false,
+ "linewidth": 1,
+ "links": [
+ {
+ "targetBlank": true,
+ "title": "PostgreSQL Documentation",
+ "url": "https://www.postgresql.org/docs/current/monitoring-stats.html"
+ }
+ ],
+ "nullPointMode": "null as zero",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "10.2.3",
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": true,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "sum by (state) (pg_stat_activity_count{instance=\"$Instance\"})",
+ "legendFormat": "{{state}}",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeRegions": [],
+ "title": "Connections by state (stacked) (Postgres)",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "mode": "time",
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "decimals": 0,
+ "format": "short",
+ "logBase": 1,
+ "show": true
+ },
+ {
+ "decimals": 0,
+ "format": "short",
+ "logBase": 1,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": true,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "decimals": 0,
+ "description": "View: pg_stat_activity",
+ "fieldConfig": {
+ "defaults": {
+ "links": []
+ },
+ "overrides": []
+ },
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 9,
+ "w": 12,
+ "x": 12,
+ "y": 99
+ },
+ "hiddenSeries": false,
+ "id": 121,
+ "interval": "$Interval",
+ "legend": {
+ "alignAsTable": true,
+ "avg": true,
+ "current": true,
+ "hideEmpty": true,
+ "hideZero": true,
+ "max": true,
+ "min": false,
+ "rightSide": false,
+ "show": true,
+ "total": false,
+ "values": true
+ },
+ "lines": false,
+ "linewidth": 1,
+ "links": [
+ {
+ "targetBlank": true,
+ "title": "PostgreSQL Documentation",
+ "url": "https://www.postgresql.org/docs/current/monitoring-stats.html"
+ }
+ ],
+ "nullPointMode": "null as zero",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "10.2.3",
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": true,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "sum by (datname) (pg_stat_activity_count{instance=\"$Instance\"})",
+ "legendFormat": "{{datname}}",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeRegions": [],
+ "title": "Connections by database (stacked) (Postgres)",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "mode": "time",
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "decimals": 0,
+ "format": "short",
+ "logBase": 1,
+ "show": true
+ },
+ {
+ "decimals": 0,
+ "format": "short",
+ "logBase": 1,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "decimals": 2,
+ "description": "1 Minute rate of transactions committed or rollback.",
+ "fieldConfig": {
+ "defaults": {
+ "links": []
+ },
+ "overrides": []
+ },
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 9,
+ "w": 12,
+ "x": 0,
+ "y": 104
+ },
+ "hiddenSeries": false,
+ "id": 122,
+ "interval": "",
+ "legend": {
+ "alignAsTable": true,
+ "avg": true,
+ "current": true,
+ "hideEmpty": false,
+ "hideZero": false,
+ "max": true,
+ "min": false,
+ "rightSide": false,
+ "show": true,
+ "total": false,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "10.2.3",
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "sum ((rate(pg_stat_database_xact_commit[$Interval])))",
+ "interval": "",
+ "legendFormat": "committed",
+ "refId": "A"
+ },
+ {
+ "expr": "sum ((rate(pg_stat_database_xact_rollback[$Interval])))",
+ "hide": false,
+ "interval": "",
+ "legendFormat": "rollback",
+ "refId": "B"
+ }
+ ],
+ "thresholds": [],
+ "timeRegions": [],
+ "title": "Transactions (Postgres)",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "mode": "time",
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "logBase": 1,
+ "show": true
+ },
+ {
+ "format": "short",
+ "logBase": 1,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "description": "Source: pg_stat_database",
+ "fieldConfig": {
+ "defaults": {
+ "links": []
+ },
+ "overrides": []
+ },
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 9,
+ "w": 12,
+ "x": 12,
+ "y": 108
+ },
+ "hiddenSeries": false,
+ "id": 27,
+ "legend": {
+ "alignAsTable": true,
+ "avg": true,
+ "current": true,
+ "hideZero": false,
+ "max": true,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "10.2.3",
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "sum((rate(pg_stat_database_tup_inserted{instance=\"$Instance\"}[$Interval])))",
+ "interval": "",
+ "legendFormat": "Inserts",
+ "refId": "A"
+ },
+ {
+ "expr": "sum((rate(pg_stat_database_tup_updated{instance=\"$Instance\"}[$Interval])))",
+ "interval": "",
+ "legendFormat": "Updates",
+ "refId": "B"
+ },
+ {
+ "expr": "sum((rate(pg_stat_database_tup_deleted{instance=\"$Instance\"}[$Interval])))",
+ "interval": "",
+ "legendFormat": "Deletes",
+ "refId": "C"
+ }
+ ],
+ "thresholds": [],
+ "timeRegions": [],
+ "title": "Tuples inserts/updates/deletes (Postgres)",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "mode": "time",
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "none",
+ "logBase": 1,
+ "min": "0",
+ "show": true
+ },
+ {
+ "format": "short",
+ "logBase": 1,
+ "min": "0",
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "description": "* blk_read_time: Time spent reading data file blocks by backends in this database, in milliseconds\n* blk_write_time: Time spent writing data file blocks by backends in this database, in milliseconds\n\ntrack_io_timings needs to be activated",
+ "fieldConfig": {
+ "defaults": {
+ "links": []
+ },
+ "overrides": []
+ },
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 9,
+ "w": 12,
+ "x": 0,
+ "y": 113
+ },
+ "hiddenSeries": false,
+ "id": 26,
+ "legend": {
+ "alignAsTable": true,
+ "avg": true,
+ "current": true,
+ "max": true,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "10.2.3",
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "sum ((rate(pg_stat_database_blk_read_time{instance=\"$Instance\"}[$Interval])))",
+ "interval": "",
+ "legendFormat": "blk_read_time",
+ "refId": "A"
+ },
+ {
+ "expr": "sum ((rate(pg_stat_database_blk_write_time{instance=\"$Instance\"}[$Interval])))",
+ "interval": "",
+ "legendFormat": "blk_read_time",
+ "refId": "B"
+ }
+ ],
+ "thresholds": [],
+ "timeRegions": [],
+ "title": "I/O Read/Write time (Postgres)",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "mode": "time",
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "ms",
+ "logBase": 1,
+ "min": "0",
+ "show": true
+ },
+ {
+ "format": "short",
+ "logBase": 1,
+ "min": "0",
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "description": "Source: pg_stat_database\n\n* tup_fetched: rows needed to satisfy queries\n* tup_returned: rows read/scanned",
+ "fieldConfig": {
+ "defaults": {
+ "links": []
+ },
+ "overrides": []
+ },
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 9,
+ "w": 12,
+ "x": 12,
+ "y": 117
+ },
+ "hiddenSeries": false,
+ "id": 111,
+ "legend": {
+ "alignAsTable": true,
+ "avg": true,
+ "current": true,
+ "hideZero": false,
+ "max": true,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "10.2.3",
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "sum((rate(pg_stat_database_tup_fetched{instance=\"$Instance\"}[$Interval])))",
+ "interval": "",
+ "legendFormat": "Fetched",
+ "refId": "A"
+ },
+ {
+ "expr": "sum((rate(pg_stat_database_tup_returned{instance=\"$Instance\"}[$Interval])))",
+ "interval": "",
+ "legendFormat": "Returned",
+ "refId": "B"
+ }
+ ],
+ "thresholds": [],
+ "timeRegions": [],
+ "title": "Tuples fetched/returned (Postgres)",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "mode": "time",
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "logBase": 1,
+ "min": "0",
+ "show": true
+ },
+ {
+ "format": "short",
+ "logBase": 1,
+ "min": "0",
+ "show": false
+ }
+ ],
+ "yaxis": {
+ "align": false
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "description": "Source: pg_locks",
+ "fieldConfig": {
+ "defaults": {
+ "links": []
+ },
+ "overrides": []
+ },
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 10,
+ "w": 12,
+ "x": 0,
+ "y": 122
+ },
+ "hiddenSeries": false,
+ "id": 123,
+ "legend": {
+ "alignAsTable": true,
+ "avg": true,
+ "current": true,
+ "max": true,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [
+ {
+ "title": "PostgreSQL Lock Modes",
+ "url": "https://www.postgresql.org/docs/12/explicit-locking.html#LOCKING-TABLES"
+ }
+ ],
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "10.2.3",
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "sum by (mode) (pg_locks_count{instance=\"$Instance\"})",
+ "legendFormat": "{{mode}}",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeRegions": [],
+ "title": "Locks by state (Postgres)",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "mode": "time",
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "none",
+ "logBase": 1,
+ "show": true
+ },
+ {
+ "format": "short",
+ "logBase": 1,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "description": "Should be 0 \n\nSource: pg_stat_database\n\nWith log_lock_waits turned on, deadlocks will be logged to the PostgreSQL Logfiles.",
+ "fieldConfig": {
+ "defaults": {
+ "links": []
+ },
+ "overrides": []
+ },
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 5,
+ "w": 12,
+ "x": 12,
+ "y": 126
+ },
+ "hiddenSeries": false,
+ "id": 30,
+ "legend": {
+ "alignAsTable": true,
+ "avg": true,
+ "current": true,
+ "hideEmpty": true,
+ "hideZero": true,
+ "max": true,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [
+ {
+ "title": "PostgreSQL Locking",
+ "url": "https://www.postgresql.org/docs/12/explicit-locking.html"
+ }
+ ],
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "10.2.3",
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "sum by (datname) ((rate(pg_stat_database_deadlocks{instance=\"$Instance\"}[$Interval])))",
+ "interval": "",
+ "legendFormat": "{{datname}}",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeRegions": [],
+ "title": "Deadlocks by database (Postgres)",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "mode": "time",
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "none",
+ "logBase": 1,
+ "min": "0",
+ "show": true
+ },
+ {
+ "format": "short",
+ "logBase": 1,
+ "min": "0",
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "description": "Should be 0. If temporary files are created, it can indicate insufficient work_mem. With log_temp_files the creation of temporary files are logged to the PostgreSQL Logfiles.",
+ "fieldConfig": {
+ "defaults": {
+ "links": []
+ },
+ "overrides": []
+ },
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 5,
+ "w": 12,
+ "x": 12,
+ "y": 131
+ },
+ "hiddenSeries": false,
+ "id": 31,
+ "legend": {
+ "alignAsTable": true,
+ "avg": true,
+ "current": true,
+ "hideEmpty": true,
+ "hideZero": true,
+ "max": true,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [
+ {
+ "title": "PostgreSQL Ressources",
+ "url": "https://www.postgresql.org/docs/current/runtime-config-resource.html"
+ }
+ ],
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "10.2.3",
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "sum by (datname) ((rate(pg_stat_database_temp_files{instance=\"$Instance\"}[$Interval])))",
+ "interval": "",
+ "legendFormat": "{{datname}}",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeRegions": [],
+ "title": "Temporary files by database (Postgres)",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "mode": "time",
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "none",
+ "logBase": 1,
+ "min": "0",
+ "show": true
+ },
+ {
+ "format": "short",
+ "logBase": 1,
+ "min": "0",
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "description": "Lag behind master in seconds.\n\nOnly available on a standby System.",
+ "fieldConfig": {
+ "defaults": {
+ "links": []
+ },
+ "overrides": []
+ },
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 10,
+ "w": 12,
+ "x": 0,
+ "y": 132
+ },
+ "hiddenSeries": false,
+ "id": 120,
+ "interval": "1m",
+ "legend": {
+ "alignAsTable": true,
+ "avg": true,
+ "current": true,
+ "max": true,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "options": {
+ "alertThreshold": true
+ },
+ "percentage": false,
+ "pluginVersion": "10.2.3",
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "max(pg_replication_lag{instance=\"$Instance\"})",
+ "instant": false,
+ "intervalFactor": 1,
+ "legendFormat": "lag ",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeRegions": [],
+ "title": "Replication lag (Postgres)",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "mode": "time",
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "s",
+ "logBase": 1,
+ "min": "0",
+ "show": true
+ },
+ {
+ "format": "short",
+ "logBase": 1,
+ "min": "0",
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false
+ }
+ }
+ ],
+ "refresh": "1m",
+ "revision": 1,
+ "schemaVersion": 39,
+ "tags": [],
+ "templating": {
+ "list": [
+ {
+ "current": {
+ "selected": false,
+ "text": "postgres-exporter:9187",
+ "value": "postgres-exporter:9187"
+ },
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "definition": "label_values({job=\"postgres-exporter\"}, instance)",
+ "hide": 0,
+ "includeAll": false,
+ "multi": false,
+ "name": "Instance",
+ "options": [],
+ "query": "label_values({job=\"postgres-exporter\"}, instance)",
+ "refresh": 1,
+ "regex": "",
+ "skipUrlSync": false,
+ "sort": 0,
+ "tagValuesQuery": "",
+ "tags": [],
+ "tagsQuery": "",
+ "type": "query",
+ "useTags": false
+ },
+ {
+ "current": {
+ "selected": false,
+ "text": "All",
+ "value": "$__all"
+ },
+ "datasource": {
+ "type": "prometheus",
+ "uid": "PBFA97CFB590B2093"
+ },
+ "definition": "label_values(datname)",
+ "hide": 0,
+ "includeAll": true,
+ "multi": true,
+ "name": "Database",
+ "options": [],
+ "query": "label_values(datname)",
+ "refresh": 1,
+ "regex": "/^(?!template*|postgres).*$/",
+ "skipUrlSync": false,
+ "sort": 1,
+ "tagValuesQuery": "",
+ "tags": [],
+ "tagsQuery": "",
+ "type": "query",
+ "useTags": false
+ },
+ {
+ "auto": true,
+ "auto_count": 30,
+ "auto_min": "10s",
+ "current": {
+ "selected": false,
+ "text": "10m",
+ "value": "10m"
+ },
+ "hide": 0,
+ "name": "Interval",
+ "options": [
+ {
+ "selected": false,
+ "text": "auto",
+ "value": "$__auto_interval_Interval"
+ },
+ {
+ "selected": false,
+ "text": "30sec",
+ "value": "30sec"
+ },
+ {
+ "selected": false,
+ "text": "1m",
+ "value": "1m"
+ },
+ {
+ "selected": true,
+ "text": "10m",
+ "value": "10m"
+ },
+ {
+ "selected": false,
+ "text": "30m",
+ "value": "30m"
+ },
+ {
+ "selected": false,
+ "text": "1h",
+ "value": "1h"
+ },
+ {
+ "selected": false,
+ "text": "6h",
+ "value": "6h"
+ },
+ {
+ "selected": false,
+ "text": "12h",
+ "value": "12h"
+ },
+ {
+ "selected": false,
+ "text": "1d",
+ "value": "1d"
+ }
+ ],
+ "query": "30sec,1m,10m,30m,1h,6h,12h,1d",
+ "queryValue": "",
+ "refresh": 2,
+ "skipUrlSync": false,
+ "type": "interval"
+ }
+ ]
+ },
+ "time": {
+ "from": "now-15m",
+ "to": "now"
+ },
+ "timepicker": {
+ "refresh_intervals": [
+ "1m",
+ "5m",
+ "15m",
+ "30m",
+ "1h",
+ "2h",
+ "1d"
+ ]
+ },
+ "timezone": "browser",
+ "title": "nwaku-monitoring",
+ "uid": "yns_4vFVk",
+ "version": 1,
+ "weekStart": ""
+}
\ No newline at end of file
diff --git a/apps/liteprotocoltester/monitoring/configuration/datasources.yaml b/apps/liteprotocoltester/monitoring/configuration/datasources.yaml
new file mode 100644
index 000000000..9f4f51f86
--- /dev/null
+++ b/apps/liteprotocoltester/monitoring/configuration/datasources.yaml
@@ -0,0 +1,11 @@
+apiVersion: 1
+
+datasources:
+ - name: Prometheus
+ type: prometheus
+ access: proxy
+ org_id: 1
+ url: http://prometheus:9090
+ is_default: true
+ version: 1
+ editable: true
\ No newline at end of file
diff --git a/apps/liteprotocoltester/monitoring/configuration/grafana-plugins.env b/apps/liteprotocoltester/monitoring/configuration/grafana-plugins.env
new file mode 100644
index 000000000..27808098c
--- /dev/null
+++ b/apps/liteprotocoltester/monitoring/configuration/grafana-plugins.env
@@ -0,0 +1,2 @@
+#GF_INSTALL_PLUGINS=grafana-worldmap-panel,grafana-piechart-panel,digrich-bubblechart-panel,yesoreyeram-boomtheme-panel,briangann-gauge-panel,jdbranham-diagram-panel,agenty-flowcharting-panel,citilogics-geoloop-panel,savantly-heatmap-panel,mtanda-histogram-panel,pierosavi-imageit-panel,michaeldmoore-multistat-panel,zuburqan-parity-report-panel,natel-plotly-panel,bessler-pictureit-panel,grafana-polystat-panel,corpglory-progresslist-panel,snuids-radar-panel,fzakaria-simple-config.config.annotations-datasource,vonage-status-panel,snuids-trafficlights-panel,pr0ps-trackmap-panel,alexandra-trackmap-panel,btplc-trend-box-panel
+GF_INSTALL_PLUGINS=grafana-worldmap-panel,grafana-piechart-panel,yesoreyeram-boomtheme-panel,briangann-gauge-panel,pierosavi-imageit-panel,bessler-pictureit-panel,vonage-status-panel
diff --git a/apps/liteprotocoltester/monitoring/configuration/grafana.ini b/apps/liteprotocoltester/monitoring/configuration/grafana.ini
new file mode 100644
index 000000000..f237726b3
--- /dev/null
+++ b/apps/liteprotocoltester/monitoring/configuration/grafana.ini
@@ -0,0 +1,51 @@
+instance_name = nwaku dashboard
+
+;[dashboards.json]
+;enabled = true
+;path = /home/git/grafana/grafana-dashboards/dashboards
+
+
+#################################### Auth ##########################
+[auth]
+disable_login_form = false
+
+#################################### Anonymous Auth ##########################
+[auth.anonymous]
+# enable anonymous access
+enabled = true
+
+# specify organization name that should be used for unauthenticated users
+;org_name = Public
+
+# specify role for unauthenticated users
+org_role = Admin
+; org_role = Viewer
+
+;[security]
+;admin_user = ocr
+;admin_password = ocr
+
+;[users]
+# disable user signup / registration
+;allow_sign_up = false
+
+# Set to true to automatically assign new users to the default organization (id 1)
+;auto_assign_org = true
+
+# Default role new users will be automatically assigned (if disabled above is set to true)
+;auto_assign_org_role = Viewer
+
+#################################### SMTP / Emailing ##########################
+;[smtp]
+;enabled = false
+;host = localhost:25
+;user =
+;password =
+;cert_file =
+;key_file =
+;skip_verify = false
+;from_address = admin@grafana.localhost
+
+;[emails]
+;welcome_email_on_sign_up = false
+
diff --git a/apps/liteprotocoltester/monitoring/configuration/pg-exporter-queries.yml b/apps/liteprotocoltester/monitoring/configuration/pg-exporter-queries.yml
new file mode 100644
index 000000000..bb1d7320a
--- /dev/null
+++ b/apps/liteprotocoltester/monitoring/configuration/pg-exporter-queries.yml
@@ -0,0 +1,284 @@
+pg_replication:
+ query: "SELECT CASE WHEN NOT pg_is_in_recovery() THEN 0 ELSE GREATEST (0, EXTRACT(EPOCH FROM (now() - pg_last_xact_replay_timestamp()))) END AS lag"
+ master: true
+ metrics:
+ - lag:
+ usage: "GAUGE"
+ description: "Replication lag behind master in seconds"
+
+pg_postmaster:
+ query: "SELECT pg_postmaster_start_time as start_time_seconds from pg_postmaster_start_time()"
+ master: true
+ metrics:
+ - start_time_seconds:
+ usage: "GAUGE"
+ description: "Time at which postmaster started"
+
+pg_stat_user_tables:
+ query: |
+ SELECT
+ current_database() datname,
+ schemaname,
+ relname,
+ seq_scan,
+ seq_tup_read,
+ idx_scan,
+ idx_tup_fetch,
+ n_tup_ins,
+ n_tup_upd,
+ n_tup_del,
+ n_tup_hot_upd,
+ n_live_tup,
+ n_dead_tup,
+ n_mod_since_analyze,
+ COALESCE(last_vacuum, '1970-01-01Z') as last_vacuum,
+ COALESCE(last_autovacuum, '1970-01-01Z') as last_autovacuum,
+ COALESCE(last_analyze, '1970-01-01Z') as last_analyze,
+ COALESCE(last_autoanalyze, '1970-01-01Z') as last_autoanalyze,
+ vacuum_count,
+ autovacuum_count,
+ analyze_count,
+ autoanalyze_count
+ FROM
+ pg_stat_user_tables
+ metrics:
+ - datname:
+ usage: "LABEL"
+ description: "Name of current database"
+ - schemaname:
+ usage: "LABEL"
+ description: "Name of the schema that this table is in"
+ - relname:
+ usage: "LABEL"
+ description: "Name of this table"
+ - seq_scan:
+ usage: "COUNTER"
+ description: "Number of sequential scans initiated on this table"
+ - seq_tup_read:
+ usage: "COUNTER"
+ description: "Number of live rows fetched by sequential scans"
+ - idx_scan:
+ usage: "COUNTER"
+ description: "Number of index scans initiated on this table"
+ - idx_tup_fetch:
+ usage: "COUNTER"
+ description: "Number of live rows fetched by index scans"
+ - n_tup_ins:
+ usage: "COUNTER"
+ description: "Number of rows inserted"
+ - n_tup_upd:
+ usage: "COUNTER"
+ description: "Number of rows updated"
+ - n_tup_del:
+ usage: "COUNTER"
+ description: "Number of rows deleted"
+ - n_tup_hot_upd:
+ usage: "COUNTER"
+ description: "Number of rows HOT updated (i.e., with no separate index update required)"
+ - n_live_tup:
+ usage: "GAUGE"
+ description: "Estimated number of live rows"
+ - n_dead_tup:
+ usage: "GAUGE"
+ description: "Estimated number of dead rows"
+ - n_mod_since_analyze:
+ usage: "GAUGE"
+ description: "Estimated number of rows changed since last analyze"
+ - last_vacuum:
+ usage: "GAUGE"
+ description: "Last time at which this table was manually vacuumed (not counting VACUUM FULL)"
+ - last_autovacuum:
+ usage: "GAUGE"
+ description: "Last time at which this table was vacuumed by the autovacuum daemon"
+ - last_analyze:
+ usage: "GAUGE"
+ description: "Last time at which this table was manually analyzed"
+ - last_autoanalyze:
+ usage: "GAUGE"
+ description: "Last time at which this table was analyzed by the autovacuum daemon"
+ - vacuum_count:
+ usage: "COUNTER"
+ description: "Number of times this table has been manually vacuumed (not counting VACUUM FULL)"
+ - autovacuum_count:
+ usage: "COUNTER"
+ description: "Number of times this table has been vacuumed by the autovacuum daemon"
+ - analyze_count:
+ usage: "COUNTER"
+ description: "Number of times this table has been manually analyzed"
+ - autoanalyze_count:
+ usage: "COUNTER"
+ description: "Number of times this table has been analyzed by the autovacuum daemon"
+
+pg_statio_user_tables:
+ query: "SELECT current_database() datname, schemaname, relname, heap_blks_read, heap_blks_hit, idx_blks_read, idx_blks_hit, toast_blks_read, toast_blks_hit, tidx_blks_read, tidx_blks_hit FROM pg_statio_user_tables"
+ metrics:
+ - datname:
+ usage: "LABEL"
+ description: "Name of current database"
+ - schemaname:
+ usage: "LABEL"
+ description: "Name of the schema that this table is in"
+ - relname:
+ usage: "LABEL"
+ description: "Name of this table"
+ - heap_blks_read:
+ usage: "COUNTER"
+ description: "Number of disk blocks read from this table"
+ - heap_blks_hit:
+ usage: "COUNTER"
+ description: "Number of buffer hits in this table"
+ - idx_blks_read:
+ usage: "COUNTER"
+ description: "Number of disk blocks read from all indexes on this table"
+ - idx_blks_hit:
+ usage: "COUNTER"
+ description: "Number of buffer hits in all indexes on this table"
+ - toast_blks_read:
+ usage: "COUNTER"
+ description: "Number of disk blocks read from this table's TOAST table (if any)"
+ - toast_blks_hit:
+ usage: "COUNTER"
+ description: "Number of buffer hits in this table's TOAST table (if any)"
+ - tidx_blks_read:
+ usage: "COUNTER"
+ description: "Number of disk blocks read from this table's TOAST table indexes (if any)"
+ - tidx_blks_hit:
+ usage: "COUNTER"
+ description: "Number of buffer hits in this table's TOAST table indexes (if any)"
+
+# WARNING: This set of metrics can be very expensive on a busy server as every unique query executed will create an additional time series
+pg_stat_statements:
+ query: "SELECT t2.rolname, t3.datname, queryid, calls, ( total_plan_time + total_exec_time ) / 1000 as total_time_seconds, ( min_plan_time + min_exec_time ) / 1000 as min_time_seconds, ( max_plan_time + max_exec_time ) / 1000 as max_time_seconds, ( mean_plan_time + mean_exec_time ) / 1000 as mean_time_seconds, ( stddev_plan_time + stddev_exec_time ) / 1000 as stddev_time_seconds, rows, shared_blks_hit, shared_blks_read, shared_blks_dirtied, shared_blks_written, local_blks_hit, local_blks_read, local_blks_dirtied, local_blks_written, temp_blks_read, temp_blks_written, blk_read_time / 1000 as blk_read_time_seconds, blk_write_time / 1000 as blk_write_time_seconds FROM pg_stat_statements t1 JOIN pg_roles t2 ON (t1.userid=t2.oid) JOIN pg_database t3 ON (t1.dbid=t3.oid) WHERE t2.rolname != 'rdsadmin' AND queryid IS NOT NULL"
+ master: true
+ metrics:
+ - rolname:
+ usage: "LABEL"
+ description: "Name of user"
+ - datname:
+ usage: "LABEL"
+ description: "Name of database"
+ - queryid:
+ usage: "LABEL"
+ description: "Query ID"
+ - calls:
+ usage: "COUNTER"
+ description: "Number of times executed"
+ - total_time_seconds:
+ usage: "COUNTER"
+ description: "Total time spent in the statement, in milliseconds"
+ - min_time_seconds:
+ usage: "GAUGE"
+ description: "Minimum time spent in the statement, in milliseconds"
+ - max_time_seconds:
+ usage: "GAUGE"
+ description: "Maximum time spent in the statement, in milliseconds"
+ - mean_time_seconds:
+ usage: "GAUGE"
+ description: "Mean time spent in the statement, in milliseconds"
+ - stddev_time_seconds:
+ usage: "GAUGE"
+ description: "Population standard deviation of time spent in the statement, in milliseconds"
+ - rows:
+ usage: "COUNTER"
+ description: "Total number of rows retrieved or affected by the statement"
+ - shared_blks_hit:
+ usage: "COUNTER"
+ description: "Total number of shared block cache hits by the statement"
+ - shared_blks_read:
+ usage: "COUNTER"
+ description: "Total number of shared blocks read by the statement"
+ - shared_blks_dirtied:
+ usage: "COUNTER"
+ description: "Total number of shared blocks dirtied by the statement"
+ - shared_blks_written:
+ usage: "COUNTER"
+ description: "Total number of shared blocks written by the statement"
+ - local_blks_hit:
+ usage: "COUNTER"
+ description: "Total number of local block cache hits by the statement"
+ - local_blks_read:
+ usage: "COUNTER"
+ description: "Total number of local blocks read by the statement"
+ - local_blks_dirtied:
+ usage: "COUNTER"
+ description: "Total number of local blocks dirtied by the statement"
+ - local_blks_written:
+ usage: "COUNTER"
+ description: "Total number of local blocks written by the statement"
+ - temp_blks_read:
+ usage: "COUNTER"
+ description: "Total number of temp blocks read by the statement"
+ - temp_blks_written:
+ usage: "COUNTER"
+ description: "Total number of temp blocks written by the statement"
+ - blk_read_time_seconds:
+ usage: "COUNTER"
+ description: "Total time the statement spent reading blocks, in milliseconds (if track_io_timing is enabled, otherwise zero)"
+ - blk_write_time_seconds:
+ usage: "COUNTER"
+ description: "Total time the statement spent writing blocks, in milliseconds (if track_io_timing is enabled, otherwise zero)"
+
+pg_process_idle:
+ query: |
+ WITH
+ metrics AS (
+ SELECT
+ application_name,
+ SUM(EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - state_change))::bigint)::float AS process_idle_seconds_sum,
+ COUNT(*) AS process_idle_seconds_count
+ FROM pg_stat_activity
+ WHERE state = 'idle'
+ GROUP BY application_name
+ ),
+ buckets AS (
+ SELECT
+ application_name,
+ le,
+ SUM(
+ CASE WHEN EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - state_change)) <= le
+ THEN 1
+ ELSE 0
+ END
+ )::bigint AS bucket
+ FROM
+ pg_stat_activity,
+ UNNEST(ARRAY[1, 2, 5, 15, 30, 60, 90, 120, 300]) AS le
+ GROUP BY application_name, le
+ ORDER BY application_name, le
+ )
+ SELECT
+ application_name,
+ process_idle_seconds_sum as seconds_sum,
+ process_idle_seconds_count as seconds_count,
+ ARRAY_AGG(le) AS seconds,
+ ARRAY_AGG(bucket) AS seconds_bucket
+ FROM metrics JOIN buckets USING (application_name)
+ GROUP BY 1, 2, 3
+ metrics:
+ - application_name:
+ usage: "LABEL"
+ description: "Application Name"
+ - seconds:
+ usage: "HISTOGRAM"
+ description: "Idle time of server processes"
+
+pg_tb_stats:
+ query: |
+ select pubsubtopic, count(*) AS messages FROM (SELECT id, array_agg(pubsubtopic ORDER BY pubsubtopic) AS pubsubtopic FROM messages GROUP BY id) sub GROUP BY pubsubtopic ORDER BY pubsubtopic;
+ metrics:
+ - pubsubtopic:
+ usage: "LABEL"
+ description: "pubsubtopic"
+ - messages:
+ usage: "GAUGE"
+ description: "Number of messages for the given pubsub topic"
+
+pg_tb_messages:
+ query: |
+ SELECT
+ COUNT(ID)
+ FROM messages
+ metrics:
+ - count:
+ usage: "GAUGE"
+ description: "Row count in `messages` table"
diff --git a/apps/liteprotocoltester/monitoring/configuration/postgres-exporter.yml b/apps/liteprotocoltester/monitoring/configuration/postgres-exporter.yml
new file mode 100644
index 000000000..a8380dd72
--- /dev/null
+++ b/apps/liteprotocoltester/monitoring/configuration/postgres-exporter.yml
@@ -0,0 +1,9 @@
+auth_modules:
+ mypostgres:
+ type: userpass
+ userpass:
+ username: postgres
+ password: ${POSTGRES_PASSWORD}
+ options:
+ # options become key=value parameters of the DSN
+ sslmode: disable
diff --git a/apps/liteprotocoltester/monitoring/prometheus-config.yml b/apps/liteprotocoltester/monitoring/prometheus-config.yml
new file mode 100644
index 000000000..650798fdc
--- /dev/null
+++ b/apps/liteprotocoltester/monitoring/prometheus-config.yml
@@ -0,0 +1,10 @@
+global:
+ scrape_interval: 15s
+ evaluation_interval: 15s
+ external_labels:
+ monitor: "Monitoring"
+
+scrape_configs:
+ - job_name: "nwaku"
+ static_configs:
+ - targets: ["nwaku:8003"]
diff --git a/apps/liteprotocoltester/run_service_node.sh b/apps/liteprotocoltester/run_service_node.sh
new file mode 100644
index 000000000..5cce31a95
--- /dev/null
+++ b/apps/liteprotocoltester/run_service_node.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+echo "I am a service node"
+IP=$(ip a | grep "inet " | grep -Fv 127.0.0.1 | sed 's/.*inet \([^/]*\).*/\1/')
+
+echo "Service node IP: ${IP}"
+
+exec /usr/bin/wakunode\
+ --relay=true\
+ --filter=true\
+ --lightpush=true\
+ --store=false\
+ --rest=true\
+ --rest-admin=true\
+ --rest-private=true\
+ --rest-address=0.0.0.0\
+ --rest-allow-origin="*"\
+ --keep-alive=true\
+ --max-connections=300\
+ --dns-discovery=true\
+ --discv5-discovery=true\
+ --discv5-enr-auto-update=True\
+ --log-level=DEBUG\
+ --metrics-server=True\
+ --metrics-server-address=0.0.0.0\
+ --nodekey=e3f5e64568b3a612dee609f6e7c0203c501dab6131662922bdcbcabd474281d5\
+ --nat=extip:${IP}\
+ --pubsub-topic=/waku/2/default-waku/proto\
+ --cluster-id=0
diff --git a/apps/liteprotocoltester/run_tester_node.sh b/apps/liteprotocoltester/run_tester_node.sh
new file mode 100644
index 000000000..a96c0561e
--- /dev/null
+++ b/apps/liteprotocoltester/run_tester_node.sh
@@ -0,0 +1,76 @@
+#!/bin/sh
+
+if test -f .env; then
+ echo "Using .env file"
+ . $(pwd)/.env
+fi
+
+IP=$(ip a | grep "inet " | grep -Fv 127.0.0.1 | sed 's/.*inet \([^/]*\).*/\1/')
+
+echo "I am a lite-protocol-tester node"
+
+# Get an unique node index based on the container's IP
+FOURTH_OCTET=${IP##*.}
+THIRD_OCTET="${IP%.*}"; THIRD_OCTET="${THIRD_OCTET##*.}"
+NODE_INDEX=$((FOURTH_OCTET + 256 * THIRD_OCTET))
+
+echo "NODE_INDEX $NODE_INDEX"
+
+RETRIES=${RETRIES:=10}
+
+while [ -z "${SERIVCE_NODE_ADDR}" ] && [ ${RETRIES} -ge 0 ]; do
+ SERIVCE_NODE_ADDR=$(wget -qO- http://servicenode:8645/debug/v1/info --header='Content-Type:application/json' 2> /dev/null | sed 's/.*"listenAddresses":\["\([^"]*\)".*/\1/');
+ echo "Service node not ready, retrying (retries left: ${RETRIES})"
+ sleep 1
+ RETRIES=$(( $RETRIES - 1 ))
+done
+
+if [ -z "${SERIVCE_NODE_ADDR}" ]; then
+ echo "Could not get SERIVCE_NODE_ADDR and none provided. Failing"
+ exit 1
+fi
+
+
+if [ -n "${PUBSUB}" ]; then
+ PUBSUB=--pubsub-topic="${PUBSUB}"
+fi
+
+if [ -n "${CONTENT_TOPIC}" ]; then
+ CONTENT_TOPIC=--content-topic="${CONTENT_TOPIC}"
+fi
+
+FUNCTION=$1
+
+echo "Tester node: ${FUNCTION}"
+
+REST_PORT=--rest-port=8647
+
+if [ "${FUNCTION}" = "SENDER" ]; then
+ FUNCTION=--test-func=SENDER
+ REST_PORT=--rest-port=8646
+fi
+
+if [ "${FUNCTION}" = "RECEIVER" ]; then
+ FUNCTION=--test-func=RECEIVER
+ REST_PORT=--rest-port=8647
+fi
+
+if [ -z "${FUNCTION}" ]; then
+ FUNCTION=--test-func=RECEIVER
+fi
+
+echo "Using service node: ${SERIVCE_NODE_ADDR}"
+exec /usr/bin/liteprotocoltester\
+ --log-level=DEBUG\
+ --service-node="${SERIVCE_NODE_ADDR}"\
+ --pubsub-topic=/waku/2/default-waku/proto\
+ --cluster-id=0\
+ --num-messages=${NUM_MESSAGES}\
+ --delay-messages=${DELAY_MESSAGES}\
+ --nat=extip:${IP}\
+ ${FUNCTION}\
+ ${PUBSUB}\
+ ${CONTENT_TOPIC}\
+ ${REST_PORT}
+
+ # --config-file=config.toml\
diff --git a/apps/liteprotocoltester/statistics.nim b/apps/liteprotocoltester/statistics.nim
new file mode 100644
index 000000000..c5f27df4e
--- /dev/null
+++ b/apps/liteprotocoltester/statistics.nim
@@ -0,0 +1,201 @@
+when (NimMajor, NimMinor) < (1, 4):
+ {.push raises: [Defect].}
+else:
+ {.push raises: [].}
+
+import
+ std/[sets, tables, strutils, sequtils, options, strformat],
+ chronos/timer as chtimer,
+ chronicles,
+ results
+
+import ./tester_message
+
+type
+ StatHelper = object
+ prevIndex: uint32
+ prevArrivedAt: Moment
+ lostIndices: HashSet[uint32]
+ seenIndices: HashSet[uint32]
+
+ Statistics* = object
+ allMessageCount*: uint32
+ receivedMessages*: uint32
+ misorderCount*: uint32
+ lateCount*: uint32
+ duplicateCount*: uint32
+ minLatency*: Duration
+ maxLatency*: Duration
+ cummulativeLatency: Duration
+ helper: StatHelper
+
+ PerPeerStatistics* = Table[string, Statistics]
+
+func `$`*(a: Duration): string {.inline.} =
+ ## Original stringify implementation from chronos/timer.nim is not capable of printing 0ns
+ ## Returns string representation of Duration ``a`` as nanoseconds value.
+
+ if a.isZero:
+ return "0ns"
+
+ return chtimer.`$`(a)
+
+proc init*(T: type Statistics, expectedMessageCount: int = 1000): T =
+ result.helper.prevIndex = 0
+ result.helper.seenIndices.init(expectedMessageCount)
+ result.minLatency = nanos(0)
+ result.maxLatency = nanos(0)
+ result.cummulativeLatency = nanos(0)
+ return result
+
+proc addMessage*(self: var Statistics, msg: ProtocolTesterMessage) =
+ if self.allMessageCount == 0:
+ self.allMessageCount = msg.count
+ elif self.allMessageCount != msg.count:
+ warn "Message count mismatch at message",
+ index = msg.index, expected = self.allMessageCount, got = msg.count
+
+ if not self.helper.seenIndices.contains(msg.index):
+ self.helper.seenIndices.incl(msg.index)
+ else:
+ inc(self.duplicateCount)
+ warn "Duplicate message", index = msg.index
+ ## just do not count into stats
+ return
+
+ ## detect misorder arrival and possible lost messages
+ if self.helper.prevIndex + 1 < msg.index:
+ inc(self.misorderCount)
+ warn "Misordered message arrival",
+ index = msg.index, expected = self.helper.prevIndex + 1
+
+ ## collect possible lost message indicies
+ for idx in self.helper.prevIndex + 1 ..< msg.index:
+ self.helper.lostIndices.incl(idx)
+ elif self.helper.prevIndex > msg.index:
+ inc(self.lateCount)
+ warn "Late message arrival", index = msg.index, expected = self.helper.prevIndex + 1
+ else:
+ ## may remove late arrival
+ self.helper.lostIndices.excl(msg.index)
+
+ ## calculate latency
+ let currentArrivedAt = Moment.now()
+
+ let delaySincePrevArrived: Duration = currentArrivedAt - self.helper.prevArrivedAt
+
+ let expectedDelay: Duration = nanos(msg.sincePrev)
+
+ var latency: Duration
+
+ # if we have any latency...
+ if expectedDelay > delaySincePrevArrived:
+ latency = delaySincePrevArrived - expectedDelay
+ if self.minLatency.isZero or (latency < self.minLatency and latency > nanos(0)):
+ self.minLatency = latency
+ if latency > self.maxLatency:
+ self.maxLatency = latency
+ self.cummulativeLatency += latency
+ else:
+ warn "Negative latency detected",
+ index = msg.index, expected = expectedDelay, actual = delaySincePrevArrived
+
+ self.helper.prevIndex = msg.index
+ self.helper.prevArrivedAt = currentArrivedAt
+ inc(self.receivedMessages)
+
+proc addMessage*(
+ self: var PerPeerStatistics, peerId: string, msg: ProtocolTesterMessage
+) =
+ if not self.contains(peerId):
+ self[peerId] = Statistics.init()
+
+ discard catch:
+ self[peerId].addMessage(msg)
+
+proc lossCount*(self: Statistics): uint32 =
+ self.allMessageCount - self.receivedMessages
+
+proc averageLatency*(self: Statistics): Duration =
+ if self.receivedMessages == 0:
+ return nanos(0)
+ return self.cummulativeLatency div self.receivedMessages
+
+proc echoStat*(self: Statistics) =
+ let printable = catch:
+ """*-----------------------------------------------------------------------------*
+| Expected | Reveived | Loss | Misorder | Late | Duplicate |
+|{self.allMessageCount:>11} |{self.receivedMessages:>11} |{self.lossCount():>11} |{self.misorderCount:>11} |{self.lateCount:>11} |{self.duplicateCount:>11} |
+*-----------------------------------------------------------------------------*
+| Latency stat: |
+| avg latency: {$self.averageLatency():<60}|
+| min latency: {$self.maxLatency:<60}|
+| max latency: {$self.minLatency:<60}|
+*-----------------------------------------------------------------------------*""".fmt()
+
+ if printable.isErr():
+ echo "Error while printing statistics: " & printable.error().msg
+ else:
+ echo printable.get()
+
+proc jsonStat*(self: Statistics): string =
+ let json = catch:
+ """{{"expected":{self.allMessageCount},
+ "received": {self.receivedMessages},
+ "loss": {self.lossCount()},
+ "misorder": {self.misorderCount},
+ "late": {self.lateCount},
+ "duplicate": {self.duplicateCount},
+ "latency":
+ {{"avg": "{self.averageLatency()}",
+ "min": "{self.minLatency}",
+ "max": "{self.maxLatency}"
+ }}
+ }}""".fmt()
+ if json.isErr:
+ return "{\"result:\": \"" & json.error.msg & "\"}"
+
+ return json.get()
+
+proc echoStats*(self: var PerPeerStatistics) =
+ for peerId, stats in self.pairs:
+ let peerLine = catch:
+ "Receiver statistics from peer {peerId}".fmt()
+ if peerLine.isErr:
+ echo "Error while printing statistics"
+ else:
+ echo peerLine.get()
+ stats.echoStat()
+
+proc jsonStats*(self: PerPeerStatistics): string =
+ try:
+ #!fmt: off
+ var json = "{\"statistics\": ["
+ var first = true
+ for peerId, stats in self.pairs:
+ if first:
+ first = false
+ else:
+ json.add(", ")
+ json.add("{{\"sender\": \"{peerId}\", \"stat\":".fmt())
+ json.add(stats.jsonStat())
+ json.add("}")
+ json.add("]}")
+ return json
+ #!fmt: on
+ except CatchableError:
+ return
+ "{\"result:\": \"Error while generating json stats: " & getCurrentExceptionMsg() &
+ "\"}"
+
+proc checkIfAllMessagesReceived*(self: PerPeerStatistics): bool =
+ # if there are no peers have sent messages, assume we just have started.
+ if self.len == 0:
+ return false
+
+ for stat in self.values:
+ if (stat.allMessageCount == 0 and stat.receivedMessages == 0) or
+ stat.receivedMessages < stat.allMessageCount:
+ return false
+
+ return true
diff --git a/apps/liteprotocoltester/tester_config.nim b/apps/liteprotocoltester/tester_config.nim
new file mode 100644
index 000000000..2c276d16a
--- /dev/null
+++ b/apps/liteprotocoltester/tester_config.nim
@@ -0,0 +1,146 @@
+import
+ std/[strutils, strformat],
+ stew/results,
+ chronos,
+ regex,
+ confutils,
+ confutils/defs,
+ confutils/std/net,
+ confutils/toml/defs as confTomlDefs,
+ confutils/toml/std/net as confTomlNet,
+ libp2p/crypto/crypto,
+ libp2p/crypto/secp,
+ libp2p/multiaddress,
+ nimcrypto/utils,
+ secp256k1,
+ json
+import
+ ../../waku/common/confutils/envvar/defs as confEnvvarDefs,
+ ../../waku/common/confutils/envvar/std/net as confEnvvarNet,
+ ../../waku/common/logging,
+ ../../waku/factory/external_config,
+ ../../waku/waku_core
+
+export confTomlDefs, confTomlNet, confEnvvarDefs, confEnvvarNet
+
+const
+ LitePubsubTopic* = PubsubTopic("/waku/2/default-waku/proto")
+ LiteContentTopic* = ContentTopic("/tester/1/light-pubsub-example/proto")
+
+type TesterFunctionality* = enum
+ SENDER # pumps messages to the network
+ RECEIVER # gather and analyze messages from the network
+
+type LiteProtocolTesterConf* = object
+ configFile* {.
+ desc:
+ "Loads configuration from a TOML file (cmd-line parameters take precedence) for the light waku node",
+ name: "config-file"
+ .}: Option[InputFile]
+
+ ## Log configuration
+ logLevel* {.
+ desc:
+ "Sets the log level for process. Supported levels: TRACE, DEBUG, INFO, NOTICE, WARN, ERROR or FATAL",
+ defaultValue: logging.LogLevel.DEBUG,
+ name: "log-level"
+ .}: logging.LogLevel
+
+ logFormat* {.
+ desc:
+ "Specifies what kind of logs should be written to stdout. Suported formats: TEXT, JSON",
+ defaultValue: logging.LogFormat.TEXT,
+ name: "log-format"
+ .}: logging.LogFormat
+
+ ## Test configuration
+ servicenode* {.desc: "Peer multiaddr of the service node.", name: "service-node".}:
+ string
+
+ nat* {.
+ desc:
+ "Specify method to use for determining public address. " &
+ "Must be one of: any, none, upnp, pmp, extip:.",
+ defaultValue: "any"
+ .}: string
+
+ testFunc* {.
+ desc: "Specifies the lite protocol tester side. Supported values: sender, receiver.",
+ defaultValue: TesterFunctionality.RECEIVER,
+ name: "test-func"
+ .}: TesterFunctionality
+
+ numMessages* {.
+ desc: "Number of messages to send.", defaultValue: 120, name: "num-messages"
+ .}: uint32
+
+ delayMessages* {.
+ desc: "Delay between messages in milliseconds.",
+ defaultValue: 1000,
+ name: "delay-messages"
+ .}: uint32
+
+ pubsubTopics* {.
+ desc: "Default pubsub topic to subscribe to. Argument may be repeated.",
+ defaultValue: @[LitePubsubTopic],
+ name: "pubsub-topic"
+ .}: seq[PubsubTopic]
+
+ ## TODO: extend lite protocol tester configuration based on testing needs
+ # shards* {.
+ # desc: "Shards index to subscribe to [0..MAX_SHARDS-1]. Argument may be repeated.",
+ # defaultValue: @[],
+ # name: "shard"
+ # .}: seq[ShardIdx]
+ contentTopics* {.
+ desc: "Default content topic to subscribe to. Argument may be repeated.",
+ defaultValue: @[LiteContentTopic],
+ name: "content-topic"
+ .}: seq[ContentTopic]
+
+ clusterId* {.
+ desc:
+ "Cluster id that the node is running in. Node in a different cluster id is disconnected.",
+ defaultValue: 0,
+ name: "cluster-id"
+ .}: uint32
+
+ ## Tester REST service configuration
+ restAddress* {.
+ desc: "Listening address of the REST HTTP server.",
+ defaultValue: parseIpAddress("127.0.0.1"),
+ name: "rest-address"
+ .}: IpAddress
+
+ restPort* {.
+ desc: "Listening port of the REST HTTP server.",
+ defaultValue: 8654,
+ name: "rest-port"
+ .}: uint16
+
+ restAllowOrigin* {.
+ desc:
+ "Allow cross-origin requests from the specified origin." &
+ "Argument may be repeated." & "Wildcards: * or ? allowed." &
+ "Ex.: \"localhost:*\" or \"127.0.0.1:8080\"",
+ defaultValue: @["*"],
+ name: "rest-allow-origin"
+ .}: seq[string]
+
+{.push warning[ProveInit]: off.}
+
+proc load*(T: type LiteProtocolTesterConf, version = ""): ConfResult[T] =
+ try:
+ let conf = LiteProtocolTesterConf.load(
+ version = version,
+ secondarySources = proc(
+ conf: LiteProtocolTesterConf, sources: auto
+ ) {.gcsafe, raises: [ConfigurationError].} =
+ sources.addConfigFile(Envvar, InputFile("liteprotocoltester"))
+ ,
+ )
+ ok(conf)
+ except CatchableError:
+ err(getCurrentExceptionMsg())
+
+{.pop.}
diff --git a/apps/liteprotocoltester/tester_message.nim b/apps/liteprotocoltester/tester_message.nim
new file mode 100644
index 000000000..635a31ab4
--- /dev/null
+++ b/apps/liteprotocoltester/tester_message.nim
@@ -0,0 +1,111 @@
+when (NimMajor, NimMinor) < (1, 4):
+ {.push raises: [Defect].}
+else:
+ {.push raises: [].}
+
+import
+ chronicles,
+ json_serialization,
+ json_serialization/std/options,
+ json_serialization/lexer
+
+import ../../waku/waku_api/rest/serdes
+
+type ProtocolTesterMessage* = object
+ sender*: string
+ index*: uint32
+ count*: uint32
+ startedAt*: int64
+ sinceStart*: int64
+ sincePrev*: int64
+
+proc writeValue*(
+ writer: var JsonWriter[RestJson], value: ProtocolTesterMessage
+) {.raises: [IOError].} =
+ writer.beginRecord()
+ writer.writeField("sender", value.sender)
+ writer.writeField("index", value.index)
+ writer.writeField("count", value.count)
+ writer.writeField("startedAt", value.startedAt)
+ writer.writeField("sinceStart", value.sinceStart)
+ writer.writeField("sincePrev", value.sincePrev)
+ writer.endRecord()
+
+proc readValue*(
+ reader: var JsonReader[RestJson], value: var ProtocolTesterMessage
+) {.gcsafe, raises: [SerializationError, IOError].} =
+ var
+ sender: Option[string]
+ index: Option[uint32]
+ count: Option[uint32]
+ startedAt: Option[int64]
+ sinceStart: Option[int64]
+ sincePrev: Option[int64]
+
+ for fieldName in readObjectFields(reader):
+ case fieldName
+ of "sender":
+ if sender.isSome():
+ reader.raiseUnexpectedField(
+ "Multiple `sender` fields found", "ProtocolTesterMessage"
+ )
+ sender = some(reader.readValue(string))
+ of "index":
+ if index.isSome():
+ reader.raiseUnexpectedField(
+ "Multiple `index` fields found", "ProtocolTesterMessage"
+ )
+ index = some(reader.readValue(uint32))
+ of "count":
+ if count.isSome():
+ reader.raiseUnexpectedField(
+ "Multiple `count` fields found", "ProtocolTesterMessage"
+ )
+ count = some(reader.readValue(uint32))
+ of "startedAt":
+ if startedAt.isSome():
+ reader.raiseUnexpectedField(
+ "Multiple `startedAt` fields found", "ProtocolTesterMessage"
+ )
+ startedAt = some(reader.readValue(int64))
+ of "sinceStart":
+ if sinceStart.isSome():
+ reader.raiseUnexpectedField(
+ "Multiple `sinceStart` fields found", "ProtocolTesterMessage"
+ )
+ sinceStart = some(reader.readValue(int64))
+ of "sincePrev":
+ if sincePrev.isSome():
+ reader.raiseUnexpectedField(
+ "Multiple `sincePrev` fields found", "ProtocolTesterMessage"
+ )
+ sincePrev = some(reader.readValue(int64))
+ else:
+ unrecognizedFieldWarning()
+
+ if sender.isNone():
+ reader.raiseUnexpectedValue("Field `sender` is missing")
+
+ if index.isNone():
+ reader.raiseUnexpectedValue("Field `index` is missing")
+
+ if count.isNone():
+ reader.raiseUnexpectedValue("Field `count` is missing")
+
+ if startedAt.isNone():
+ reader.raiseUnexpectedValue("Field `startedAt` is missing")
+
+ if sinceStart.isNone():
+ reader.raiseUnexpectedValue("Field `sinceStart` is missing")
+
+ if sincePrev.isNone():
+ reader.raiseUnexpectedValue("Field `sincePrev` is missing")
+
+ value = ProtocolTesterMessage(
+ sender: sender.get(),
+ index: index.get(),
+ count: count.get(),
+ startedAt: startedAt.get(),
+ sinceStart: sinceStart.get(),
+ sincePrev: sincePrev.get(),
+ )
diff --git a/waku.nimble b/waku.nimble
index 1ca4f7913..e883a4ff7 100644
--- a/waku.nimble
+++ b/waku.nimble
@@ -102,6 +102,10 @@ task chat2bridge, "Build chat2bridge":
let name = "chat2bridge"
buildBinary name, "apps/chat2bridge/"
+task liteprotocoltester, "Build liteprotocoltester":
+ let name = "liteprotocoltester"
+ buildBinary name, "apps/liteprotocoltester/"
+
### C Bindings
task libwakuStatic, "Build the cbindings waku node library":
let name = "libwaku"