From 5820ce5d66b470051d0f9f6f1f90530c66e1039f Mon Sep 17 00:00:00 2001 From: Juanpe Araque Date: Wed, 21 May 2025 14:34:51 +0200 Subject: [PATCH 1/4] Add dashboard to be removed from dogweb to the docker integration --- .../assets/dashboards/docker_dashboard.json | 737 ++++++++++++++++++ docker_daemon/manifest.json | 3 + 2 files changed, 740 insertions(+) create mode 100644 docker_daemon/assets/dashboards/docker_dashboard.json diff --git a/docker_daemon/assets/dashboards/docker_dashboard.json b/docker_daemon/assets/dashboards/docker_dashboard.json new file mode 100644 index 0000000000000..a5315945c5297 --- /dev/null +++ b/docker_daemon/assets/dashboards/docker_dashboard.json @@ -0,0 +1,737 @@ +{ + "title": "Docker - Overview", + "description": "The Docker dashboard enables you to get an overview of your cluster's status, including a view of how many containers are running per image over time, and a list of the top images that containers are running. Further reading on Docker monitoring:\n\n- [Datadog's Docker integration docs](https://docs.datadoghq.com/integrations/docker_daemon/) \n\n- [The Docker monitoring problem](https://www.datadoghq.com/blog/the-docker-monitoring-problem/)\n\n- [How to monitor Docker resource metrics](https://www.datadoghq.com/blog/how-to-monitor-docker-resource-metrics/)\n\n- [How iHeartRadio monitors Docker performance](https://www.datadoghq.com/blog/iheartradio-monitors-docker/)\n\n- [Monitor Docker performance with Datadog](https://www.datadoghq.com/blog/monitor-docker-datadog/)\n\nClone this template dashboard to make changes and add your own graph widgets.", + "widgets": [ + { + "id": 0, + "definition": { + "type": "timeseries", + "requests": [ + { + "q": "sum:docker.containers.running{$scope} by {docker_image}.fill(0)", + "display_type": "bars" + } + ], + "custom_links": [], + "title": "Running containers by image", + "title_size": "16", + "title_align": "left", + "time": { + "live_span": "1h" + }, + "show_legend": false, + "legend_size": "0" + }, + "layout": { + "x": 68, + "y": 10, + "width": 50, + "height": 29 + } + }, + { + "id": 1, + "definition": { + "type": "toplist", + "requests": [ + { + "q": "top(avg:docker.mem.rss{$scope} by {container_name}, 5, 'max', 'desc')", + "style": { + "palette": "dog_classic" + } + } + ], + "custom_links": [], + "title": "Most RAM-intensive containers", + "title_size": "16", + "title_align": "left", + "time": { + "live_span": "1h" + } + }, + "layout": { + "x": 52, + "y": 98, + "width": 51, + "height": 15 + } + }, + { + "id": 2, + "definition": { + "type": "toplist", + "requests": [ + { + "q": "top(avg:docker.cpu.user{$scope} by {container_name}, 5, 'max', 'desc')", + "style": { + "palette": "cool" + } + } + ], + "custom_links": [], + "title": "Most CPU-intensive containers", + "title_size": "16", + "title_align": "left", + "time": { + "live_span": "1h" + } + }, + "layout": { + "x": 0, + "y": 82, + "width": 51, + "height": 15 + } + }, + { + "id": 3, + "definition": { + "type": "heatmap", + "requests": [ + { + "q": "avg:docker.mem.rss{$scope} by {container_name}" + } + ], + "custom_links": [], + "title": "Memory by container", + "title_size": "16", + "title_align": "left", + "show_legend": false, + "legend_size": "0", + "time": { + "live_span": "1h" + } + }, + "layout": { + "x": 52, + "y": 114, + "width": 51, + "height": 15 + } + }, + { + "id": 4, + "definition": { + "type": "query_value", + "requests": [ + { + "q": "sum:docker.containers.running{$scope}", + "aggregator": "last" + } + ], + "custom_links": [], + "title": "Running containers", + "title_size": "16", + "title_align": "center", + "time": { + "live_span": "1m" + }, + "autoscale": true, + "precision": 0, + "text_align": "center" + }, + "layout": { + "x": 89, + "y": 0, + "width": 14, + "height": 9 + } + }, + { + "id": 5, + "definition": { + "type": "query_value", + "requests": [ + { + "q": "sum:docker.containers.stopped{$scope}", + "aggregator": "last" + } + ], + "custom_links": [], + "title": "Stopped containers", + "title_size": "16", + "title_align": "center", + "time": { + "live_span": "1m" + }, + "autoscale": true, + "precision": 0, + "text_align": "center" + }, + "layout": { + "x": 104, + "y": 0, + "width": 14, + "height": 9 + } + }, + { + "id": 6, + "definition": { + "type": "heatmap", + "requests": [ + { + "q": "avg:docker.cpu.user{$scope} by {container_name}" + } + ], + "custom_links": [], + "title": "CPU by container", + "title_size": "16", + "title_align": "left", + "show_legend": false, + "legend_size": "0", + "time": { + "live_span": "1h" + } + }, + "layout": { + "x": 0, + "y": 98, + "width": 51, + "height": 15 + } + }, + { + "id": 7, + "definition": { + "type": "timeseries", + "requests": [ + { + "q": "avg:docker.cpu.user{$scope} by {docker_image}.fill(0)", + "display_type": "line", + "style": { + "palette": "cool" + } + } + ], + "custom_links": [], + "title": "CPU user by image", + "title_size": "16", + "title_align": "left", + "time": { + "live_span": "1h" + }, + "show_legend": false, + "legend_size": "0" + }, + "layout": { + "x": 0, + "y": 50, + "width": 51, + "height": 15 + } + }, + { + "id": 8, + "definition": { + "type": "timeseries", + "requests": [ + { + "q": "avg:docker.mem.rss{$scope} by {docker_image}.fill(0)", + "display_type": "line" + } + ], + "custom_links": [], + "title": "RSS memory by image", + "title_size": "16", + "title_align": "left", + "time": { + "live_span": "1h" + }, + "show_legend": false, + "legend_size": "0" + }, + "layout": { + "x": 52, + "y": 50, + "width": 51, + "height": 15 + } + }, + { + "id": 9, + "definition": { + "type": "event_stream", + "query": "source:docker", + "tags_execution": "and", + "event_size": "s", + "time": { + "live_span": "1d" + } + }, + "layout": { + "x": 0, + "y": 17, + "width": 51, + "height": 24 + } + }, + { + "id": 10, + "definition": { + "type": "event_timeline", + "query": "source:docker", + "tags_execution": "and", + "time": { + "live_span": "1d" + } + }, + "layout": { + "x": 0, + "y": 8, + "width": 51, + "height": 9 + } + }, + { + "id": 11, + "definition": { + "type": "query_value", + "requests": [ + { + "q": "100*(sum:docker.containers.running{$scope}/timeshift(sum:docker.containers.running{$scope}, -300))", + "aggregator": "last", + "conditional_formats": [ + { + "comparator": ">=", + "value": 80, + "palette": "white_on_green" + }, + { + "comparator": ">", + "value": 50, + "palette": "white_on_yellow" + }, + { + "comparator": ">=", + "value": 0, + "palette": "white_on_red" + } + ] + } + ], + "custom_links": [], + "title": "Running container change", + "title_size": "16", + "title_align": "center", + "time": { + "live_span": "5m" + }, + "autoscale": false, + "custom_unit": "%", + "precision": 0, + "text_align": "center" + }, + "layout": { + "x": 68, + "y": 0, + "width": 20, + "height": 9 + } + }, + { + "id": 12, + "definition": { + "type": "timeseries", + "requests": [ + { + "q": "avg:docker.cpu.system{$scope} by {docker_image}.fill(0)", + "display_type": "line", + "style": { + "palette": "cool" + } + } + ], + "custom_links": [], + "title": "CPU system by image", + "title_size": "16", + "title_align": "left", + "time": { + "live_span": "1h" + }, + "show_legend": false, + "legend_size": "0" + }, + "layout": { + "x": 0, + "y": 66, + "width": 51, + "height": 15 + } + }, + { + "id": 13, + "definition": { + "type": "note", + "content": "\n\nContainers", + "background_color": "blue", + "font_size": "24", + "text_align": "center", + "show_tick": true, + "tick_pos": "50%", + "tick_edge": "right" + }, + "layout": { + "x": 52, + "y": 0, + "width": 14, + "height": 39 + } + }, + { + "id": 14, + "definition": { + "type": "timeseries", + "requests": [ + { + "q": "sum:docker.mem.cache{$scope} by {docker_image}", + "display_type": "line" + } + ], + "custom_links": [], + "title": "Cache memory by image", + "title_size": "16", + "title_align": "left", + "time": { + "live_span": "1h" + }, + "show_legend": false, + "legend_size": "0" + }, + "layout": { + "x": 52, + "y": 82, + "width": 51, + "height": 15 + } + }, + { + "id": 15, + "definition": { + "type": "image", + "url": "/static/images/logos/docker_small.svg", + "sizing": "fit" + }, + "layout": { + "x": 0, + "y": 0, + "width": 51, + "height": 8 + } + }, + { + "id": 16, + "definition": { + "type": "note", + "content": "[CPU Core Load](https://www.datadoghq.com/blog/how-to-monitor-docker-resource-metrics/#toc2)", + "background_color": "blue", + "font_size": "24", + "text_align": "center", + "show_tick": true, + "tick_pos": "50%", + "tick_edge": "bottom" + }, + "layout": { + "x": 0, + "y": 42, + "width": 51, + "height": 6 + } + }, + { + "id": 17, + "definition": { + "type": "note", + "content": "Memory", + "background_color": "blue", + "font_size": "24", + "text_align": "center", + "show_tick": true, + "tick_pos": "50%", + "tick_edge": "bottom" + }, + "layout": { + "x": 52, + "y": 42, + "width": 51, + "height": 6 + } + }, + { + "id": 18, + "definition": { + "type": "timeseries", + "requests": [ + { + "q": "avg:docker.mem.swap{$scope} by {docker_image}", + "display_type": "line" + } + ], + "custom_links": [], + "title": "Swap by image", + "title_size": "16", + "title_align": "left", + "time": { + "live_span": "1h" + }, + "show_legend": false, + "legend_size": "0" + }, + "layout": { + "x": 52, + "y": 66, + "width": 51, + "height": 15 + } + }, + { + "id": 19, + "definition": { + "type": "note", + "content": "I/O", + "background_color": "blue", + "font_size": "24", + "text_align": "center", + "show_tick": true, + "tick_pos": "50%", + "tick_edge": "bottom" + }, + "layout": { + "x": 156, + "y": 42, + "width": 51, + "height": 6 + } + }, + { + "id": 20, + "definition": { + "type": "timeseries", + "requests": [ + { + "q": "avg:docker.io.read_bytes{$scope} by {docker_image}", + "display_type": "area", + "style": { + "palette": "dog_classic" + } + } + ], + "custom_links": [], + "title": "Avg. I/O bytes read by image", + "title_size": "16", + "title_align": "left", + "time": { + "live_span": "1h" + }, + "show_legend": false, + "legend_size": "0" + }, + "layout": { + "x": 156, + "y": 50, + "width": 51, + "height": 15 + } + }, + { + "id": 21, + "definition": { + "type": "timeseries", + "requests": [ + { + "q": "avg:docker.io.write_bytes{$scope} by {docker_image}", + "display_type": "area", + "style": { + "palette": "dog_classic" + } + } + ], + "custom_links": [], + "title": "Avg. I/O bytes written by image", + "title_size": "16", + "title_align": "left", + "time": { + "live_span": "1h" + }, + "show_legend": false, + "legend_size": "0" + }, + "layout": { + "x": 156, + "y": 66, + "width": 51, + "height": 15 + } + }, + { + "id": 22, + "definition": { + "type": "note", + "content": "Network", + "background_color": "blue", + "font_size": "24", + "text_align": "center", + "show_tick": true, + "tick_pos": "50%", + "tick_edge": "bottom" + }, + "layout": { + "x": 104, + "y": 42, + "width": 51, + "height": 6 + } + }, + { + "id": 23, + "definition": { + "type": "timeseries", + "requests": [ + { + "q": "avg:docker.net.bytes_rcvd{$scope} by {docker_image}", + "display_type": "area", + "style": { + "palette": "cool" + } + } + ], + "custom_links": [], + "title": "Avg. rx bytes by image", + "title_size": "16", + "title_align": "left", + "time": { + "live_span": "1h" + }, + "show_legend": false, + "legend_size": "0" + }, + "layout": { + "x": 104, + "y": 50, + "width": 51, + "height": 15 + } + }, + { + "id": 24, + "definition": { + "type": "timeseries", + "requests": [ + { + "q": "avg:docker.net.bytes_sent{$scope} by {docker_image}", + "display_type": "area", + "style": { + "palette": "purple" + } + } + ], + "custom_links": [], + "title": "Avg. tx bytes by image", + "title_size": "16", + "title_align": "left", + "time": { + "live_span": "1h" + }, + "show_legend": false, + "legend_size": "0" + }, + "layout": { + "x": 104, + "y": 66, + "width": 51, + "height": 15 + } + }, + { + "id": 25, + "definition": { + "type": "toplist", + "requests": [ + { + "q": "top(avg:docker.net.bytes_sent{$scope} by {container_name}, 5, 'max', 'desc')", + "style": { + "palette": "purple" + } + } + ], + "custom_links": [], + "title": "Most tx-intensive containers", + "title_size": "16", + "title_align": "left", + "time": { + "live_span": "1h" + } + }, + "layout": { + "x": 104, + "y": 82, + "width": 51, + "height": 15 + } + }, + { + "id": 26, + "definition": { + "type": "heatmap", + "requests": [ + { + "q": "avg:docker.net.bytes_sent{$scope} by {container_name}" + } + ], + "custom_links": [], + "title": "tx by container", + "title_size": "16", + "title_align": "left", + "show_legend": false, + "legend_size": "0", + "time": { + "live_span": "1h" + } + }, + "layout": { + "x": 104, + "y": 98, + "width": 51, + "height": 15 + } + }, + { + "id": 27, + "definition": { + "type": "toplist", + "requests": [ + { + "q": "top(timeshift(sum:docker.containers.running{$scope} by {docker_image}.fill(60), 40), 20, 'last', 'desc')", + "style": { + "palette": "dog_classic" + } + } + ], + "custom_links": [], + "title": "Running containers by image", + "title_size": "16", + "title_align": "left", + "time": { + "live_span": "1h" + } + }, + "layout": { + "x": 119, + "y": 0, + "width": 36, + "height": 39 + } + } + ], + "template_variables": [ + { + "name": "scope", + "default": "*", + "prefix": null + } + ], + "layout_type": "free", + "is_read_only": true, + "notify_list": [], + "id": 52 +} \ No newline at end of file diff --git a/docker_daemon/manifest.json b/docker_daemon/manifest.json index 6d3c015116278..4f587908aa782 100644 --- a/docker_daemon/manifest.json +++ b/docker_daemon/manifest.json @@ -76,6 +76,9 @@ "service_checks": { "metadata_path": "assets/service_checks.json" } + }, + "dashboards": { + "Docker - Overview": "assets/dashboards/docker_dashboard.json" } } } \ No newline at end of file From b9cda7804b8ab809905fb025795e1f1cd0d7c216 Mon Sep 17 00:00:00 2001 From: Juanpe Araque Date: Wed, 21 May 2025 15:05:45 +0200 Subject: [PATCH 2/4] Remove ID from dashboard --- docker_daemon/assets/dashboards/docker_dashboard.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker_daemon/assets/dashboards/docker_dashboard.json b/docker_daemon/assets/dashboards/docker_dashboard.json index a5315945c5297..af0cfad6a4370 100644 --- a/docker_daemon/assets/dashboards/docker_dashboard.json +++ b/docker_daemon/assets/dashboards/docker_dashboard.json @@ -732,6 +732,5 @@ ], "layout_type": "free", "is_read_only": true, - "notify_list": [], - "id": 52 + "notify_list": [] } \ No newline at end of file From b0c3a19d6d7ade9c6c7f464d0c54ab223fd25a9c Mon Sep 17 00:00:00 2001 From: Juanpe Araque Date: Thu, 22 May 2025 17:29:14 +0200 Subject: [PATCH 3/4] Improve dashboard description Co-authored-by: Joe Peeples --- docker_daemon/assets/dashboards/docker_dashboard.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker_daemon/assets/dashboards/docker_dashboard.json b/docker_daemon/assets/dashboards/docker_dashboard.json index af0cfad6a4370..38e131b82c097 100644 --- a/docker_daemon/assets/dashboards/docker_dashboard.json +++ b/docker_daemon/assets/dashboards/docker_dashboard.json @@ -1,6 +1,6 @@ { "title": "Docker - Overview", - "description": "The Docker dashboard enables you to get an overview of your cluster's status, including a view of how many containers are running per image over time, and a list of the top images that containers are running. Further reading on Docker monitoring:\n\n- [Datadog's Docker integration docs](https://docs.datadoghq.com/integrations/docker_daemon/) \n\n- [The Docker monitoring problem](https://www.datadoghq.com/blog/the-docker-monitoring-problem/)\n\n- [How to monitor Docker resource metrics](https://www.datadoghq.com/blog/how-to-monitor-docker-resource-metrics/)\n\n- [How iHeartRadio monitors Docker performance](https://www.datadoghq.com/blog/iheartradio-monitors-docker/)\n\n- [Monitor Docker performance with Datadog](https://www.datadoghq.com/blog/monitor-docker-datadog/)\n\nClone this template dashboard to make changes and add your own graph widgets.", + "description": "The Docker dashboard gives you an overview of your cluster's status, including a view of how many containers are running per image over time, and a list of the top images that containers are running. Further reading on Docker monitoring:\n\n- [Datadog's Docker integration docs](https://docs.datadoghq.com/integrations/docker_daemon/) \n\n- [The Docker monitoring problem](https://www.datadoghq.com/blog/the-docker-monitoring-problem/)\n\n- [How to monitor Docker resource metrics](https://www.datadoghq.com/blog/how-to-monitor-docker-resource-metrics/)\n\n- [How iHeartRadio monitors Docker performance](https://www.datadoghq.com/blog/iheartradio-monitors-docker/)\n\n- [Monitor Docker performance with Datadog](https://www.datadoghq.com/blog/monitor-docker-datadog/)\n\nClone this template dashboard to make changes and add your own graph widgets.", "widgets": [ { "id": 0, From b052f5587fc343442c51c82efae054df2bdde62d Mon Sep 17 00:00:00 2001 From: Juanpe Araque Date: Fri, 23 May 2025 17:19:58 +0200 Subject: [PATCH 4/4] Modify the dashbaord key in the manifest to be the same as the one in dogweb --- docker_daemon/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker_daemon/manifest.json b/docker_daemon/manifest.json index 4f587908aa782..36b87071f4c96 100644 --- a/docker_daemon/manifest.json +++ b/docker_daemon/manifest.json @@ -78,7 +78,7 @@ } }, "dashboards": { - "Docker - Overview": "assets/dashboards/docker_dashboard.json" + "docker": "assets/dashboards/docker_dashboard.json" } } } \ No newline at end of file