{
  "__inputs": [
    {
      "name": "DS_LOKI",
      "label": "Loki",
      "description": "",
      "type": "datasource",
      "pluginId": "loki",
      "pluginName": "Loki"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "8.2.5"
    },
    {
      "type": "panel",
      "id": "logs",
      "name": "Logs",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "loki",
      "name": "Loki",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "stat",
      "name": "Stat",
      "version": ""
    },
    {
      "type": "panel",
      "id": "timeseries",
      "name": "Time series",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "description": "Universal and flexible dashboard for logging",
  "editable": true,
  "fiscalYearStartMonth": 0,
  "gnetId": 12611,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1645450976056,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "cacheTimeout": null,
      "datasource": "${DS_LOKI}",
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [
            {
              "options": {
                "match": "null",
                "result": {
                  "color": "super-light-green",
                  "index": 0,
                  "text": "0"
                }
              },
              "type": "special"
            }
          ],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "super-light-green",
                "value": null
              },
              {
                "color": "light-green",
                "value": 100
              },
              {
                "color": "semi-dark-green",
                "value": 500
              },
              {
                "color": "dark-green",
                "value": 1000
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 3,
        "w": 8,
        "x": 0,
        "y": 0
      },
      "id": 11,
      "interval": null,
      "links": [],
      "maxDataPoints": 100,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [
            "sum"
          ],
          "fields": "",
          "values": false
        },
        "text": {
          "valueSize": 60
        },
        "textMode": "auto"
      },
      "pluginVersion": "8.2.5",
      "targets": [
        {
          "expr": "sum(count_over_time(({app=\"$app\", service=~\"$service\"})[$__interval]))",
          "hide": false,
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Total",
      "type": "stat"
    },
    {
      "cacheTimeout": null,
      "datasource": "${DS_LOKI}",
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [
            {
              "options": {
                "match": "null",
                "result": {
                  "color": "super-light-orange",
                  "index": 0,
                  "text": "0"
                }
              },
              "type": "special"
            }
          ],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "super-light-orange",
                "value": null
              },
              {
                "color": "light-orange",
                "value": 5
              },
              {
                "color": "semi-dark-orange",
                "value": 20
              },
              {
                "color": "dark-orange",
                "value": 50
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 3,
        "w": 8,
        "x": 8,
        "y": 0
      },
      "id": 6,
      "interval": null,
      "links": [],
      "maxDataPoints": 100,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [
            "sum"
          ],
          "fields": "",
          "values": false
        },
        "text": {
          "valueSize": 60
        },
        "textMode": "auto"
      },
      "pluginVersion": "8.2.5",
      "targets": [
        {
          "expr": "sum(count_over_time(({app=\"$app\", service=~\"$service\", level=\"WARN\"} |~ \"(?i)$searchable_pattern\")[$__interval]))",
          "hide": false,
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Warnings $searchable_pattern",
      "type": "stat"
    },
    {
      "cacheTimeout": null,
      "datasource": "${DS_LOKI}",
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [
            {
              "options": {
                "match": "null",
                "result": {
                  "color": "super-light-red",
                  "index": 0,
                  "text": "0"
                }
              },
              "type": "special"
            }
          ],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "super-light-red",
                "value": null
              },
              {
                "color": "light-red",
                "value": 1
              },
              {
                "color": "semi-dark-red",
                "value": 5
              },
              {
                "color": "dark-red",
                "value": 10
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 3,
        "w": 8,
        "x": 16,
        "y": 0
      },
      "id": 21,
      "interval": null,
      "links": [],
      "maxDataPoints": 100,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [
            "sum"
          ],
          "fields": "",
          "values": false
        },
        "text": {
          "valueSize": 60
        },
        "textMode": "auto"
      },
      "pluginVersion": "8.2.5",
      "targets": [
        {
          "expr": "sum(count_over_time(({app=\"$app\", service=~\"$service\", level=\"ERROR\"} |~ \"(?i)$searchable_pattern\")[$__interval]))",
          "hide": false,
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Errors $searchable_pattern",
      "type": "stat"
    },
    {
      "cacheTimeout": null,
      "datasource": "${DS_LOKI}",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "bars",
            "fillOpacity": 40,
            "gradientMode": "hue",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "links": [],
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 8,
        "x": 0,
        "y": 3
      },
      "id": 7,
      "interval": null,
      "links": [],
      "maxDataPoints": 100,
      "options": {
        "legend": {
          "calcs": [
            "sum"
          ],
          "displayMode": "table",
          "placement": "right"
        },
        "tooltip": {
          "mode": "single"
        }
      },
      "pluginVersion": "8.2.5",
      "targets": [
        {
          "expr": "sum(count_over_time(({app=\"$app\", service=~\"$service\"})[$__interval])) by (service)",
          "hide": false,
          "legendFormat": "{{service}}",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Services",
      "type": "timeseries"
    },
    {
      "cacheTimeout": null,
      "datasource": "${DS_LOKI}",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisLabel": "Count",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "bars",
            "fillOpacity": 40,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "stepAfter",
            "lineStyle": {
              "fill": "solid"
            },
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "decimals": 0,
          "links": [],
          "mappings": [
            {
              "options": {
                "ERROR": {
                  "color": "red",
                  "index": 2,
                  "text": "error"
                },
                "INFO": {
                  "color": "green",
                  "index": 0,
                  "text": "info"
                },
                "WARN": {
                  "color": "orange",
                  "index": 1,
                  "text": "warning"
                }
              },
              "type": "value"
            }
          ],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "short"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "ERROR"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "dark-red",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "WARN"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "orange",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "INFO"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "green",
                  "mode": "fixed"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 6,
        "w": 8,
        "x": 8,
        "y": 3
      },
      "id": 18,
      "interval": "1m",
      "links": [],
      "maxDataPoints": "",
      "options": {
        "legend": {
          "calcs": [
            "sum"
          ],
          "displayMode": "table",
          "placement": "right"
        },
        "tooltip": {
          "mode": "single"
        }
      },
      "pluginVersion": "8.2.5",
      "targets": [
        {
          "expr": "sum(count_over_time(({app=\"$app\", service=~\"$service\", level=~\"$level\"} |~ \"(?i)$searchable_pattern\")[$__interval])) by (level)",
          "instant": false,
          "legendFormat": "{{level}}",
          "range": true,
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Levels",
      "type": "timeseries"
    },
    {
      "alert": {
        "alertRuleTags": {},
        "conditions": [
          {
            "evaluator": {
              "params": [
                0
              ],
              "type": "gt"
            },
            "operator": {
              "type": "and"
            },
            "query": {
              "params": [
                "A",
                "5m",
                "now"
              ]
            },
            "reducer": {
              "params": [],
              "type": "sum"
            },
            "type": "query"
          }
        ],
        "executionErrorState": "alerting",
        "for": "5m",
        "frequency": "1m",
        "handler": 1,
        "name": "Error Log",
        "noDataState": "ok",
        "notifications": []
      },
      "cacheTimeout": null,
      "datasource": "${DS_LOKI}",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisGridShow": false,
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "bars",
            "fillOpacity": 19,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "stepAfter",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "line+area"
            }
          },
          "links": [],
          "mappings": [
            {
              "options": {
                "null": {
                  "index": 0,
                  "text": "None"
                }
              },
              "type": "value"
            }
          ],
          "noValue": "0",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 1
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 8,
        "x": 16,
        "y": 3
      },
      "id": 10,
      "interval": null,
      "links": [],
      "maxDataPoints": 100,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "hidden",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "single"
        }
      },
      "pluginVersion": "8.2.5",
      "targets": [
        {
          "expr": "sum(count_over_time(({level=\"ERROR\"})[5m]))",
          "hide": false,
          "instant": false,
          "legendFormat": "",
          "range": true,
          "refId": "A"
        }
      ],
      "thresholds": [
        {
          "colorMode": "critical",
          "op": "gt",
          "value": 0,
          "visible": true
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Errors",
      "type": "timeseries"
    },
    {
      "datasource": "${DS_LOKI}",
      "description": "",
      "gridPos": {
        "h": 14,
        "w": 24,
        "x": 0,
        "y": 9
      },
      "id": 2,
      "options": {
        "dedupStrategy": "none",
        "enableLogDetails": true,
        "prettifyLogMessage": false,
        "showCommonLabels": false,
        "showLabels": false,
        "showTime": false,
        "sortOrder": "Ascending",
        "wrapLogMessage": true
      },
      "targets": [
        {
          "expr": "{app=\"$app\", service=~\"$service\", level=~\"$level\"} |~ \"(?i)$searchable_pattern\" ",
          "hide": false,
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Live logs",
      "transparent": true,
      "type": "logs"
    }
  ],
  "refresh": "30s",
  "schemaVersion": 32,
  "style": "dark",
  "tags": [
    "Loki",
    "logging"
  ],
  "templating": {
    "list": [
      {
        "allValue": "h8lio",
        "current": {},
        "datasource": "${DS_LOKI}",
        "definition": "label_values(app)",
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": "Application",
        "multi": false,
        "name": "app",
        "options": [],
        "query": "label_values(app)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "allValue": ".*",
        "current": {},
        "datasource": "${DS_LOKI}",
        "definition": "label_values(service)",
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": true,
        "label": "Service",
        "multi": true,
        "name": "service",
        "options": [],
        "query": "label_values(service)",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": ".*",
        "current": {},
        "datasource": "${DS_LOKI}",
        "definition": "label_values(level)",
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": true,
        "label": "Level",
        "multi": true,
        "name": "level",
        "options": [],
        "query": "label_values(level)",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {
          "selected": true,
          "text": "",
          "value": ""
        },
        "description": null,
        "error": null,
        "hide": 0,
        "label": "Search (case insensitive)",
        "name": "searchable_pattern",
        "options": [
          {
            "selected": true,
            "text": "",
            "value": ""
          }
        ],
        "query": "",
        "skipUrlSync": false,
        "type": "textbox"
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "Logging > Overview",
  "uid": "fRIvzUZMz",
  "version": 24
}
