add docker container uptime graph

This commit is contained in:
m0duspwnens
2021-07-20 16:28:07 -04:00
parent 1bb92f63d1
commit af60ddf404
3 changed files with 377 additions and 33 deletions

View File

@@ -318,131 +318,143 @@ grafana:
y: 136 y: 136
h: 8 h: 8
w: 24 w: 24
uptime_docker_combined_current_graph:
gridPos:
x: 0
y: 144
h: 8
w: 12
uptime_docker_combined_trend_graph:
gridPos:
x: 12
y: 144
h: 8
w: 12
row_logstash: row_logstash:
gridPos: gridPos:
x: 0 x: 0
y: 144 y: 152
h: 1 h: 1
w: 24 w: 24
logstash_estimated_eps_graph: logstash_estimated_eps_graph:
gridPos: gridPos:
x: 0 x: 0
y: 145 y: 153
h: 8 h: 8
w: 24 w: 24
row_elasticsearch: row_elasticsearch:
gridPos: gridPos:
x: 0 x: 0
y: 153 y: 161
h: 1 h: 1
w: 24 w: 24
elasticsearch_document_count_graph: elasticsearch_document_count_graph:
gridPos: gridPos:
x: 0 x: 0
y: 154 y: 162
h: 8 h: 8
w: 12 w: 12
elasticsearch_thread_count_graph: elasticsearch_thread_count_graph:
gridPos: gridPos:
x: 12 x: 12
y: 154 y: 162
h: 8 h: 8
w: 12 w: 12
elasticsearch_store_size_graph: elasticsearch_store_size_graph:
gridPos: gridPos:
x: 0 x: 0
y: 162 y: 170
h: 8 h: 8
w: 12 w: 12
elasticsearch_field_data_cache_size_graph: elasticsearch_field_data_cache_size_graph:
gridPos: gridPos:
x: 12 x: 12
y: 162 y: 170
h: 8 h: 8
w: 12 w: 12
row_redis: row_redis:
gridPos: gridPos:
x: 0 x: 0
y: 170 y: 178
h: 1 h: 1
w: 24 w: 24
redis_queue_graph: redis_queue_graph:
gridPos: gridPos:
x: 0 x: 0
y: 171 y: 179
h: 8 h: 8
w: 24 w: 24
row_zeek: row_zeek:
gridPos: gridPos:
x: 0 x: 0
y: 179 y: 187
h: 1 h: 1
w: 24 w: 24
zeek_packet_loss_graph: zeek_packet_loss_graph:
gridPos: gridPos:
x: 0 x: 0
y: 180 y: 188
h: 8 h: 8
w: 10 w: 10
zeek_capture_loss_graph: zeek_capture_loss_graph:
gridPos: gridPos:
x: 10 x: 10
y: 180 y: 188
h: 8 h: 8
w: 10 w: 10
zeek_restarts_healthcheck_stat: zeek_restarts_healthcheck_stat:
gridPos: gridPos:
x: 20 x: 20
y: 180 y: 188
h: 8 h: 8
w: 4 w: 4
row_suricata: row_suricata:
gridPos: gridPos:
x: 0 x: 0
y: 188 y: 196
h: 1 h: 1
w: 24 w: 24
suricata_packet_loss_graph: suricata_packet_loss_graph:
gridPos: gridPos:
x: 0 x: 0
y: 189 y: 197
h: 8 h: 8
w: 24 w: 24
row_stenographer: row_stenographer:
gridPos: gridPos:
x: 0 x: 0
y: 197 y: 205
h: 1 h: 1
w: 24 w: 24
stenographer_packet_loss_graph: stenographer_packet_loss_graph:
gridPos: gridPos:
x: 0 x: 0
y: 198 y: 206
h: 8 h: 8
w: 16 w: 16
stenographer_pcap_retention_graph: stenographer_pcap_retention_graph:
gridPos: gridPos:
x: 16 x: 16
y: 198 y: 206
h: 8 h: 8
w: 8 w: 8
row_influxdb: row_influxdb:
gridPos: gridPos:
x: 0 x: 0
y: 206 y: 214
h: 1 h: 1
w: 24 w: 24
influxdb_db_size_graph: influxdb_db_size_graph:
gridPos: gridPos:
x: 0 x: 0
y: 207 y: 214
h: 8 h: 8
w: 24 w: 24
@@ -740,87 +752,99 @@ grafana:
y: 136 y: 136
h: 8 h: 8
w: 24 w: 24
uptime_docker_combined_current_graph:
gridPos:
x: 0
y: 144
h: 8
w: 12
uptime_docker_combined_trend_graph:
gridPos:
x: 12
y: 144
h: 8
w: 12
row_logstash: row_logstash:
gridPos: gridPos:
x: 0 x: 0
y: 144 y: 152
h: 1 h: 1
w: 24 w: 24
logstash_estimated_eps_graph: logstash_estimated_eps_graph:
gridPos: gridPos:
x: 0 x: 0
y: 145 y: 153
h: 8 h: 8
w: 24 w: 24
row_redis: row_redis:
gridPos: gridPos:
x: 0 x: 0
y: 153 y: 161
h: 1 h: 1
w: 24 w: 24
redis_queue_graph: redis_queue_graph:
gridPos: gridPos:
x: 0 x: 0
y: 154 y: 162
h: 8 h: 8
w: 24 w: 24
row_zeek: row_zeek:
gridPos: gridPos:
x: 0 x: 0
y: 162 y: 170
h: 1 h: 1
w: 24 w: 24
zeek_packet_loss_graph: zeek_packet_loss_graph:
gridPos: gridPos:
x: 0 x: 0
y: 163 y: 171
h: 8 h: 8
w: 10 w: 10
zeek_capture_loss_graph: zeek_capture_loss_graph:
gridPos: gridPos:
x: 10 x: 10
y: 163 y: 171
h: 8 h: 8
w: 10 w: 10
zeek_restarts_healthcheck_stat: zeek_restarts_healthcheck_stat:
gridPos: gridPos:
x: 20 x: 20
y: 163 y: 171
h: 8 h: 8
w: 4 w: 4
row_suricata: row_suricata:
gridPos: gridPos:
x: 0 x: 0
y: 171 y: 179
h: 1 h: 1
w: 24 w: 24
suricata_packet_loss_graph: suricata_packet_loss_graph:
gridPos: gridPos:
x: 0 x: 0
y: 172 y: 180
h: 8 h: 8
w: 24 w: 24
row_stenographer: row_stenographer:
gridPos: gridPos:
x: 0 x: 0
y: 180 y: 188
h: 1 h: 1
w: 24 w: 24
stenographer_packet_loss_graph: stenographer_packet_loss_graph:
gridPos: gridPos:
x: 0 x: 0
y: 181 y: 189
h: 8 h: 8
w: 16 w: 16
stenographer_pcap_retention_graph: stenographer_pcap_retention_graph:
gridPos: gridPos:
x: 16 x: 16
y: 181 y: 189
h: 8 h: 8
w: 8 w: 8

