Skip to content

Instantly share code, notes, and snippets.

@iamfuzz
Created January 22, 2020 20:40
Show Gist options
  • Save iamfuzz/53f6e0ade68998774590b64d47cb819d to your computer and use it in GitHub Desktop.
Save iamfuzz/53f6e0ade68998774590b64d47cb819d to your computer and use it in GitHub Desktop.
{
"title": "Kubernetes Overview",
"icon": "bar-chart",
"grid_column_count": 3,
"filter": {
"key_names": ["clusterName", "namespace", "nodeName", "containerName"],
"event_types": ["K8sContainerSample", "K8sDeploymentSample", "K8sNamespaceSample", "K8sNodeSample", "K8sPodSample", "K8sReplicasetSample"],
"filter_first": false
},
"owner": {
"email": "bthomason@newrelic.com"
},
"widgets": [{
"title": "Resources Used",
"nrql": "FROM K8sNodeSample SELECT (average(cpuUsedCores) * uniqueCount(entityName)) as 'Cores', (average(memoryUsedBytes) * uniqueCount(entityName)) / 1000000000 as 'Mem GB'",
"process_as": "attribute_sheet",
"width": 1,
"height": 1,
"row": 1,
"column": 1,
"event_types": ["K8sNodeSample"],
"facet": null,
"customizations": null,
"notes": null
}, {
"title": "# of K8s Objects",
"nrql": "FROM K8sNodeSample, K8sNamespaceSample, K8sDeploymentSample, K8sPodSample, K8sContainerSample SELECT uniqueCount(K8sNodeSample.entityId) as 'Nodes', uniqueCount(K8sNamespaceSample.clusterName) as 'Clusters', uniqueCount(K8sNamespaceSample.entityId) as 'Namespaces', uniqueCount(K8sDeploymentSample.entityId) as 'Deployments', uniqueCount(K8sPodSample.entityId) as 'Pods', uniqueCount(K8sContainerSample.containerID) as 'Containers'",
"process_as": "attribute_sheet",
"width": 1,
"height": 1,
"row": 1,
"column": 2,
"event_types": ["K8sNodeSample", "K8sNamespaceSample", "K8sDeploymentSample", "K8sPodSample", "K8sContainerSample"],
"facet": null,
"customizations": null,
"notes": null
}, {
"title": "Kubernetes",
"nrql": null,
"width": 1,
"height": 2,
"row": 1,
"column": 3,
"notes": null,
"event_types": null,
"facet": null,
"agent_ids": [],
"duration": null,
"metrics": null,
"raw_metric_name": null,
"end_time": null,
"source_account_id": null,
"cds_params_payload": null,
"renderer": null,
"renderer_props": null,
"customizations": {
"markdown": "::: beyond\n **Kubernetes** \n\nKubernetes is an open-source system for automating deployment, scaling and management of containerized applications across clusters of hosts (container orchestration). It was originally designed by Google and now maintained by the Cloud Native Computing Foundation. It has become the de-facto standard for container orchestration.\n\n___\n\n![](https://integrations.nr-assets.net/icons/docs.png) [Documentation](https://docs.newrelic.com/docs/kubernetes-monitoring-integration)\n\n![](https://integrations.nr-assets.net/icons/alerts.png) [Create Alert](https://infrastructure.newrelic.com/accounts/1015429/settings/alerts/create?eventType=K8sContainerSample)\n\n:::"
}
}, {
"title": "Namespaces per Cluster",
"nrql": "FROM K8sNamespaceSample SELECT uniqueCount(namespace) FACET clusterName limit 100",
"process_as": "facet_bar_chart",
"width": 1,
"height": 1,
"row": 2,
"column": 1,
"event_types": ["K8sNamespaceSample"],
"facet": "clusterName",
"customizations": {
"drilldown": {
"dashboard_id": 1085423
}
},
"notes": null
}, {
"title": "Pods by Namespace",
"nrql": "FROM K8sPodSample SELECT uniqueCount(entityId) as 'pod' FACET namespace limit 100",
"process_as": "facet_bar_chart",
"width": 1,
"height": 1,
"row": 2,
"column": 2,
"event_types": ["K8sPodSample"],
"facet": "namespace",
"customizations": {
"drilldown": {
"dashboard_id": 1085423
}
},
"notes": null
}, {
"title": "Container CPU Usage - % Used vs Limit",
"nrql": "FROM K8sContainerSample SELECT latest(cpuUsedCores/cpuLimitCores) * 100 as '% CPU' FACET clusterName, podName, containerName TIMESERIES limit 50",
"process_as": "faceted_line_chart",
"width": 1,
"height": 1,
"row": 3,
"column": 1,
"event_types": ["K8sContainerSample"],
"facet": "[\"clusterName\", \"podName\", \"containerName\"]",
"customizations": null,
"notes": null
}, {
"title": "Container Memory Usage - % Used vs Limit",
"nrql": "FROM K8sContainerSample SELECT latest(memoryUsedBytes/memoryLimitBytes) * 100 as '% Memory' FACET clusterName, podName, containerName TIMESERIES limit 50",
"process_as": "faceted_line_chart",
"width": 1,
"height": 1,
"row": 3,
"column": 2,
"event_types": ["K8sContainerSample"],
"facet": "[\"clusterName\", \"podName\", \"containerName\"]",
"customizations": null,
"notes": null
}, {
"title": "Container Restarts",
"nrql": "FROM K8sContainerSample SELECT max(restartCount)-min(restartCount) as 'Restarts' FACET clusterName, podName, containerName TIMESERIES limit 50",
"process_as": "faceted_area_chart",
"width": 1,
"height": 1,
"row": 3,
"column": 3,
"event_types": ["K8sContainerSample"],
"facet": "[\"clusterName\", \"podName\", \"containerName\"]",
"customizations": null,
"notes": null
}, {
"title": "Container CPU Cores Used",
"nrql": "SELECT average(cpuUsedCores) as 'CPU Cores Used' from K8sContainerSample FACET clusterName, podName, containerName timeseries since 60 minutes ago limit 50",
"process_as": "faceted_line_chart",
"width": 1,
"height": 1,
"row": 4,
"column": 1,
"event_types": ["K8sContainerSample"],
"facet": "[\"clusterName\", \"podName\", \"containerName\"]",
"customizations": null,
"notes": null
}, {
"title": "Container MBytes of Memory Used",
"nrql": "SELECT average(memoryUsedBytes / 1000000) as 'MB of Mem' from K8sContainerSample FACET clusterName, podName, containerName timeseries since 60 minutes ago limit 50",
"process_as": "faceted_line_chart",
"width": 1,
"height": 1,
"row": 4,
"column": 2,
"event_types": ["K8sContainerSample"],
"facet": "[\"clusterName\", \"podName\", \"containerName\"]",
"customizations": null,
"notes": null
}, {
"title": "Missing Pods by Deployment",
"nrql": "SELECT latest(podsDesired) - latest(podsReady) as 'Missing Pods' FROM K8sReplicasetSample since 10 minutes ago facet clusterName, deploymentName timeseries limit 50",
"process_as": "faceted_area_chart",
"width": 1,
"height": 1,
"row": 4,
"column": 3,
"event_types": ["K8sReplicasetSample"],
"facet": "[\"clusterName\", \"deploymentName\"]",
"customizations": null,
"notes": null
}, {
"title": "Pods not Running by Cluster/Namespace",
"nrql": "SELECT latest(status) as 'Status' from K8sPodSample WHERE status NOT IN ('Running') facet clusterName, namespace, podName since 10 minutes ago limit 100",
"process_as": "facet_table",
"width": 2,
"height": 1,
"row": 5,
"column": 1,
"event_types": ["K8sPodSample"],
"facet": "[\"clusterName\", \"namespace\", \"podName\"]",
"customizations": {},
"notes": null
}, {
"title": "Containers by Namespace",
"nrql": "SELECT uniqueCount(containerID) FROM K8sContainerSample SINCE 10 minutes AGO facet namespace TIMESERIES",
"process_as": "faceted_line_chart",
"width": 1,
"height": 1,
"row": 5,
"column": 3,
"event_types": ["K8sContainerSample"],
"facet": "namespace",
"customizations": null,
"notes": null
}, {
"title": "Node Resource Consumption",
"nrql": "FROM K8sNodeSample, K8sPodSample SELECT average(cpuUsedCores) as 'Used Cores', average(memoryUsedBytes) as 'Used Memory', uniqueCount(podName) as 'Pods' FACET nodeName since 10 minutes ago limit 100",
"process_as": "facet_table",
"width": 2,
"height": 1,
"row": 6,
"column": 1,
"event_types": ["K8sNodeSample", "K8sPodSample"],
"facet": "nodeName",
"customizations": {},
"notes": null
}, {
"title": "Active Pods by Deployment",
"nrql": "SELECT uniqueCount(podName) FROM K8sPodSample where status='Running' SINCE 10 minutes AGO facet clusterName, deploymentName WHERE deploymentName IS NOT NULL TIMESERIES limit 50",
"process_as": "faceted_line_chart",
"width": 1,
"height": 1,
"row": 6,
"column": 3,
"event_types": ["K8sPodSample"],
"facet": "[\"clusterName\", \"deploymentName\"]",
"customizations": null,
"notes": null
}, {
"title": "Pod Network Status",
"nrql": "SELECT average(`net.rxBytesPerSecond`)/1000000 as 'Received MBps', average(`net.txBytesPerSecond`)/1000000 as 'Transmitted MBps', latest(`net.errorCount`) as 'Error Count' FROM K8sPodSample FACET podName since 10 minutes ago limit 100",
"process_as": "facet_table",
"width": 2,
"height": 1,
"row": 7,
"column": 1,
"event_types": ["K8sPodSample"],
"facet": "podName",
"customizations": {},
"notes": null
}, {
"title": "Pod Count by Node",
"nrql": "SELECT uniquecount(podName) from K8sPodSample where status='Running' facet nodeName since 10 minutes ago",
"process_as": "facet_bar_chart",
"width": 1,
"height": 1,
"row": 7,
"column": 3,
"event_types": ["K8sPodSample"],
"facet": "nodeName",
"customizations": {
"drilldown": {
"dashboard_id": 1085423
}
},
"notes": null
}, {
"title": "Container Lifespan in Seconds",
"nrql": "from K8sContainerSample select (max(timestamp) - min(timestamp))/60 AS 'Container Lifespan in Seconds' facet containerName, podName since 12 week ago limit 1000",
"process_as": "facet_table",
"width": 2,
"height": 1,
"row": 8,
"column": 1,
"event_types": ["K8sContainerSample"],
"facet": "[\"containerName\", \"podName\"]",
"customizations": {},
"notes": null
}, {
"title": "Container Lifespan in Seconds - Node",
"nrql": "from K8sContainerSample select (max(timestamp) - min(timestamp))/60 AS 'Container Lifespan in Seconds' facet containerName since 12 week ago",
"process_as": "facet_bar_chart",
"width": 1,
"height": 1,
"row": 8,
"column": 3,
"event_types": ["K8sContainerSample"],
"facet": "containerName",
"customizations": {
"drilldown": {
"dashboard_id": 1085423
}
},
"notes": null
}],
"dashboard_account_id": 1606862
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment