Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects

Adding prometheus metrics to Backup agent

Merged Victor PARERA requested to merge add_prometheus_metrics into main
1 file
+ 454
33
Compare changes
  • Side-by-side
  • Inline
+ 454
33
@@ -440,7 +440,7 @@
"upload": false,
"swaggerDoc": "",
"x": 150,
"y": 680,
"y": 920,
"wires": [
[
"cf1967dae9ee9c24"
@@ -457,7 +457,7 @@
"Content-Type": "text/plain"
},
"x": 750,
"y": 680,
"y": 920,
"wires": []
},
{
@@ -473,10 +473,11 @@
"encoding": "none",
"allProps": false,
"x": 590,
"y": 680,
"y": 920,
"wires": [
[
"92b7e972689617e0"
"92b7e972689617e0",
"b491dd87c278e7f4"
]
]
},
@@ -499,8 +500,8 @@
"from": "",
"to": "",
"reg": false,
"x": 380,
"y": 680,
"x": 370,
"y": 920,
"wires": [
[
"521542752cce5ded"
@@ -530,7 +531,8 @@
"y": 600,
"wires": [
[
"eafbf4a8940b9583"
"eafbf4a8940b9583",
"f26f963184b31cf9"
]
]
},
@@ -616,7 +618,8 @@
"y": 280,
"wires": [
[
"91830caa04799776"
"91830caa04799776",
"0baf5da7cab5439f"
]
]
},
@@ -643,7 +646,8 @@
"y": 60,
"wires": [
[
"6e8eb47f3fdc63b2"
"6e8eb47f3fdc63b2",
"9f48f522273859df"
]
]
},
@@ -703,7 +707,7 @@
],
"uncaught": false,
"x": 580,
"y": 760,
"y": 1280,
"wires": [
[
"8428bb0312c4588a"
@@ -718,7 +722,7 @@
"statusCode": "404",
"headers": {},
"x": 960,
"y": 760,
"y": 1280,
"wires": []
},
{
@@ -741,10 +745,11 @@
"to": "",
"reg": false,
"x": 770,
"y": 760,
"y": 1280,
"wires": [
[
"b9b924e8b2a346d0"
"b9b924e8b2a346d0",
"ba0874becffe667c"
]
]
},
@@ -757,8 +762,8 @@
"method": "delete",
"upload": false,
"swaggerDoc": "",
"x": 160,
"y": 940,
"x": 140,
"y": 1700,
"wires": [
[
"c95354d6131a3d10"
@@ -784,8 +789,8 @@
"from": "",
"to": "",
"reg": false,
"x": 400,
"y": 940,
"x": 380,
"y": 1700,
"wires": [
[
"0912d4f9b58b955a"
@@ -811,11 +816,12 @@
"from": "",
"to": "",
"reg": false,
"x": 810,
"y": 880,
"x": 790,
"y": 1640,
"wires": [
[
"90a495504adb9469"
"90a495504adb9469",
"8446cbbe0054551f"
]
]
},
@@ -826,8 +832,8 @@
"name": "",
"statusCode": "404",
"headers": {},
"x": 1000,
"y": 880,
"x": 980,
"y": 1640,
"wires": []
},
{
@@ -837,8 +843,8 @@
"name": "",
"statusCode": "204",
"headers": {},
"x": 780,
"y": 1000,
"x": 980,
"y": 1760,
"wires": []
},
{
@@ -893,7 +899,8 @@
"y": 520,
"wires": [
[
"eafbf4a8940b9583"
"eafbf4a8940b9583",
"f26f963184b31cf9"
]
]
},
@@ -976,8 +983,8 @@
"name": "",
"statusCode": "404",
"headers": {},
"x": 1000,
"y": 940,
"x": 980,
"y": 1700,
"wires": []
},
{
@@ -999,11 +1006,12 @@
"from": "",
"to": "",
"reg": false,
"x": 810,
"y": 940,
"x": 790,
"y": 1700,
"wires": [
[
"8b15972d85b748d8"
"8b15972d85b748d8",
"8446cbbe0054551f"
]
]
},
@@ -1012,8 +1020,8 @@
"type": "subflow:b381220f9e27e532",
"z": "fe34ef79ce56a57b",
"name": "",
"x": 610,
"y": 940,
"x": 590,
"y": 1700,
"wires": [
[
"21b29bfde259e5a3"
@@ -1022,7 +1030,7 @@
"7f83382f03026d19"
],
[
"d07b35acb6650a47"
"cff2b4b5665ee27d"
]
]
},
@@ -1038,5 +1046,418 @@
[],
[]
]
},
{
"id": "7b856c4a09c3e281",
"type": "template",
"z": "fe34ef79ce56a57b",
"name": "Prometheus",
"field": "payload.req_dumps",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "# HELP dump_requested_total Number of dump requested\n# TYPE dump_requested_total counter\ndump_requested_total {{msg.payload.req_dumps}}",
"output": "str",
"x": 1350,
"y": 560,
"wires": [
[]
]
},
{
"id": "f26f963184b31cf9",
"type": "function",
"z": "fe34ef79ce56a57b",
"name": "function 2",
"func": "var counter = flow.get(\"counter\") || 0\n\ncounter ++\n\nflow.set(\"counter\", counter)\nmsg.payload.req_dumps = counter\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1080,
"y": 560,
"wires": [
[
"3b0f8c578ac21d42",
"7b856c4a09c3e281"
]
]
},
{
"id": "3b0f8c578ac21d42",
"type": "debug",
"z": "fe34ef79ce56a57b",
"name": "debug 2",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload.req_dumps",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1260,
"y": 660,
"wires": []
},
{
"id": "ed734684cb9b2c24",
"type": "template",
"z": "fe34ef79ce56a57b",
"name": "Prometheus Failed Dumps",
"field": "payload.req_dumps",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "# HELP failed_dump_creation_total Number of dump requested but failed\n# TYPE failed_dump_creation_total counter\nfailed_dump_creation_total {{msg.payload.failed_dump_creation}}",
"output": "str",
"x": 1140,
"y": 360,
"wires": [
[]
]
},
{
"id": "0baf5da7cab5439f",
"type": "function",
"z": "fe34ef79ce56a57b",
"name": "function 3",
"func": "var failed_dump_creation_counter = flow.get(\"failed_dump_creation_counter\") || 0\n\nfailed_dump_creation_counter ++\n\nflow.set(\"failed_dump_creation_counter\", failed_dump_creation_counter)\nmsg.payload.failed_dump_creation = failed_dump_creation_counter\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 820,
"y": 360,
"wires": [
[
"af1f9b29f7eff906",
"ed734684cb9b2c24"
]
]
},
{
"id": "af1f9b29f7eff906",
"type": "debug",
"z": "fe34ef79ce56a57b",
"name": "debug 3",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload.failed_dump_creation",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1000,
"y": 460,
"wires": []
},
{
"id": "984daa617a8e4c53",
"type": "template",
"z": "fe34ef79ce56a57b",
"name": "Prometheus Success Dumps",
"field": "payload.success_dump_creation",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "# HELP success_dump_creation_total Number of success dump requested\n# TYPE success_dump_creation_total counter\nsuccess_dump_creation_total {{msg.payload.success_dump_creation}}",
"output": "str",
"x": 1300,
"y": 80,
"wires": [
[]
]
},
{
"id": "9f48f522273859df",
"type": "function",
"z": "fe34ef79ce56a57b",
"name": "function 4",
"func": "var success_dump_creation_counter = flow.get(\"success_dump_creation_counter\") || 0\n\nsuccess_dump_creation_counter ++\n\nflow.set(\"success_dump_creation_counter\", success_dump_creation_counter)\nmsg.payload.success_dump_creation = success_dump_creation_counter\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 980,
"y": 80,
"wires": [
[
"efef656bbdb98e4e",
"984daa617a8e4c53"
]
]
},
{
"id": "efef656bbdb98e4e",
"type": "debug",
"z": "fe34ef79ce56a57b",
"name": "debug 4",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload.success_dump_creation",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1160,
"y": 180,
"wires": []
},
{
"id": "5923e2aef5cf9968",
"type": "template",
"z": "fe34ef79ce56a57b",
"name": "Prometheus Success Retrieved Dumps",
"field": "payload.req_dumps",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "# HELP success_dump_retrieve_total Number of dump calls that retrieved a dump correctly\n# TYPE success_dump_retrieve_total counter\nsuccess_dump_retrieve_total {{msg.payload.success_dump_retrieve}}",
"output": "str",
"x": 1320,
"y": 920,
"wires": [
[]
]
},
{
"id": "b491dd87c278e7f4",
"type": "function",
"z": "fe34ef79ce56a57b",
"name": "function 5",
"func": "var success_dump_get_counter = flow.get(\"success_dump_get_counter\") || 0\n\nsuccess_dump_get_counter ++\n\nflow.set(\"success_dump_get_counter\", success_dump_get_counter)\nmsg.payload.success_dump_retrieve = success_dump_get_counter\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 960,
"y": 920,
"wires": [
[
"4e311c154d7b8f53",
"5923e2aef5cf9968"
]
]
},
{
"id": "4e311c154d7b8f53",
"type": "debug",
"z": "fe34ef79ce56a57b",
"name": "debug 5",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload.success_dump_retrieve",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1140,
"y": 1020,
"wires": []
},
{
"id": "bda10d400681b9f4",
"type": "template",
"z": "fe34ef79ce56a57b",
"name": "Prometheus Failed Retrieved Dumps",
"field": "payload.failed_dump_retrieve",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "# HELP failed_dump_retrieve_total Number of dump calls that retrieved a dump incorrectly\n# TYPE failed_dump_retrieve_total counter\nfailed_dump_retrieve_total {{msg.payload.failed_dump_retrieve}}",
"output": "str",
"x": 1490,
"y": 1280,
"wires": [
[]
]
},
{
"id": "ba0874becffe667c",
"type": "function",
"z": "fe34ef79ce56a57b",
"name": "function 6",
"func": "var failed_dump_get_counter = flow.get(\"failed_dump_get_counter\") || 0\n\nfailed_dump_get_counter ++\n\nflow.set(\"failed_dump_get_counter\", failed_dump_get_counter)\nmsg.payload.failed_dump_retrieve = failed_dump_get_counter\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1140,
"y": 1280,
"wires": [
[
"e14d40b111efd584",
"bda10d400681b9f4"
]
]
},
{
"id": "e14d40b111efd584",
"type": "debug",
"z": "fe34ef79ce56a57b",
"name": "debug 6",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload.failed_dump_retrieve_total",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1320,
"y": 1380,
"wires": []
},
{
"id": "d97c23ec98797c09",
"type": "template",
"z": "fe34ef79ce56a57b",
"name": "Prometheus Failed Delete Dumps",
"field": "payload.failed_dump_delete",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "# HELP failed_dump_delete_total Number of delete dump calls incorrectly\n# TYPE failed_dump_delete_total counter\nfailed_dump_delete_total {{msg.payload.failed_dump_delete}}",
"output": "str",
"x": 1480,
"y": 1680,
"wires": [
[]
]
},
{
"id": "8446cbbe0054551f",
"type": "function",
"z": "fe34ef79ce56a57b",
"name": "function 7",
"func": "var failed_dump_delete_counter = flow.get(\"failed_dump_delete_counter\") || 0\n\nfailed_dump_delete_counter ++\n\nflow.set(\"failed_dump_delete_counter\", failed_dump_delete_counter)\nmsg.payload.failed_dump_delete = failed_dump_delete_counter\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1140,
"y": 1680,
"wires": [
[
"0326519d155bba5e",
"d97c23ec98797c09"
]
]
},
{
"id": "0326519d155bba5e",
"type": "debug",
"z": "fe34ef79ce56a57b",
"name": "debug 7",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload.failed_dump_delete",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1320,
"y": 1780,
"wires": []
},
{
"id": "c9768d63cd64a5d9",
"type": "template",
"z": "fe34ef79ce56a57b",
"name": "Prometheus Success Delete Dumps",
"field": "payload.success_dump_delete",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "# HELP success_dump_delete_total Number of correct delete dump calls\n# TYPE success_dump_delete_total counter\nsuccess_dump_delete_total {{msg.payload.success_dump_delete}}",
"output": "str",
"x": 1270,
"y": 1900,
"wires": [
[]
]
},
{
"id": "b12da484b673dde8",
"type": "function",
"z": "fe34ef79ce56a57b",
"name": "function 8",
"func": "var success_dump_delete_counter = flow.get(\"success_dump_delete_counter\") || 0\n\nsuccess_dump_delete_counter ++\n\nflow.set(\"success_dump_delete_counter\", success_dump_delete_counter)\nmsg.payload.success_dump_delete = success_dump_delete_counter\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 920,
"y": 1900,
"wires": [
[
"166977fb8215febd",
"c9768d63cd64a5d9"
]
]
},
{
"id": "166977fb8215febd",
"type": "debug",
"z": "fe34ef79ce56a57b",
"name": "debug 8",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload.success_dump_delete",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1100,
"y": 2000,
"wires": []
},
{
"id": "cff2b4b5665ee27d",
"type": "change",
"z": "fe34ef79ce56a57b",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "{\"code\": 204}",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 790,
"y": 1760,
"wires": [
[
"d07b35acb6650a47",
"b12da484b673dde8"
]
]
}
]
\ No newline at end of file
Loading