{
  "uid": "atlas-gitops",
  "title": "Atlas GitOps",
  "folderUid": "atlas-internal",
  "editable": true,
  "panels": [
    {
      "id": 1,
      "type": "stat",
      "title": "Flux Source",
      "datasource": {
        "type": "prometheus",
        "uid": "atlas-vm"
      },
      "gridPos": {
        "h": 4,
        "w": 8,
        "x": 0,
        "y": 0
      },
      "targets": [
        {
          "expr": "max by (branch, revision) (ananke_gitops_flux_source_info{job=\"ananke-power\",namespace=\"flux-system\",name=\"flux-system\"}) or on() vector(0)",
          "refId": "A",
          "legendFormat": "{{branch}} \u00b7 {{revision}}",
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "dark-red",
                "value": null
              },
              {
                "color": "dark-blue",
                "value": 1
              }
            ]
          },
          "unit": "none",
          "custom": {
            "displayMode": "auto"
          }
        },
        "overrides": []
      },
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "center",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "name"
      },
      "description": "Branch and revision currently reported by Flux's GitRepository source."
    },
    {
      "id": 2,
      "type": "stat",
      "title": "Kustomizations Ready",
      "datasource": {
        "type": "prometheus",
        "uid": "atlas-vm"
      },
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 8,
        "y": 0
      },
      "targets": [
        {
          "expr": "100 * sum(max by (namespace, name) (ananke_gitops_kustomization_ready{job=\"ananke-power\"})) / clamp_min(count(max by (namespace, name) (ananke_gitops_kustomization_ready{job=\"ananke-power\"})), 1)",
          "refId": "A"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "dark-red",
                "value": null
              },
              {
                "color": "dark-yellow",
                "value": 99
              },
              {
                "color": "dark-blue",
                "value": 100
              }
            ]
          },
          "unit": "percent",
          "custom": {
            "displayMode": "auto"
          },
          "decimals": 1
        },
        "overrides": []
      },
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "center",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "value"
      }
    },
    {
      "id": 3,
      "type": "stat",
      "title": "Kustomizations Suspended",
      "datasource": {
        "type": "prometheus",
        "uid": "atlas-vm"
      },
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 12,
        "y": 0
      },
      "targets": [
        {
          "expr": "sum(max by (namespace, name) (ananke_gitops_kustomization_suspended{job=\"ananke-power\"})) or on() vector(0)",
          "refId": "A"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "dark-blue",
                "value": null
              },
              {
                "color": "dark-red",
                "value": 1
              }
            ]
          },
          "unit": "none",
          "custom": {
            "displayMode": "auto"
          }
        },
        "overrides": []
      },
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "center",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "value"
      }
    },
    {
      "id": 4,
      "type": "stat",
      "title": "HelmReleases Ready",
      "datasource": {
        "type": "prometheus",
        "uid": "atlas-vm"
      },
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 16,
        "y": 0
      },
      "targets": [
        {
          "expr": "100 * sum(max by (namespace, name) (ananke_gitops_helmrelease_ready{job=\"ananke-power\"})) / clamp_min(count(max by (namespace, name) (ananke_gitops_helmrelease_ready{job=\"ananke-power\"})), 1)",
          "refId": "A"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "dark-red",
                "value": null
              },
              {
                "color": "dark-yellow",
                "value": 99
              },
              {
                "color": "dark-blue",
                "value": 100
              }
            ]
          },
          "unit": "percent",
          "custom": {
            "displayMode": "auto"
          },
          "decimals": 1
        },
        "overrides": []
      },
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "center",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "value"
      }
    },
    {
      "id": 5,
      "type": "stat",
      "title": "HelmReleases Suspended",
      "datasource": {
        "type": "prometheus",
        "uid": "atlas-vm"
      },
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 20,
        "y": 0
      },
      "targets": [
        {
          "expr": "sum(max by (namespace, name) (ananke_gitops_helmrelease_suspended{job=\"ananke-power\"})) or on() vector(0)",
          "refId": "A"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "dark-blue",
                "value": null
              },
              {
                "color": "dark-red",
                "value": 1
              }
            ]
          },
          "unit": "none",
          "custom": {
            "displayMode": "auto"
          }
        },
        "overrides": []
      },
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "center",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "value"
      }
    },
    {
      "id": 6,
      "type": "stat",
      "title": "GitOps Exporter",
      "datasource": {
        "type": "prometheus",
        "uid": "atlas-vm"
      },
      "gridPos": {
        "h": 4,
        "w": 8,
        "x": 0,
        "y": 4
      },
      "targets": [
        {
          "expr": "min(ananke_gitops_scrape_success{job=\"ananke-power\"}) or on() vector(0)",
          "refId": "A",
          "legendFormat": "Scrape Success",
          "instant": true
        },
        {
          "expr": "(time() - max(ananke_gitops_last_scrape_timestamp_seconds{job=\"ananke-power\"})) or on() vector(0)",
          "refId": "B",
          "legendFormat": "Sample Age",
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "dark-red",
                "value": null
              },
              {
                "color": "dark-blue",
                "value": 1
              }
            ]
          },
          "unit": "none",
          "custom": {
            "displayMode": "auto"
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Sample Age"
            },
            "properties": [
              {
                "id": "unit",
                "value": "s"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Scrape Success"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-red",
                      "value": null
                    },
                    {
                      "color": "dark-blue",
                      "value": 1
                    }
                  ]
                }
              }
            ]
          }
        ]
      },
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "center",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "name_and_value"
      }
    },
    {
      "id": 7,
      "type": "state-timeline",
      "title": "Readiness History",
      "description": "Ready percentage over time for Flux Kustomizations and HelmReleases.",
      "datasource": {
        "type": "prometheus",
        "uid": "atlas-vm"
      },
      "gridPos": {
        "h": 4,
        "w": 16,
        "x": 8,
        "y": 4
      },
      "targets": [
        {
          "expr": "label_replace(100 * sum(max by (namespace, name) (ananke_gitops_kustomization_ready{job=\"ananke-power\"})) / clamp_min(count(max by (namespace, name) (ananke_gitops_kustomization_ready{job=\"ananke-power\"})), 1), \"kind\", \"Kustomizations\", \"__name__\", \".*\") or label_replace(100 * sum(max by (namespace, name) (ananke_gitops_helmrelease_ready{job=\"ananke-power\"})) / clamp_min(count(max by (namespace, name) (ananke_gitops_helmrelease_ready{job=\"ananke-power\"})), 1), \"kind\", \"HelmReleases\", \"__name__\", \".*\")",
          "refId": "A",
          "legendFormat": "{{kind}}",
          "format": "time_series",
          "instant": false,
          "range": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "unit": "percent",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "dark-red",
                "value": null
              },
              {
                "color": "dark-yellow",
                "value": 99
              },
              {
                "color": "dark-blue",
                "value": 100
              }
            ]
          },
          "custom": {
            "fillOpacity": 70,
            "lineWidth": 0,
            "spanNulls": true
          },
          "min": 0,
          "max": 100
        },
        "overrides": []
      },
      "options": {
        "mergeValues": true,
        "showValue": "never",
        "legend": {
          "displayMode": "list",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      }
    },
    {
      "id": 8,
      "type": "table",
      "title": "Flux Sources",
      "datasource": {
        "type": "prometheus",
        "uid": "atlas-vm"
      },
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 8
      },
      "targets": [
        {
          "expr": "max by (namespace, name, url, branch, revision, ready, reason) (ananke_gitops_flux_source_info{job=\"ananke-power\"}) * on(namespace, name) group_left() max by (namespace, name) (ananke_gitops_flux_source_ready{job=\"ananke-power\"})",
          "refId": "A",
          "instant": true,
          "format": "table"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "none",
          "custom": {
            "filterable": true
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Value"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-red",
                      "value": null
                    },
                    {
                      "color": "dark-blue",
                      "value": 1
                    }
                  ]
                }
              }
            ]
          }
        ]
      },
      "options": {
        "showHeader": true,
        "columnFilters": false
      },
      "transformations": [
        {
          "id": "labelsToFields",
          "options": {}
        }
      ],
      "description": "A Value of 1 means Ready; 0 means not Ready."
    },
    {
      "id": 9,
      "type": "table",
      "title": "Kustomizations",
      "datasource": {
        "type": "prometheus",
        "uid": "atlas-vm"
      },
      "gridPos": {
        "h": 12,
        "w": 24,
        "x": 0,
        "y": 16
      },
      "targets": [
        {
          "expr": "max by (namespace, name, path, source_namespace, source_name, revision, ready, reason) (ananke_gitops_kustomization_info{job=\"ananke-power\"}) * on(namespace, name) group_left() max by (namespace, name) (ananke_gitops_kustomization_ready{job=\"ananke-power\"})",
          "refId": "A",
          "instant": true,
          "format": "table"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "none",
          "custom": {
            "filterable": true
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Value"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-red",
                      "value": null
                    },
                    {
                      "color": "dark-blue",
                      "value": 1
                    }
                  ]
                }
              }
            ]
          }
        ]
      },
      "options": {
        "showHeader": true,
        "columnFilters": false
      },
      "transformations": [
        {
          "id": "labelsToFields",
          "options": {}
        }
      ],
      "description": "A Value of 1 means Ready; 0 means not Ready. The ready/reason labels come from Flux status.conditions."
    },
    {
      "id": 10,
      "type": "table",
      "title": "HelmReleases",
      "datasource": {
        "type": "prometheus",
        "uid": "atlas-vm"
      },
      "gridPos": {
        "h": 12,
        "w": 24,
        "x": 0,
        "y": 28
      },
      "targets": [
        {
          "expr": "max by (namespace, name, chart, version, app_version, revision, ready, reason) (ananke_gitops_helmrelease_info{job=\"ananke-power\"}) * on(namespace, name) group_left() max by (namespace, name) (ananke_gitops_helmrelease_ready{job=\"ananke-power\"})",
          "refId": "A",
          "instant": true,
          "format": "table"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "none",
          "custom": {
            "filterable": true
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Value"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-red",
                      "value": null
                    },
                    {
                      "color": "dark-blue",
                      "value": 1
                    }
                  ]
                }
              }
            ]
          }
        ]
      },
      "options": {
        "showHeader": true,
        "columnFilters": false
      },
      "transformations": [
        {
          "id": "labelsToFields",
          "options": {}
        }
      ],
      "description": "A Value of 1 means Ready; 0 means not Ready. Chart/version/app_version are included when Flux reports them."
    }
  ],
  "time": {
    "from": "now-12h",
    "to": "now"
  },
  "annotations": {
    "list": []
  },
  "schemaVersion": 39,
  "style": "dark",
  "tags": [
    "atlas",
    "gitops",
    "flux"
  ]
}
