Grafana dashboard: Microsoft Azure Monitor Insights - Logs
Description: Azure Monitor Container Insights

Microsoft Azure Monitor Insights - Logs

Create By Shay B.T

is set as orader By 500

{
  "__inputs": [],
  "__elements": [],
  "__requires": [
    {
      "type": "panel",
      "id": "gauge",
      "name": "Gauge",
      "version": ""
    },
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "8.4.1"
    },
    {
      "type": "datasource",
      "id": "grafana-azure-monitor-datasource",
      "name": "Azure Monitor",
      "version": "0.3.0"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph (old)",
      "version": ""
    },
    {
      "type": "panel",
      "id": "stat",
      "name": "Stat",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "Azure Monitor Container Insights",
  "editable": true,
  "gnetId": 16457,
  "graphTooltip": 0,
  "id": 38,
  "iteration": 1655318099241,
  "links": [],
  "panels": [
    {
      "collapsed": false,
      "datasource": null,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 26,
      "panels": [],
      "title": "Cluster - Pod -Logs",
      "type": "row"
    },
    {
      "datasource": "Azure Monitor",
      "fieldConfig": {
        "defaults": {},
        "overrides": []
      },
      "gridPos": {
        "h": 21,
        "w": 24,
        "x": 0,
        "y": 1
      },
      "id": 34,
      "maxDataPoints": null,
      "options": {
        "dedupStrategy": "none",
        "showLabels": false,
        "showTime": true,
        "sortOrder": "Descending",
        "wrapLogMessage": true
      },
      "pluginVersion": "7.5.3",
      "targets": [
        {
          "appInsights": {
            "dimension": [
              "none"
            ],
            "metricName": "select",
            "rawQuery": false,
            "rawQueryString": "",
            "timeColumn": "timestamp",
            "timeGrain": "auto",
            "valueColumn": ""
          },
          "azureLogAnalytics": {
            "query": "\r\nKubePodInventory\r\n| where ClusterName == \"$AKS\"\n| where Namespace == \"$Namespace\"\r\n| project ContainerID, PodName=Name, Namespace\r\n| distinct ContainerID, PodName\r\n| join\r\n(\r\n    ContainerLog\r\n    | where $__timeFilter(TimeGenerated)\r\n)\r\non ContainerID\r\n// at this point before the next pipe, columns from both tables are available to be \"projected\". Due to both\r\n// tables having a \"Name\" column, we assign an alias as PodName to one column which we actually want\r\n| project TimeGenerated, PodName, LogEntry, LogEntrySource\r\n| summarize by TimeGenerated, LogEntry\r\n| top 500 by TimeGenerated desc",
            "resultFormat": "time_series",
            "workspace": "$Workspace"
          },
          "azureMonitor": {
            "aggOptions": [],
            "dimensionFilter": "*",
            "dimensionFilters": [],
            "metricDefinition": "select",
            "metricName": "select",
            "metricNamespace": "select",
            "resourceGroup": "select",
            "resourceName": "select",
            "timeGrain": "auto",
            "timeGrains": [],
            "top": "10"
          },
          "hide": false,
          "insightsAnalytics": {
            "query": "",
            "resultFormat": "time_series"
          },
          "queryType": "Azure Log Analytics",
          "refId": "A",
          "subscription": "7b0bcc15-eef6-000-000-23bc213ce163"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Pod Logs (Top 500)",
      "transformations": [
        {
          "id": "filterFieldsByName",
          "options": {}
        }
      ],
      "type": "logs"
    }
  ],
  "refresh": "",
  "schemaVersion": 27,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {
          "selected": false,
          "text": "",
          "value": "28e9b35c-b075-0000-0100-e2122192d28d"
        },
        "datasource": "Azure Monitor",
        "definition": "workspaces()",
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "Workspace",
        "options": [],
        "query": "workspaces()",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {
          "selected": false,
          "text": "",
          "value": ""
        },
        "datasource": "Azure Monitor",
        "definition": "ResourceGroups()",
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "ResourceGroups",
        "options": [],
        "query": "ResourceGroups()",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {
          "selected": false,
          "text": "",
          "value": ""
        },
        "datasource": "Azure Monitor",
        "definition": "ResourceNames($ResourceGroups, Microsoft.ContainerService/managedClusters)",
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "AKS",
        "options": [],
        "query": "ResourceNames($ResourceGroups, Microsoft.ContainerService/managedClusters)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {
          "selected": true,
          "text": "",
          "value": ""
        },
        "datasource": "Azure Monitor",
        "definition": "KubePodInventory | where ClusterName == \"$AKS\" | summarize count() by Namespace | project Namespace",
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "Namespace",
        "options": [],
        "query": "KubePodInventory | where ClusterName == \"$AKS\" | summarize count() by Namespace | project Namespace",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {
          "selected": false,
          "text": "",
          "value": ""
        },
        "datasource": "Azure Monitor",
        "definition": "KubePodInventory | where ClusterName == \"$AKS\" | where Namespace == \"$Namespace\" | project PodName=Name",
        "description": "ContainerName",
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": "",
        "multi": false,
        "name": "ContainerName",
        "options": [],
        "query": "KubePodInventory | where ClusterName == \"$AKS\" | where Namespace == \"$Namespace\" | project PodName=Name",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-1h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "Microsoft Azure Monitor Insights - Logs",
  "uid": "kA1lnBiMkncr",
  "version": 1
}