Common Practices
The following examples showcase common practices for configuring custom dashboards and widgets. Let this be the starting point to ensure you are effectively monitoring your system-wide infrastructure data.
After insturmenting one of the Middleware Infrastructure Agent and APM packages, default dashboards relating to that data will automatically populate in your Dashboard Builder landing page. The following are examples of custom widgets that your team could create.
Kubernetes Example Widgets
Select system.cpu.utilization
as your primary metric, choose the Average By filter and aggregate by the sum of all host.name
. Filter the above query such that is.k8s.node
=
yes
Select k8s.pod.cpu.utilization
as your primary metric, choose the Average By filter and aggregate by the average of all k8s.pod.name
. Filter the above query such that k8s.deployment.name
=
dndemo-deployment
To use the Kubernetes Widgets, import the following .json
file into the Dashboard Builder:
{"builderViewOptions":{"report":{"reportName":"K8s Examples","reportId":44120,"reportKey":"k8s_examples__dont_delete_"},"extraActions":[]},"widgets":[{"config":[{"account_id":"","columns":["min(k8s.pod.phase,value(min))"],"distinct":false,"filter":null,"granularity":null,"group_by":null,"is_pre_flight":false,"join_with":null,"limit":null,"meta_data":null,"options":null,"order_by":null,"preflights":null,"response_type":0,"schema":"","settings":null,"source":{"alias":"","dataset":null,"final":false,"name":"k8s.pod"},"top":0,"type":0,"union":null,"with":[{"is_arg":true,"is_p_arg":false,"key":"SELECT_DATA_BY","swap_as":false,"value":["k8s.pod.name"],"value_len":false}]}],"label":"Pod Phase","layout":{"_scope_id":1073355,"h":9,"w":6,"x":0,"y":0,"resizeHandles":["se"]},"widgetAppId":1,"key":"untitled_39o1xsh41zh"},{"config":[{"type":0,"schema":"","account_id":"","is_pre_flight":false,"distinct":false,"with":[{"key":"SELECT_DATA_BY","value":["k8s.pod.name"],"value_len":false,"swap_as":false,"is_arg":true,"is_p_arg":false}],"preflights":null,"response_type":0,"top":0,"columns":["avg(k8s.container.ready,value(avg))"],"source":{"name":"k8s.container","dataset":null,"final":false,"alias":""},"granularity":null,"join_with":null,"union":null,"filter":null,"group_by":null,"order_by":null,"limit":null,"options":null,"meta_data":null,"settings":null}],"label":"Container Ready","layout":{"_scope_id":1077491,"h":9,"w":6,"x":6,"y":0,"resizeHandles":["se"]},"widgetAppId":1,"key":"container_ready_rrvc4cw9gzd"},{"config":[{"type":0,"schema":"","account_id":"","is_pre_flight":false,"distinct":false,"with":[{"key":"ATTRIBUTE_FILTER","value":{"k8s.deployment.name":{"=":"dndemo-deployment"}},"value_len":false,"swap_as":false,"is_arg":true,"is_p_arg":false},{"key":"SELECT_DATA_BY","value":[],"value_len":false,"swap_as":false,"is_arg":true,"is_p_arg":false}],"preflights":null,"response_type":0,"top":0,"columns":["any(k8s.pod.name)"],"source":{"name":"k8s.pod","dataset":null,"final":false,"alias":""},"granularity":null,"join_with":null,"union":null,"filter":null,"group_by":null,"order_by":null,"limit":null,"options":null,"meta_data":null,"settings":null},{"type":0,"schema":"","account_id":"","is_pre_flight":false,"distinct":false,"with":[{"key":"ATTRIBUTE_FILTER","value":{"k8s.deployment.name":{"=":"dndemo-deployment"}},"value_len":false,"swap_as":false,"is_arg":true,"is_p_arg":false},{"key":"SELECT_DATA_BY","value":[],"value_len":false,"swap_as":false,"is_arg":true,"is_p_arg":false}],"preflights":null,"response_type":0,"top":0,"columns":["min(k8s.pod.phase,value(min))"],"source":{"name":"k8s.pod","dataset":null,"final":false,"alias":""},"granularity":null,"join_with":null,"union":null,"filter":null,"group_by":null,"order_by":null,"limit":null,"options":null,"meta_data":null,"settings":null}],"label":"Pod Phase | Same Deployment","layout":{"_scope_id":1077505,"h":8,"w":6,"x":6,"y":9,"resizeHandles":["se"]},"widgetAppId":5,"key":"pod_phase___same_deployment_84vae4p36zn"},{"config":[{"account_id":"","columns":["avg(system.cpu.utilization,value(sum))"],"distinct":false,"filter":null,"granularity":null,"group_by":null,"is_pre_flight":false,"join_with":null,"limit":null,"meta_data":null,"options":null,"order_by":null,"preflights":null,"response_type":0,"schema":"","settings":null,"source":{"alias":"","dataset":null,"final":false,"name":"host"},"top":0,"type":0,"union":null,"with":[{"is_arg":true,"is_p_arg":false,"key":"SELECT_DATA_BY","swap_as":false,"value":["host.name"],"value_len":false},{"is_arg":true,"is_p_arg":false,"key":"ATTRIBUTE_FILTER","swap_as":false,"value":{"is.k8s.node":{"=":"yes"}},"value_len":false}]}],"label":"Node CPU %","layout":{"_scope_id":1203808,"h":8,"w":6,"x":0,"y":27,"resizeHandles":["se"]},"widgetAppId":1,"key":"node_cpu___test_i0pca8w55c9"},{"config":[{"type":0,"schema":"","account_id":"","is_pre_flight":false,"distinct":false,"with":[{"key":"SELECT_DATA_BY","value":["k8s.pod.name"],"value_len":false,"swap_as":false,"is_arg":true,"is_p_arg":false},{"key":"ATTRIBUTE_FILTER","value":{"k8s.deployment.name":{"=":"dndemo-deployment"}},"value_len":false,"swap_as":false,"is_arg":true,"is_p_arg":false}],"preflights":null,"response_type":0,"top":0,"columns":["avg(k8s.pod.cpu.utilization,value(avg))"],"source":{"name":"k8s.pod","dataset":null,"final":false,"alias":""},"granularity":null,"join_with":null,"union":null,"filter":null,"group_by":null,"order_by":null,"limit":null,"options":null,"meta_data":null,"settings":null}],"label":"Pod CPU | Same Deployment","layout":{"_scope_id":1203819,"h":8,"w":6,"x":0,"y":19,"resizeHandles":["se"]},"widgetAppId":1,"key":"pod_cpu___same_deployment_5bvgkx56vn8"},{"config":[{"columns":["avg(total_logs,value(count))"],"source":{"alias":"","dataset_id":0,"name":"log"},"with":[{"is_arg":true,"key":"ATTRIBUTE_FILTER","value":{"k8s.event.reason":{"=":"Killing"}}},{"is_arg":true,"key":"SELECT_DATA_BY","value":["host.name"]}]}],"label":"K8s Pods Killed","layout":{"_scope_id":1238209,"h":4,"w":6,"x":0,"y":15,"resizeHandles":["se"]},"widgetAppId":1,"key":"k8s_pods_killed_2rolisxtlmn"},{"config":[{"columns":["any(k8s.event.name)"],"source":{"alias":"","dataset_id":0,"name":"log"},"with":[{"is_arg":true,"key":"SELECT_DATA_BY","value":["k8s.event.reason"]},{"is_arg":true,"key":"ATTRIBUTE_FILTER","value":{"k8s.event.reason":{"=":"Killing"}}}]}],"label":"Untitled","layout":{"_scope_id":1238210,"h":6,"w":6,"x":0,"y":9,"resizeHandles":["se"]},"widgetAppId":5,"key":"untitled_fkpqzj22wao"}]}
Container Example Widgets
Choose the Query Value chart type, select k8s.container.name
as your primary metric and choose the Unique By filter to display the count of all active containers:
Choose the List chart type, select k8s.container.cpu_limit
as your primary metric, choose the Maximum By filter and aggregate by the average value of all k8s.container.name
:
Select container.memory.usage
as your primary metric, choose the Average By filter and aggregate by the average value of all k8s.container.name
:
To use the Container Widgets, import the following .json
file into the Dashboard Builder:
{"builderViewOptions":{"report":{"reportName":"Container Monitoring Example","reportId":46462,"reportKey":"container_monitoring_example"},"extraActions":[]},"widgets":[{"config":[{"account_id":"","columns":["k8s.container.memory_request"],"distinct":false,"filter":null,"granularity":{"column":"","filter_required":true,"ingest_interval":0,"is_cte":false,"is_dttm":true,"is_in_range":false,"is_sudo":false,"is_tuple_range":false,"modifier_end":"","modifier_start":"","type":"","value":0},"group_by":null,"is_pre_flight":false,"join_with":null,"limit":{"n":10},"meta_data":null,"options":null,"order_by":null,"preflights":null,"response_type":0,"schema":"","settings":null,"source":{"alias":"","dataset":null,"final":false,"name":"k8s.container"},"top":0,"type":0,"union":null,"with":[{"is_arg":true,"is_p_arg":false,"key":"SELECT_DATA_BY","swap_as":false,"value":["k8s.container.name"],"value_len":false}]}],"label":"Memory Request by Container (Bytes)","layout":{"_scope_id":1227168,"h":5,"w":4,"x":0,"y":0,"resizeHandles":["se"]},"widgetAppId":1,"key":"k8s_default__memory_request_by_container__containersja0ohmyb05s"},{"config":[{"account_id":"","columns":["uniq(k8s.container.name)"],"distinct":false,"filter":null,"granularity":{"column":"","filter_required":true,"ingest_interval":0,"is_cte":false,"is_dttm":true,"is_in_range":false,"is_sudo":false,"is_tuple_range":false,"modifier_end":"","modifier_start":"","type":"","value":0},"group_by":null,"is_pre_flight":false,"join_with":null,"limit":{"n":10},"meta_data":null,"options":null,"order_by":null,"preflights":null,"response_type":0,"schema":"","settings":null,"source":{"alias":"","dataset":null,"final":false,"name":"k8s.container"},"top":0,"type":0,"union":null,"with":[{"is_arg":true,"is_p_arg":false,"key":"SELECT_DATA_BY","swap_as":false,"value":[],"value_len":false}]}],"label":"Containers","layout":{"_scope_id":1227169,"h":5,"w":4,"x":8,"y":10,"resizeHandles":["se"]},"widgetAppId":12,"key":"k8s_default__containers__containers67ren8gfj7v"},{"config":[{"account_id":"","columns":["max(k8s.container.memory_limit)"],"distinct":false,"filter":null,"granularity":{"column":"","filter_required":true,"ingest_interval":0,"is_cte":false,"is_dttm":true,"is_in_range":false,"is_sudo":false,"is_tuple_range":false,"modifier_end":"","modifier_start":"","type":"","value":0},"group_by":null,"is_pre_flight":false,"join_with":null,"limit":{"n":10},"meta_data":null,"options":null,"order_by":null,"preflights":null,"response_type":0,"schema":"","settings":null,"source":{"alias":"","dataset":null,"final":false,"name":"k8s.container"},"top":0,"type":0,"union":null,"with":[{"is_arg":true,"is_p_arg":false,"key":"SELECT_DATA_BY","swap_as":false,"value":["k8s.container.name"],"value_len":false}]}],"label":"Memory Limit by Container","layout":{"_scope_id":1227170,"h":5,"w":4,"x":4,"y":10,"resizeHandles":["se"]},"widgetAppId":5,"key":"k8s_default__memory_limit_by_container__containersi1km077iatn"},{"config":[{"account_id":"","columns":["k8s.container.restarts"],"distinct":false,"filter":null,"granularity":{"column":"","filter_required":true,"ingest_interval":0,"is_cte":false,"is_dttm":true,"is_in_range":false,"is_sudo":false,"is_tuple_range":false,"modifier_end":"","modifier_start":"","type":"","value":0},"group_by":null,"is_pre_flight":false,"join_with":null,"limit":{"n":10},"meta_data":null,"options":null,"order_by":null,"preflights":null,"response_type":0,"schema":"","settings":null,"source":{"alias":"","dataset":null,"final":false,"name":"k8s.container"},"top":0,"type":0,"union":null,"with":[{"is_arg":true,"is_p_arg":false,"key":"SELECT_DATA_BY","swap_as":false,"value":["k8s.container.name"],"value_len":false}]}],"label":"Container Restarts","layout":{"_scope_id":1227171,"h":5,"w":4,"x":8,"y":5,"resizeHandles":["se"]},"widgetAppId":1,"key":"k8s_default__container_restarts_by_pod__containerst9xqxkuw0sr"},{"config":[{"account_id":"","columns":["container.memory.usage"],"distinct":false,"filter":null,"granularity":{"column":"","filter_required":true,"ingest_interval":0,"is_cte":false,"is_dttm":true,"is_in_range":false,"is_sudo":false,"is_tuple_range":false,"modifier_end":"","modifier_start":"","type":"","value":0},"group_by":null,"is_pre_flight":false,"join_with":null,"limit":{"n":10},"meta_data":null,"options":null,"order_by":null,"preflights":null,"response_type":0,"schema":"","settings":null,"source":{"alias":"","dataset":null,"final":false,"name":"k8s.container"},"top":0,"type":0,"union":null,"with":[{"is_arg":true,"is_p_arg":false,"key":"SELECT_DATA_BY","swap_as":false,"value":["k8s.container.name"],"value_len":false}]}],"label":"Memory Usage by Container (Bytes)","layout":{"_scope_id":1227172,"h":5,"w":4,"x":0,"y":5,"resizeHandles":["se"]},"widgetAppId":1,"key":"k8s_default__memory_usage_by_container__containersczj3w36phy"},{"config":[{"account_id":"","columns":["max(k8s.container.cpu_limit)"],"distinct":false,"filter":null,"granularity":{"column":"","filter_required":true,"ingest_interval":0,"is_cte":false,"is_dttm":true,"is_in_range":false,"is_sudo":false,"is_tuple_range":false,"modifier_end":"","modifier_start":"","type":"","value":0},"group_by":null,"is_pre_flight":false,"join_with":null,"limit":{"n":10},"meta_data":null,"options":null,"order_by":null,"preflights":null,"response_type":0,"schema":"","settings":null,"source":{"alias":"","dataset":null,"final":false,"name":"k8s.container"},"top":0,"type":0,"union":null,"with":[{"is_arg":true,"is_p_arg":false,"key":"SELECT_DATA_BY","swap_as":false,"value":["k8s.container.name"],"value_len":false}]}],"label":"CPU Limit by Container","layout":{"_scope_id":1227173,"h":5,"w":4,"x":4,"y":5,"resizeHandles":["se"]},"widgetAppId":5,"key":"k8s_default__cpu_limit_by_container__containers41n78ogc5sy"},{"config":[{"account_id":"","columns":["sum(k8s.container.restarts,value(avg))"],"distinct":false,"filter":null,"granularity":{"column":"","filter_required":true,"ingest_interval":0,"is_cte":false,"is_dttm":true,"is_in_range":false,"is_sudo":false,"is_tuple_range":false,"modifier_end":"","modifier_start":"","type":"","value":0},"group_by":null,"is_pre_flight":false,"join_with":null,"limit":{"n":10},"meta_data":null,"options":null,"order_by":null,"preflights":null,"response_type":0,"schema":"","settings":null,"source":{"alias":"","dataset":null,"final":false,"name":"k8s.container"},"top":0,"type":0,"union":null,"with":[{"is_arg":true,"is_p_arg":false,"key":"SELECT_DATA_BY","swap_as":false,"value":["k8s.container.name"],"value_len":false},{"is_arg":true,"is_p_arg":false,"key":"ATTRIBUTE_FILTER","swap_as":false,"value":{"k8s.container.restarts":{">=":"1"}},"value_len":false}]}],"label":"Container Restarted","layout":{"_scope_id":1227174,"h":5,"w":4,"x":0,"y":10,"resizeHandles":["se"]},"widgetAppId":3,"key":"k8s_default__containers_states__containers7asg0nck8pn"},{"config":[{"account_id":"","columns":["k8s.container.cpu_request"],"distinct":false,"filter":null,"granularity":{"column":"","filter_required":true,"ingest_interval":0,"is_cte":false,"is_dttm":true,"is_in_range":false,"is_sudo":false,"is_tuple_range":false,"modifier_end":"","modifier_start":"","type":"","value":0},"group_by":null,"is_pre_flight":false,"join_with":null,"limit":{"n":10},"meta_data":null,"options":null,"order_by":null,"preflights":null,"response_type":0,"schema":"","settings":null,"source":{"alias":"","dataset":null,"final":false,"name":"k8s.container"},"top":0,"type":0,"union":null,"with":[{"is_arg":true,"is_p_arg":false,"key":"SELECT_DATA_BY","swap_as":false,"value":["k8s.container.name"],"value_len":false}]}],"label":"CPU Request by Container","layout":{"_scope_id":1227175,"h":5,"w":4,"x":4,"y":0,"resizeHandles":["se"]},"widgetAppId":1,"key":"k8s_default__cpu_request_by_container__containers2vbbhf98dgm"},{"config":[{"account_id":"","columns":["container.cpu.utilization"],"distinct":false,"filter":null,"granularity":{"column":"","filter_required":true,"ingest_interval":0,"is_cte":false,"is_dttm":true,"is_in_range":false,"is_sudo":false,"is_tuple_range":false,"modifier_end":"","modifier_start":"","type":"","value":0},"group_by":null,"is_pre_flight":false,"join_with":null,"limit":{"n":10},"meta_data":null,"options":null,"order_by":null,"preflights":null,"response_type":0,"schema":"","settings":null,"source":{"alias":"","dataset":null,"final":false,"name":"k8s.container"},"top":0,"type":0,"union":null,"with":[{"is_arg":true,"is_p_arg":false,"key":"SELECT_DATA_BY","swap_as":false,"value":["k8s.container.name"],"value_len":false}]}],"label":"CPU Usage by Container (Cores)","layout":{"_scope_id":1227176,"h":5,"w":4,"x":8,"y":0,"resizeHandles":["se"]},"widgetAppId":1,"key":"k8s_default__cpu_usage_by_container__containerszmtgyfg639g"},{"config":[{"columns":["sum(app.ads.ad_requests,value(avg))"],"source":{"alias":"","dataset_id":0,"name":"runtime.metrics.java"},"with":[{"is_arg":true,"key":"SELECT_DATA_BY","value":["host.id"]}]}],"label":"Untitled","layout":{"_scope_id":1238236,"h":6,"w":8,"x":0,"y":15,"resizeHandles":["se"]},"widgetAppId":1,"key":"untitled_nu3dfu0w7w"}]}
Metrics Example Widgets
Select connections.active
as your primary metric, choose the Maximum By filter and aggregate by the average of all connections.active.hostname
Select downloads.speeds_bucket
as your primary metric, choose the Average By filter and aggregate by the minimum of all region
Select uploads.count
as your primary metric and choose the Count By filter
These Widgets were created by sending the following JSON through Postman:
You may need to adjust the format depending on how you are sending requests.
{ "info": { "_postman_id": "fa8bf8f1-5f53-4989-8fe8-af01e24b531e", "name": "MW Data Ingestion API", "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json", "_exporter_id": "30495621", "_collection_link": "https://cloudy-astronaut-491050.postman.co/workspace/New-Team-Workspace~44e7a2d0-d301-4800-97eb-28b756f9175c/collection/30495621-fa8bf8f1-5f53-4989-8fe8-af01e24b531e?action=share&source=collection_link&creator=30495621" }, "item": [ {
Next Steps
- Dashboard Basics
- Intro to APM
- How to Create Alerts
- Custom Telemetry Ingestion
- Getting Started With Real User Monitoring (RUM)
Need assistance or want to learn more about Middleware? Contact our support team in Slack.