{
  "tags": [],
  "title": "cert-manager",
  "widgets": [
    {
      "layout": {
        "x": 0,
        "y": 0,
        "width": 12,
        "height": 4
      },
      "definition": {
        "type": "group",
        "title": "Certificates",
        "widgets": [
          {
            "layout": {
              "x": 0,
              "y": 0,
              "width": 6,
              "height": 2
            },
            "definition": {
              "type": "note",
              "content": "**Time Left**\n\nUnsupported panel (table)\n\n- `certmanager_certificate_expiration_timestamp_seconds - time()` cannot be expressed: Datadog formulas have no time() function; only the absolute expiry timestamp (cert_manager.certificate.expiration_timestamp) is available\n\nOriginal PromQL:\n```\nA: sort_desc( sum(certmanager_certificate_expiration_timestamp_seconds{exported_namespace=~\"$namespace\"} - time()) by (name,exported_namespace) )\n```",
              "tick_pos": "50%",
              "font_size": "14",
              "show_tick": false,
              "tick_edge": "left",
              "text_align": "left",
              "has_padding": true,
              "vertical_align": "top",
              "background_color": "white"
            }
          },
          {
            "layout": {
              "x": 6,
              "y": 0,
              "width": 6,
              "height": 2
            },
            "definition": {
              "type": "timeseries",
              "title": "Certificate Ready Status",
              "yaxis": {
                "max": "auto",
                "min": "auto",
                "label": "",
                "scale": "linear",
                "include_zero": false
              },
              "markers": [
                {
                  "value": "y = 80",
                  "display_type": "error dashed"
                }
              ],
              "requests": [
                {
                  "style": {
                    "palette": "dog_classic",
                    "line_type": "solid",
                    "line_width": "normal"
                  },
                  "queries": [
                    {
                      "name": "query1",
                      "query": "sum:cert_manager.certificate.ready_status{*} by {condition}",
                      "data_source": "metrics"
                    }
                  ],
                  "formulas": [
                    {
                      "formula": "query1"
                    }
                  ],
                  "display_type": "line",
                  "response_format": "timeseries"
                }
              ],
              "show_legend": true,
              "legend_layout": "auto",
              "legend_columns": [
                "avg",
                "min",
                "max",
                "value",
                "sum"
              ]
            }
          },
          {
            "layout": {
              "x": 0,
              "y": 2,
              "width": 12,
              "height": 2
            },
            "definition": {
              "type": "note",
              "content": "**Time Left**\n\nUnsupported panel (timeseries)\n\n- time() subtraction (seconds until expiry) is not expressible in Datadog formulas; consider a monitor on cert_manager.certificate.expiration_timestamp instead\n\nOriginal PromQL:\n```\nA: sum(certmanager_certificate_expiration_timestamp_seconds{exported_namespace=~\"$namespace\"} - time()) BY (name,exported_namespace)\n```",
              "tick_pos": "50%",
              "font_size": "14",
              "show_tick": false,
              "tick_edge": "left",
              "text_align": "left",
              "has_padding": true,
              "vertical_align": "top",
              "background_color": "white"
            }
          }
        ],
        "show_title": true,
        "layout_type": "ordered"
      }
    },
    {
      "layout": {
        "x": 0,
        "y": 4,
        "width": 12,
        "height": 2
      },
      "definition": {
        "type": "group",
        "title": "ACME Client",
        "widgets": [
          {
            "layout": {
              "x": 0,
              "y": 0,
              "width": 10,
              "height": 2
            },
            "definition": {
              "type": "timeseries",
              "title": "Overall requests per 2m",
              "yaxis": {
                "max": "auto",
                "min": "auto",
                "label": "",
                "scale": "linear",
                "include_zero": true
              },
              "markers": [
                {
                  "value": "y = 80",
                  "display_type": "error dashed"
                }
              ],
              "requests": [
                {
                  "style": {
                    "palette": "dog_classic",
                    "line_type": "solid",
                    "line_width": "normal"
                  },
                  "queries": [
                    {
                      "name": "query1",
                      "query": "sum:cert_manager.http_acme_client.request.count{*} by {status,path}.as_rate()",
                      "data_source": "metrics"
                    }
                  ],
                  "formulas": [
                    {
                      "formula": "query1"
                    }
                  ],
                  "display_type": "area",
                  "response_format": "timeseries"
                }
              ],
              "show_legend": true,
              "legend_layout": "auto",
              "legend_columns": [
                "avg",
                "min",
                "max",
                "value",
                "sum"
              ]
            }
          },
          {
            "layout": {
              "x": 10,
              "y": 0,
              "width": 2,
              "height": 2
            },
            "definition": {
              "type": "query_value",
              "title": "Total requests",
              "requests": [
                {
                  "queries": [
                    {
                      "name": "query1",
                      "query": "sum:cert_manager.http_acme_client_request_count{*}.as_count()",
                      "aggregator": "sum",
                      "data_source": "metrics"
                    }
                  ],
                  "formulas": [
                    {
                      "formula": "query1"
                    }
                  ],
                  "response_format": "scalar",
                  "conditional_formats": [
                    {
                      "value": 80,
                      "palette": "white_on_red",
                      "comparator": ">="
                    }
                  ]
                }
              ],
              "autoscale": true,
              "precision": 2,
              "text_align": "center"
            }
          }
        ],
        "show_title": true,
        "layout_type": "ordered"
      }
    }
  ],
  "description": "Converted from Grafana dashboard https://grafana.com/grafana/dashboards/20340 (by Consileo). Monitors Certificates managed by cert-manager",
  "layout_type": "ordered",
  "reflow_type": "fixed",
  "template_variables": [
    {
      "name": "namespace",
      "prefix": "exported_namespace",
      "default": "*",
      "available_values": []
    },
    {
      "name": "certificate",
      "prefix": "name",
      "default": "*",
      "available_values": []
    }
  ]
}