# Source: grafana-dashboard/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: grafana-dashboard-cert-manager
  labels:
    app.kubernetes.io/instance: cert-manager
    app.kubernetes.io/name: grafana-dashboard
    helm.sh/chart: grafana-dashboard-0.2.0
    jenkins-x.io/grafana-dashboard: "1"
    gitops.jenkins-x.io/pipeline: 'namespaces'
  annotations:
    meta.helm.sh/release-name: 'grafana-dashboard'
  namespace: jx-observability
data:
  cert-manager.json: |-
    {
      "annotations": {
        "list": [
          {
            "builtIn": 1,
            "datasource": "-- Grafana --",
            "enable": true,
            "hide": true,
            "iconColor": "rgba(0, 211, 255, 1)",
            "name": "Annotations & Alerts",
            "type": "dashboard"
          }
        ]
      },
      "editable": true,
      "gnetId": null,
      "graphTooltip": 0,
      "id": 7,
      "iteration": 1614938433756,
      "links": [],
      "panels": [
        {
          "alignNumbersToRightEnabled": false,
          "columnAliases": [],
          "columnFiltersEnabled": true,
          "columnWidthHints": [],
          "columns": [],
          "compactRowsEnabled": true,
          "datasource": "Prometheus",
          "datatablePagingType": "simple_numbers",
          "datatableTheme": "basic_theme",
          "emptyData": false,
          "fieldConfig": {
            "defaults": {
              "color": {},
              "custom": {},
              "thresholds": {
                "mode": "absolute",
                "steps": []
              }
            },
            "overrides": []
          },
          "fontSize": "100%",
          "gridPos": {
            "h": 7,
            "w": 24,
            "x": 0,
            "y": 0
          },
          "hoverEnabled": true,
          "id": 16,
          "infoEnabled": true,
          "lengthChangeEnabled": true,
          "orderColumnEnabled": true,
          "pagingTypes": [
            {
              "$$hashKey": "object:98",
              "text": "Page number buttons only",
              "value": "numbers"
            },
            {
              "$$hashKey": "object:99",
              "text": "'Previous' and 'Next' buttons only",
              "value": "simple"
            },
            {
              "$$hashKey": "object:100",
              "text": "'Previous' and 'Next' buttons, plus page numbers",
              "value": "simple_numbers"
            },
            {
              "$$hashKey": "object:101",
              "text": "'First', 'Previous', 'Next' and 'Last' buttons",
              "value": "full"
            },
            {
              "$$hashKey": "object:102",
              "text": "'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers",
              "value": "full_numbers"
            },
            {
              "$$hashKey": "object:103",
              "text": "'First' and 'Last' buttons, plus page numbers",
              "value": "first_last_numbers"
            }
          ],
          "panelHeight": 211,
          "pluginVersion": "7.4.0",
          "rowNumbersEnabled": false,
          "rowsPerPage": 50,
          "scroll": true,
          "scrollHeight": "default",
          "searchEnabled": true,
          "searchHighlightingEnabled": true,
          "showCellBorders": false,
          "showHeader": true,
          "showRowBorders": false,
          "sort": {
            "col": 0,
            "desc": true
          },
          "sortByColumns": [
            {
              "$$hashKey": "object:36",
              "columnData": "2",
              "sortMethod": "asc"
            },
            {
              "$$hashKey": "object:377",
              "columnData": "1",
              "sortMethod": "asc"
            }
          ],
          "sortByColumnsData": [
            [
              2,
              "asc"
            ]
          ],
          "stripedRowsEnabled": true,
          "styles": [
            {
              "$$hashKey": "object:38",
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "pattern": "Time",
              "type": "date"
            },
            {
              "$$hashKey": "object:227",
              "colorMode": null,
              "colors": [
                "rgba(245, 54, 54, 0.9)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(50, 172, 45, 0.97)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "mappingType": 1,
              "pattern": "Value",
              "splitPattern": "/ /",
              "thresholds": [],
              "type": "date",
              "unit": "short"
            }
          ],
          "targets": [
            {
              "expr": "sum by (name) (certmanager_certificate_expiration_timestamp_seconds*1000)",
              "format": "table",
              "instant": true,
              "interval": "",
              "legendFormat": "",
              "queryType": "randomWalk",
              "refId": "A"
            }
          ],
          "themeOptions": {
            "dark": "./styles/dark.scss",
            "light": "./styles/light.scss"
          },
          "themes": [
            {
              "$$hashKey": "object:73",
              "disabled": false,
              "text": "Basic",
              "value": "basic_theme"
            },
            {
              "$$hashKey": "object:74",
              "disabled": true,
              "text": "Bootstrap",
              "value": "bootstrap_theme"
            },
            {
              "$$hashKey": "object:75",
              "disabled": true,
              "text": "Foundation",
              "value": "foundation_theme"
            },
            {
              "$$hashKey": "object:76",
              "disabled": true,
              "text": "ThemeRoller",
              "value": "themeroller_theme"
            }
          ],
          "title": "Certificates expiration dates",
          "transform": "table",
          "type": "briangann-datatable-panel"
        },
        {
          "datasource": "Prometheus",
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "axisLabel": "",
                "axisPlacement": "auto",
                "barAlignment": 0,
                "drawStyle": "line",
                "fillOpacity": 10,
                "gradientMode": "none",
                "hideFrom": {
                  "graph": false,
                  "legend": false,
                  "tooltip": false
                },
                "lineInterpolation": "linear",
                "lineWidth": 1,
                "pointSize": 5,
                "scaleDistribution": {
                  "type": "linear"
                },
                "showPoints": "never",
                "spanNulls": true
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green",
                    "value": null
                  },
                  {
                    "color": "red",
                    "value": 80
                  }
                ]
              },
              "unit": "none"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 0,
            "y": 7
          },
          "id": 4,
          "options": {
            "graph": {},
            "legend": {
              "calcs": [],
              "displayMode": "list",
              "placement": "bottom"
            },
            "tooltipOptions": {
              "mode": "single"
            }
          },
          "pluginVersion": "7.4.0",
          "targets": [
            {
              "expr": "sum by(pod) (rate(container_cpu_usage_seconds_total{container=\"cert-manager\"}[5m]))",
              "interval": "",
              "legendFormat": "",
              "queryType": "randomWalk",
              "refId": "A"
            }
          ],
          "title": "CPU used",
          "type": "timeseries"
        },
        {
          "datasource": "Prometheus",
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "axisLabel": "",
                "axisPlacement": "auto",
                "barAlignment": 0,
                "drawStyle": "line",
                "fillOpacity": 10,
                "gradientMode": "none",
                "hideFrom": {
                  "graph": false,
                  "legend": false,
                  "tooltip": false
                },
                "lineInterpolation": "linear",
                "lineWidth": 1,
                "pointSize": 5,
                "scaleDistribution": {
                  "type": "linear"
                },
                "showPoints": "never",
                "spanNulls": true
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green",
                    "value": null
                  },
                  {
                    "color": "red",
                    "value": 80
                  }
                ]
              },
              "unit": "decbytes"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 12,
            "y": 7
          },
          "id": 6,
          "options": {
            "graph": {},
            "legend": {
              "calcs": [],
              "displayMode": "list",
              "placement": "bottom"
            },
            "tooltipOptions": {
              "mode": "single"
            }
          },
          "pluginVersion": "7.4.0",
          "targets": [
            {
              "expr": "sum by(pod) (container_memory_working_set_bytes{container=\"cert-manager\"})",
              "interval": "",
              "legendFormat": "",
              "queryType": "randomWalk",
              "refId": "A"
            }
          ],
          "title": "Memory used",
          "type": "timeseries"
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "Prometheus",
          "description": "",
          "fieldConfig": {
            "defaults": {
              "color": {},
              "custom": {},
              "thresholds": {
                "mode": "absolute",
                "steps": []
              },
              "unit": "short"
            },
            "overrides": []
          },
          "fill": 1,
          "fillGradient": 0,
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 0,
            "y": 15
          },
          "hiddenSeries": false,
          "id": 14,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "hideEmpty": false,
            "hideZero": false,
            "max": false,
            "min": false,
            "rightSide": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "nullPointMode": "null as zero",
          "options": {
            "alertThreshold": true
          },
          "percentage": false,
          "pluginVersion": "7.4.0",
          "pointradius": 2,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": true,
          "steppedLine": false,
          "targets": [
            {
              "expr": "count(certmanager_certificate_ready_status{condition=\"True\"} == 1)",
              "hide": false,
              "instant": false,
              "interval": "",
              "legendFormat": "ready",
              "queryType": "randomWalk",
              "refId": "A"
            },
            {
              "expr": "count(certmanager_certificate_ready_status{condition=\"False\"} == 1)",
              "hide": false,
              "interval": "",
              "legendFormat": "not ready",
              "refId": "B"
            },
            {
              "expr": "count(certmanager_certificate_ready_status{condition=\"Unknown\"} == 1)",
              "hide": false,
              "interval": "",
              "legendFormat": "unknown",
              "refId": "C"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Certificates statuses",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "cumulative"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:701",
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "$$hashKey": "object:702",
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {},
          "bars": true,
          "dashLength": 10,
          "dashes": false,
          "datasource": "Loki",
          "fieldConfig": {
            "defaults": {
              "custom": {}
            },
            "overrides": []
          },
          "fill": 1,
          "fillGradient": 0,
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 12,
            "y": 15
          },
          "hiddenSeries": false,
          "id": 8,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": false,
          "linewidth": 1,
          "nullPointMode": "null",
          "options": {
            "alertThreshold": true
          },
          "percentage": false,
          "pluginVersion": "7.4.0",
          "pointradius": 2,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": true,
          "steppedLine": false,
          "targets": [
            {
              "expr": "count_over_time({app=\"cert-manager\"} |~ \"(?i)$search\" [$__interval])",
              "instant": false,
              "legendFormat": "logs",
              "queryType": "randomWalk",
              "range": true,
              "refId": "A"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Logs",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:65",
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "$$hashKey": "object:66",
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "datasource": "Loki",
          "description": "",
          "fieldConfig": {
            "defaults": {
              "custom": {},
              "thresholds": {
                "mode": "absolute",
                "steps": []
              }
            },
            "overrides": []
          },
          "gridPos": {
            "h": 16,
            "w": 24,
            "x": 0,
            "y": 23
          },
          "id": 12,
          "options": {
            "showLabels": false,
            "showTime": true,
            "sortOrder": "Descending",
            "wrapLogMessage": false
          },
          "pluginVersion": "7.3.5",
          "targets": [
            {
              "expr": "{app=\"cert-manager\"} |~ \"(?i)$search\" | json | line_format \"{{.log}}\"",
              "legendFormat": "",
              "queryType": "randomWalk",
              "refId": "A"
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "Logs",
          "type": "logs"
        }
      ],
      "refresh": false,
      "schemaVersion": 27,
      "style": "dark",
      "tags": [
        "jenkins-x",
        "cert-manager"
      ],
      "templating": {
        "list": [
          {
            "current": {
              "selected": false,
              "text": "",
              "value": ""
            },
            "description": null,
            "error": null,
            "hide": 0,
            "label": null,
            "name": "search",
            "options": [
              {
                "selected": true,
                "text": "",
                "value": ""
              }
            ],
            "query": "",
            "skipUrlSync": false,
            "type": "textbox"
          }
        ]
      },
      "time": {
        "from": "now-6h",
        "to": "now"
      },
      "timepicker": {},
      "timezone": "",
      "title": "cert-manager",
      "uid": "cert-manager",
      "version": 1
    }