View File

@@ -0,0 +1,161 @@
{
"type": "graph",
"title": "Container Uptime Current",
"gridPos": {
"x": {{ PANELS.uptime_docker_combined_current_graph.gridPos.x }},
"y": {{ PANELS.uptime_docker_combined_current_graph.gridPos.y }},
"w": {{ PANELS.uptime_docker_combined_current_graph.gridPos.w }},
"h": {{ PANELS.uptime_docker_combined_current_graph.gridPos.h }}
},
"id": 68896,
"targets": [
{
"refId": "A",
"queryType": "randomWalk",
"policy": "default",
"resultFormat": "time_series",
"orderByTime": "ASC",
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$servername$/"
},
{
"condition": "AND",
"key": "container_name",
"operator": "=~",
"value": "/^$containers$/"
}
],
"groupBy": [
{
"type": "time",
"params": [
"$__interval"
]
},
{
"type": "tag",
"params": [
"container_name"
]
},
{
"type": "fill",
"params": [
"null"
]
}
],
"select": [
[
{
"type": "field",
"params": [
"uptime_ns"
]
},
{
"type": "last",
"params": []
}
]
],
"measurement": "docker_container_status",
"alias": "$tag_container_name",
"query": "SELECT last(\"health_status\") FROM \"docker_container_health\" WHERE (\"host\" =~ /^$servername$/ AND \"container_name\" =~ /^$containers$/) AND $timeFilter GROUP BY time($__interval), \"container_name\" fill(null)",
"rawQuery": false
}
],
"options": {
"alertThreshold": true
},
"datasource": "InfluxDB",
"fieldConfig": {
"defaults": {},
"overrides": []
},
"pluginVersion": "7.5.4",
"renderer": "flot",
"yaxes": [
{
"label": null,
"show": true,
"logBase": 1,
"min": null,
"max": null,
"format": "ns",
"$$hashKey": "object:192"
},
{
"label": "",
"show": true,
"logBase": 1,
"min": "0",
"max": null,
"format": "short",
"$$hashKey": "object:193",
"decimals": 2
}
],
"xaxis": {
"show": true,
"mode": "time",
"name": null,
"values": [],
"buckets": null
},
"yaxis": {
"align": false,
"alignLevel": null
},
"lines": true,
"linewidth": 1,
"dashLength": 10,
"spaceLength": 10,
"pointradius": 2,
"legend": {
"show": true,
"values": true,
"min": false,
"max": false,
"current": true,
"total": false,
"avg": false,
"alignAsTable": true,
"rightSide": true
},
"nullPointMode": "connected",
"tooltip": {
"value_type": "individual",
"shared": true,
"sort": 1
},
"aliasColors": {},
"seriesOverrides": [],
"thresholds": [
{
"value": 4500000000000,
"colorMode": "critical",
"op": "lt",
"fill": false,
"line": true,
"yaxis": "left",
"$$hashKey": "object:1299"
}
],
"timeRegions": [],
"decimals": 2,
"fill": 0,
"timeFrom": null,
"timeShift": null,
"fillGradient": 0,
"dashes": false,
"hiddenSeries": false,
"points": false,
"bars": false,
"stack": false,
"percentage": false,
"steppedLine": false
}

