kind: ConfigMap
apiVersion: v1
metadata:
  name: assisted-events-scrape
  labels:
    grafana_dashboard: "true"
  annotations:
    grafana-folder: /grafana-dashboard-definitions/AssistedInstaller
data:
  assisted-installer.json: |-
    {
      "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"
          }
        ]
      },
      "editable": true,
      "fiscalYearStartMonth": 0,
      "graphTooltip": 1,
      "iteration": 1649686877703,
      "links": [],
      "liveNow": false,
      "panels": [
        {
          "collapsed": false,
          "gridPos": {
            "h": 1,
            "w": 24,
            "x": 0,
            "y": 0
          },
          "id": 23,
          "panels": [],
          "title": "Events Scraper",
          "type": "row"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "axisLabel": "",
                "axisPlacement": "auto",
                "barAlignment": 0,
                "drawStyle": "line",
                "fillOpacity": 0,
                "gradientMode": "none",
                "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"
                }
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green",
                    "value": null
                  },
                  {
                    "color": "red",
                    "value": 80
                  }
                ]
              }
            },
            "overrides": []
          },
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 0,
            "y": 1
          },
          "id": 27,
          "options": {
            "legend": {
              "calcs": [],
              "displayMode": "list",
              "placement": "bottom"
            },
            "tooltip": {
              "mode": "single",
              "sort": "none"
            }
          },
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${datasource}"
              },
              "exemplar": true,
              "expr": "avg(rate(container_cpu_usage_seconds_total{namespace=\"${namespace}\",container=\"assisted-events-scrape\"}[$interval]))",
              "hide": false,
              "interval": "",
              "legendFormat": "Cpu usage avg",
              "refId": "A"
            },
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${datasource}"
              },
              "exemplar": true,
              "expr": "stddev(rate(container_cpu_cfs_throttled_seconds_total{namespace=\"${namespace}\",container=\"assisted-events-scrape\"}[$interval]))",
              "hide": false,
              "interval": "",
              "legendFormat": "Cpu usage stddev",
              "refId": "B"
            },
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${datasource}"
              },
              "exemplar": true,
              "expr": "avg(rate(container_cpu_cfs_throttled_seconds_total{namespace=\"${namespace}\",container=\"assisted-events-scrape\"}[$interval]))",
              "hide": false,
              "interval": "",
              "legendFormat": "Throttling",
              "refId": "C"
            }
          ],
          "title": "CPU Usage",
          "type": "timeseries"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "axisLabel": "",
                "axisPlacement": "auto",
                "barAlignment": 0,
                "drawStyle": "line",
                "fillOpacity": 0,
                "gradientMode": "none",
                "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"
                }
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green",
                    "value": null
                  },
                  {
                    "color": "red",
                    "value": 80
                  }
                ]
              },
              "unit": "bytes"
            },
            "overrides": [
              {
                "matcher": {
                  "id": "byName",
                  "options": "limit"
                },
                "properties": [
                  {
                    "id": "custom.lineStyle",
                    "value": {
                      "dash": [
                        0,
                        10
                      ],
                      "fill": "dot"
                    }
                  }
                ]
              },
              {
                "matcher": {
                  "id": "byName",
                  "options": "request"
                },
                "properties": [
                  {
                    "id": "custom.lineStyle",
                    "value": {
                      "dash": [
                        0,
                        10
                      ],
                      "fill": "dot"
                    }
                  }
                ]
              }
            ]
          },
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 12,
            "y": 1
          },
          "id": 29,
          "options": {
            "legend": {
              "calcs": [],
              "displayMode": "list",
              "placement": "bottom"
            },
            "tooltip": {
              "mode": "single",
              "sort": "none"
            }
          },
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${datasource}"
              },
              "exemplar": true,
              "expr": "avg(container_memory_working_set_bytes{namespace=\"${namespace}\",container=\"assisted-events-scrape\"})",
              "interval": "",
              "legendFormat": "avg",
              "refId": "A"
            },
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${datasource}"
              },
              "exemplar": true,
              "expr": "stddev(container_memory_working_set_bytes{namespace=\"${namespace}\",container=\"assisted-events-scrape\"})",
              "hide": true,
              "interval": "",
              "legendFormat": "stddev",
              "refId": "B"
            },
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${datasource}"
              },
              "exemplar": true,
              "expr": "max(kube_pod_container_resource_limits{namespace=\"assisted-installer-${environment}\",container=\"assisted-events-scrape\",resource=\"memory\"})",
              "hide": false,
              "interval": "",
              "legendFormat": "limit",
              "refId": "C"
            },
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${datasource}"
              },
              "exemplar": true,
              "expr": "max(kube_pod_container_resource_requests{namespace=\"assisted-installer-${environment}\",container=\"assisted-events-scrape\",resource=\"memory\"})",
              "hide": false,
              "interval": "",
              "legendFormat": "request",
              "refId": "D"
            }
          ],
          "title": "Memory usage",
          "type": "timeseries"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "axisLabel": "",
                "axisPlacement": "auto",
                "barAlignment": 0,
                "drawStyle": "line",
                "fillOpacity": 0,
                "gradientMode": "none",
                "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"
                }
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green",
                    "value": null
                  },
                  {
                    "color": "red",
                    "value": 80
                  }
                ]
              }
            },
            "overrides": []
          },
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 0,
            "y": 9
          },
          "id": 25,
          "options": {
            "legend": {
              "calcs": [],
              "displayMode": "list",
              "placement": "bottom"
            },
            "tooltip": {
              "mode": "single",
              "sort": "none"
            }
          },
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${datasource}"
              },
              "exemplar": true,
              "expr": "max(kube_pod_container_status_restarts_total{namespace=\"${namespace}\",container=\"assisted-events-scrape\"}) by (pod)",
              "interval": "",
              "legendFormat": "Restarts {{ pod }}",
              "refId": "A"
            },
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${datasource}"
              },
              "exemplar": true,
              "expr": "",
              "hide": false,
              "interval": "",
              "legendFormat": "",
              "refId": "B"
            }
          ],
          "title": "Restarts",
          "type": "timeseries"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${datasource}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "axisLabel": "",
                "axisPlacement": "auto",
                "barAlignment": 0,
                "drawStyle": "line",
                "fillOpacity": 0,
                "gradientMode": "none",
                "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"
                }
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green",
                    "value": null
                  },
                  {
                    "color": "red",
                    "value": 80
                  }
                ]
              },
              "unit": "bytes"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 12,
            "y": 9
          },
          "id": 31,
          "options": {
            "legend": {
              "calcs": [],
              "displayMode": "list",
              "placement": "bottom"
            },
            "tooltip": {
              "mode": "single",
              "sort": "none"
            }
          },
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${datasource}"
              },
              "exemplar": true,
              "expr": "rate(container_network_receive_bytes_total{namespace=\"${namespace}\",pod=~\"assisted-events-scrape.*\"}[$interval])",
              "interval": "",
              "legendFormat": "RX",
              "refId": "A"
            },
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${datasource}"
              },
              "exemplar": true,
              "expr": "rate(container_network_transmit_bytes_total{namespace=\"${namespace}\",pod=~\"assisted-events-scrape.*\"}[$interval])",
              "hide": false,
              "interval": "",
              "legendFormat": "TX",
              "refId": "B"
            }
          ],
          "title": "RX/TX bytes",
          "type": "timeseries"
        },
        {
          "collapsed": true,
          "gridPos": {
            "h": 1,
            "w": 24,
            "x": 0,
            "y": 17
          },
          "id": 38,
          "panels": [
            {
              "datasource": {
                "type": "cloudwatch",
                "uid": "P4AAF69133323129D"
              },
              "description": "Errors from stage environment",
              "gridPos": {
                "h": 8,
                "w": 12,
                "x": 0,
                "y": 18
              },
              "id": 36,
              "options": {
                "dedupStrategy": "none",
                "enableLogDetails": true,
                "prettifyLogMessage": false,
                "showCommonLabels": false,
                "showLabels": false,
                "showTime": false,
                "sortOrder": "Descending",
                "wrapLogMessage": false
              },
              "targets": [
                {
                  "datasource": {
                    "type": "cloudwatch",
                    "uid": "P4AAF69133323129D"
                  },
                  "expression": "fields message\n| filter message like '\"levelname\": \"ERROR\"'\n| filter kubernetes.container_name = \"assisted-events-scrape\" and kubernetes.namespace_name = \"assisted-installer-production\"\n| sort @timestamp desc\n| limit 100",
                  "id": "",
                  "logGroupNames": [
                    "app-sre-prod-04-5ts49.application"
                  ],
                  "namespace": "",
                  "queryMode": "Logs",
                  "refId": "A",
                  "region": "default",
                  "statsGroups": []
                }
              ],
              "title": "[PROD] Error log",
              "type": "logs"
            },
            {
              "datasource": {
                "type": "cloudwatch",
                "uid": "P4AAF69133323129D"
              },
              "description": "Errors from stage environment",
              "gridPos": {
                "h": 8,
                "w": 12,
                "x": 12,
                "y": 18
              },
              "id": 39,
              "options": {
                "dedupStrategy": "none",
                "enableLogDetails": true,
                "prettifyLogMessage": false,
                "showCommonLabels": false,
                "showLabels": false,
                "showTime": false,
                "sortOrder": "Descending",
                "wrapLogMessage": false
              },
              "targets": [
                {
                  "datasource": {
                    "type": "cloudwatch",
                    "uid": "P4AAF69133323129D"
                  },
                  "expression": "fields message\n| filter kubernetes.container_name = \"assisted-events-scrape\" and kubernetes.namespace_name = \"assisted-installer-production\"\n| sort @timestamp desc\n| limit 100",
                  "id": "",
                  "logGroupNames": [
                    "app-sre-prod-04-5ts49.application"
                  ],
                  "namespace": "",
                  "queryMode": "Logs",
                  "refId": "A",
                  "region": "default",
                  "statsGroups": []
                }
              ],
              "title": "[PROD] Log tail",
              "type": "logs"
            }
          ],
          "title": "[PRODUCTION] Logs",
          "type": "row"
        },
        {
          "collapsed": true,
          "gridPos": {
            "h": 1,
            "w": 24,
            "x": 0,
            "y": 18
          },
          "id": 35,
          "panels": [
            {
              "datasource": {
                "type": "cloudwatch",
                "uid": "P05A8419FC4179100"
              },
              "description": "Errors from stage environment",
              "gridPos": {
                "h": 8,
                "w": 12,
                "x": 0,
                "y": 27
              },
              "id": 33,
              "options": {
                "dedupStrategy": "none",
                "enableLogDetails": true,
                "prettifyLogMessage": false,
                "showCommonLabels": false,
                "showLabels": false,
                "showTime": false,
                "sortOrder": "Descending",
                "wrapLogMessage": false
              },
              "targets": [
                {
                  "datasource": {
                    "type": "cloudwatch",
                    "uid": "P05A8419FC4179100"
                  },
                  "expression": "fields message\n| filter kubernetes.container_name = \"assisted-events-scrape\" and kubernetes.namespace_name = \"assisted-installer-stage\"\n| filter message like '\"levelname\": \"ERROR\"'\n| sort @timestamp desc\n| limit 100",
                  "id": "",
                  "logGroupNames": [
                    "app-sre-stage-0-ctbn8.application"
                  ],
                  "namespace": "",
                  "queryMode": "Logs",
                  "refId": "A",
                  "region": "default",
                  "statsGroups": []
                }
              ],
              "title": "[STAGE] Error log",
              "type": "logs"
            },
            {
              "datasource": {
                "type": "cloudwatch",
                "uid": "P05A8419FC4179100"
              },
              "description": "Errors from stage environment",
              "gridPos": {
                "h": 8,
                "w": 12,
                "x": 12,
                "y": 27
              },
              "id": 40,
              "options": {
                "dedupStrategy": "none",
                "enableLogDetails": true,
                "prettifyLogMessage": false,
                "showCommonLabels": false,
                "showLabels": false,
                "showTime": false,
                "sortOrder": "Descending",
                "wrapLogMessage": false
              },
              "targets": [
                {
                  "datasource": {
                    "type": "cloudwatch",
                    "uid": "P05A8419FC4179100"
                  },
                  "expression": "fields message\n| filter kubernetes.container_name = \"assisted-events-scrape\" and kubernetes.namespace_name = \"assisted-installer-stage\"\n| sort @timestamp desc\n| limit 100",
                  "id": "",
                  "logGroupNames": [
                    "app-sre-stage-0-ctbn8.application"
                  ],
                  "namespace": "",
                  "queryMode": "Logs",
                  "refId": "A",
                  "region": "default",
                  "statsGroups": []
                }
              ],
              "title": "[STAGE] Error log",
              "type": "logs"
            }
          ],
          "title": "[STAGE] Logs",
          "type": "row"
        }
      ],
      "refresh": "",
      "schemaVersion": 35,
      "style": "dark",
      "tags": [],
      "templating": {
        "list": [
          {
            "current": {
              "selected": false,
              "text": "assisted-installer-production",
              "value": "assisted-installer-production"
            },
            "datasource": {
              "type": "prometheus",
              "uid": "${datasource}"
            },
            "definition": "label_values(namespace)",
            "hide": 0,
            "includeAll": false,
            "label": "namespace",
            "multi": false,
            "name": "namespace",
            "options": [],
            "query": {
              "query": "label_values(namespace)",
              "refId": "StandardVariableQuery"
            },
            "refresh": 1,
            "regex": "/^assisted-installer-.*$/",
            "skipUrlSync": false,
            "sort": 0,
            "type": "query"
          },
          {
            "current": {
              "selected": true,
              "text": "app-sre-prod-04-prometheus",
              "value": "app-sre-prod-04-prometheus"
            },
            "hide": 0,
            "includeAll": false,
            "multi": false,
            "name": "datasource",
            "options": [],
            "query": "prometheus",
            "queryValue": "",
            "refresh": 1,
            "regex": "/.*/",
            "skipUrlSync": false,
            "type": "datasource"
          },
          {
            "auto": true,
            "auto_count": 30,
            "auto_min": "10s",
            "current": {
              "selected": false,
              "text": "auto",
              "value": "$__auto_interval_interval"
            },
            "hide": 0,
            "name": "interval",
            "options": [
              {
                "selected": true,
                "text": "auto",
                "value": "$__auto_interval_interval"
              },
              {
                "selected": false,
                "text": "1m",
                "value": "1m"
              },
              {
                "selected": false,
                "text": "5m",
                "value": "5m"
              },
              {
                "selected": false,
                "text": "10m",
                "value": "10m"
              },
              {
                "selected": false,
                "text": "30m",
                "value": "30m"
              },
              {
                "selected": false,
                "text": "1h",
                "value": "1h"
              },
              {
                "selected": false,
                "text": "6h",
                "value": "6h"
              },
              {
                "selected": false,
                "text": "12h",
                "value": "12h"
              },
              {
                "selected": false,
                "text": "1d",
                "value": "1d"
              },
              {
                "selected": false,
                "text": "7d",
                "value": "7d"
              },
              {
                "selected": false,
                "text": "14d",
                "value": "14d"
              },
              {
                "selected": false,
                "text": "30d",
                "value": "30d"
              }
            ],
            "query": "1m,5m,10m,30m,1h,6h,12h,1d,7d,14d,30d",
            "queryValue": "",
            "refresh": 2,
            "skipUrlSync": false,
            "type": "interval"
          }
        ]
      },
      "time": {
        "from": "now-30m",
        "to": "now"
      },
      "timepicker": {},
      "timezone": "",
      "title": "Assisted Events Scrape",
      "uid": "eUOTqvP7z",
      "version": 1,
      "weekStart": ""
    }