View File

@@ -0,0 +1,159 @@
{
"type": "graph",
"title": "Container Uptime Trend",
"gridPos": {
"x": {{ PANELS.uptime_docker_combined_trend_graph.gridPos.x }},
"y": {{ PANELS.uptime_docker_combined_trend_graph.gridPos.y }},
"w": {{ PANELS.uptime_docker_combined_trend_graph.gridPos.w }},
"h": {{ PANELS.uptime_docker_combined_trend_graph.gridPos.h }}
},
"id": 68999,
"targets": [
{
"refId": "A",
"queryType": "randomWalk",
"policy": "so_long_term",
"resultFormat": "time_series",
"orderByTime": "ASC",
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$servername$/"
},
{
"condition": "AND",
"key": "container_name",
"operator": "=~",
"value": "/^$containers$/"
}
],
"groupBy": [
{
"type": "time",
"params": [
"$__interval"
]
},
{
"type": "tag",
"params": [
"container_name"
]
},
{
"type": "fill",
"params": [
"null"
]
}
],
"select": [
[
{
"type": "field",
"params": [
"mean_uptime_ns"
]
},
{
"type": "last",
"params": []
}
]
],
"measurement": "docker_container_status",
"alias": "$tag_container_name"
}
],
"options": {
"alertThreshold": true
},
"datasource": "InfluxDB",
"fieldConfig": {
"defaults": {},
"overrides": []
},
"pluginVersion": "7.5.4",
"renderer": "flot",
"yaxes": [
{
"label": null,
"show": true,
"logBase": 1,
"min": null,
"max": null,
"format": "ns",
"$$hashKey": "object:192"
},
{
"label": "",
"show": true,
"logBase": 1,
"min": "0",
"max": null,
"format": "short",
"$$hashKey": "object:193",
"decimals": 2
}
],
"xaxis": {
"show": true,
"mode": "time",
"name": null,
"values": [],
"buckets": null
},
"yaxis": {
"align": false,
"alignLevel": null
},
"lines": true,
"linewidth": 1,
"dashLength": 10,
"spaceLength": 10,
"pointradius": 2,
"legend": {
"show": true,
"values": true,
"min": false,
"max": false,
"current": true,
"total": false,
"avg": false,
"alignAsTable": true,
"rightSide": true
},
"nullPointMode": "connected",
"tooltip": {
"value_type": "individual",
"shared": true,
"sort": 1
},
"aliasColors": {},
"seriesOverrides": [],
"thresholds": [
{
"value": 4500000000000,
"colorMode": "critical",
"op": "lt",
"fill": false,
"line": true,
"yaxis": "left",
"$$hashKey": "object:1299"
}
],
"timeRegions": [],
"decimals": 2,
"fill": 0,
"timeFrom": null,
"timeShift": null,
"fillGradient": 0,
"dashes": false,
"hiddenSeries": false,
"points": false,
"bars": false,
"stack": false,
"percentage": false,
"steppedLine": false
}