{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS",
      "label": "Prometheus",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    },
    {
      "name": "DS_LOKI",
      "label": "Loki",
      "description": "",
      "type": "datasource",
      "pluginId": "loki",
      "pluginName": "Loki"
    }
  ],
  "__elements": {},
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "10.0.0"
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "1.0.0"
    },
    {
      "type": "datasource",
      "id": "loki",
      "name": "Loki",
      "version": "1.0.0"
    }
  ],
  "annotations": {
    "list": []
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 1,
  "id": null,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "collapsed": false,
      "gridPos": {"h": 1, "w": 24, "x": 0, "y": 0},
      "id": 200,
      "panels": [],
      "title": "Render Error Logs",
      "type": "row"
    },
    {
      "datasource": {"type": "loki", "uid": "${DS_LOKI}"},
      "gridPos": {"h": 10, "w": 24, "x": 0, "y": 1},
      "id": 201,
      "options": {
        "dedupStrategy": "none",
        "enableLogDetails": true,
        "prettifyLogMessage": false,
        "showCommonLabels": false,
        "showLabels": false,
        "showLogLevelColumn": false,
        "showTime": true,
        "sortOrder": "Descending",
        "wrapLogMessage": true
      },
      "targets": [
        {
          "datasource": {"type": "loki", "uid": "${DS_LOKI}"},
          "expr": "{$log_selector} | json service, category, levelname, message, exc_info | service=\"render\" | levelname=\"ERROR\" | line_format \"{{.message}}\"",
          "refId": "A"
        }
      ],
      "title": "Render Service Errors",
      "type": "logs"
    },
    {
      "collapsed": false,
      "gridPos": {"h": 1, "w": 24, "x": 0, "y": 11},
      "id": 210,
      "panels": [],
      "title": "DHCP Error Logs",
      "type": "row"
    },
    {
      "datasource": {"type": "loki", "uid": "${DS_LOKI}"},
      "gridPos": {"h": 10, "w": 24, "x": 0, "y": 12},
      "id": 211,
      "options": {
        "dedupStrategy": "none",
        "enableLogDetails": true,
        "prettifyLogMessage": false,
        "showCommonLabels": false,
        "showLabels": false,
        "showLogLevelColumn": false,
        "showTime": true,
        "sortOrder": "Descending",
        "wrapLogMessage": true
      },
      "targets": [
        {
          "datasource": {"type": "loki", "uid": "${DS_LOKI}"},
          "expr": "{$log_selector} | json service, category, levelname, message, exc_info | service=\"dhcp\" | levelname=~\"ERROR|WARNING\" | line_format \"{{.message}}\"",
          "refId": "A"
        }
      ],
      "title": "DHCP Service Errors & Warnings",
      "type": "logs"
    },
    {
      "collapsed": false,
      "gridPos": {"h": 1, "w": 24, "x": 0, "y": 22},
      "id": 220,
      "panels": [],
      "title": "Metrics",
      "type": "row"
    },
    {
      "datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
      "fieldConfig": {
        "defaults": {
          "color": {"mode": "palette-classic"},
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "events/sec",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {"legend": false, "tooltip": false, "viz": false},
            "lineInterpolation": "linear",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {"type": "linear"},
            "showPoints": "never",
            "spanNulls": false,
            "stacking": {"group": "A", "mode": "none"},
            "thresholdsStyle": {"mode": "off"}
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [{"color": "green", "value": null}]
          },
          "unit": "ops"
        },
        "overrides": [
          {
            "matcher": {"id": "byName", "options": "Failed"},
            "properties": [{"id": "color", "value": {"fixedColor": "red", "mode": "fixed"}}]
          }
        ]
      },
      "gridPos": {"h": 8, "w": 10, "x": 0, "y": 23},
      "id": 221,
      "options": {
        "legend": {"calcs": ["lastNotNull"], "displayMode": "list", "placement": "bottom", "showLegend": true},
        "tooltip": {"mode": "multi", "sort": "desc"}
      },
      "targets": [
        {
          "datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
          "expr": "sum(rate(nv_config_manager_nautobot_change_messages_processed{namespace=~\"$namespace\"}[5m]))",
          "legendFormat": "Processed",
          "refId": "A"
        },
        {
          "datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
          "expr": "sum(rate(nv_config_manager_nautobot_change_messages_failed{namespace=~\"$namespace\"}[5m]))",
          "legendFormat": "Failed",
          "refId": "B"
        }
      ],
      "title": "Render Events",
      "type": "timeseries"
    },
    {
      "datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
      "fieldConfig": {
        "defaults": {
          "color": {"mode": "thresholds"},
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {"color": "green", "value": null},
              {"color": "yellow", "value": 300},
              {"color": "red", "value": 600}
            ]
          },
          "unit": "s"
        }
      },
      "gridPos": {"h": 8, "w": 4, "x": 10, "y": 23},
      "id": 232,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
        "textMode": "auto"
      },
      "targets": [
        {
          "datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
          "expr": "time() - min(nv_config_manager_dhcp_cache_last_refresh_timestamp_seconds{namespace=~\"$namespace\"}) by (ip_version)",
          "refId": "A"
        }
      ],
      "title": "DHCP Config Age",
      "type": "stat"
    },
    {
      "datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
      "fieldConfig": {
        "defaults": {
          "color": {"mode": "palette-classic"},
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {"legend": false, "tooltip": false, "viz": false},
            "lineInterpolation": "linear",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {"type": "linear"},
            "showPoints": "never",
            "spanNulls": false,
            "stacking": {"group": "A", "mode": "none"},
            "thresholdsStyle": {"mode": "off"}
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [{"color": "green", "value": null}]
          },
          "unit": "reqps"
        }
      },
      "gridPos": {"h": 8, "w": 10, "x": 14, "y": 23},
      "id": 233,
      "options": {
        "legend": {"calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true},
        "tooltip": {"mode": "multi", "sort": "none"}
      },
      "targets": [
        {
          "datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
          "expr": "sum by (handler) (rate({__name__=~\"nv_config_manager_.+_http_requests_total\", namespace=~\"$namespace\"}[5m]))",
          "legendFormat": "{{handler}}",
          "refId": "A"
        }
      ],
      "title": "HTTP Request Rate",
      "type": "timeseries"
    },
    {
      "collapsed": false,
      "gridPos": {"h": 1, "w": 24, "x": 0, "y": 31},
      "id": 300,
      "panels": [],
      "title": "Logs by Service",
      "type": "row"
    },
    {
      "datasource": {"type": "loki", "uid": "${DS_LOKI}"},
      "gridPos": {"h": 12, "w": 24, "x": 0, "y": 32},
      "id": 301,
      "options": {
        "dedupStrategy": "none",
        "enableLogDetails": true,
        "prettifyLogMessage": false,
        "showCommonLabels": false,
        "showLabels": false,
        "showLogLevelColumn": false,
        "showTime": true,
        "sortOrder": "Descending",
        "wrapLogMessage": true
      },
      "targets": [
        {
          "datasource": {"type": "loki", "uid": "${DS_LOKI}"},
          "expr": "{$log_selector} | json service, category, levelname, message, exc_info | service=\"render\" | line_format \"{{.message}}\"",
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "Render Logs",
      "type": "logs"
    },
    {
      "datasource": {"type": "loki", "uid": "${DS_LOKI}"},
      "gridPos": {"h": 12, "w": 24, "x": 0, "y": 44},
      "id": 302,
      "options": {
        "dedupStrategy": "none",
        "enableLogDetails": true,
        "prettifyLogMessage": false,
        "showCommonLabels": false,
        "showLabels": false,
        "showLogLevelColumn": false,
        "showTime": true,
        "sortOrder": "Descending",
        "wrapLogMessage": true
      },
      "targets": [
        {
          "datasource": {"type": "loki", "uid": "${DS_LOKI}"},
          "expr": "{$log_selector} | json service, category, levelname, message, exc_info | service=\"dhcp\" | line_format \"{{.message}}\"",
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "DHCP Logs",
      "type": "logs"
    },
    {
      "datasource": {"type": "loki", "uid": "${DS_LOKI}"},
      "gridPos": {"h": 12, "w": 24, "x": 0, "y": 56},
      "id": 306,
      "options": {
        "dedupStrategy": "none",
        "enableLogDetails": true,
        "prettifyLogMessage": false,
        "showCommonLabels": false,
        "showLabels": false,
        "showLogLevelColumn": false,
        "showTime": true,
        "sortOrder": "Descending",
        "wrapLogMessage": true
      },
      "targets": [
        {
          "datasource": {"type": "loki", "uid": "${DS_LOKI}"},
          "expr": "{$log_selector, k8s_container_name=\"kea\"} |~ \"DHCP[46]\"",
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "KEA DHCP Logs",
      "type": "logs"
    },
    {
      "datasource": {"type": "loki", "uid": "${DS_LOKI}"},
      "gridPos": {"h": 12, "w": 24, "x": 0, "y": 68},
      "id": 303,
      "options": {
        "dedupStrategy": "none",
        "enableLogDetails": true,
        "prettifyLogMessage": false,
        "showCommonLabels": false,
        "showLabels": false,
        "showLogLevelColumn": false,
        "showTime": true,
        "sortOrder": "Descending",
        "wrapLogMessage": true
      },
      "targets": [
        {
          "datasource": {"type": "loki", "uid": "${DS_LOKI}"},
          "expr": "{$log_selector} | json service, category, levelname, message, exc_info | service=~\"config-store.*\" | line_format \"{{.message}}\"",
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "Config Store Logs",
      "type": "logs"
    },
    {
      "datasource": {"type": "loki", "uid": "${DS_LOKI}"},
      "gridPos": {"h": 12, "w": 24, "x": 0, "y": 80},
      "id": 304,
      "options": {
        "dedupStrategy": "none",
        "enableLogDetails": true,
        "prettifyLogMessage": false,
        "showCommonLabels": false,
        "showLabels": false,
        "showLogLevelColumn": false,
        "showTime": true,
        "sortOrder": "Descending",
        "wrapLogMessage": true
      },
      "targets": [
        {
          "datasource": {"type": "loki", "uid": "${DS_LOKI}"},
          "expr": "{$log_selector} | json service, category, levelname, message, exc_info | service=~\"ztp.*\" | line_format \"{{.message}}\"",
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "ZTP Logs",
      "type": "logs"
    },
    {
      "datasource": {"type": "loki", "uid": "${DS_LOKI}"},
      "gridPos": {"h": 12, "w": 24, "x": 0, "y": 92},
      "id": 305,
      "options": {
        "dedupStrategy": "none",
        "enableLogDetails": true,
        "prettifyLogMessage": false,
        "showCommonLabels": false,
        "showLabels": false,
        "showLogLevelColumn": false,
        "showTime": true,
        "sortOrder": "Descending",
        "wrapLogMessage": true
      },
      "targets": [
        {
          "datasource": {"type": "loki", "uid": "${DS_LOKI}"},
          "expr": "{$log_selector} | json service, category, levelname, message, exc_info | service=~\"temporal.*\" | line_format \"{{.message}}\"",
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "Temporal Logs",
      "type": "logs"
    }
  ],
  "refresh": "30s",
  "schemaVersion": 39,
  "tags": ["nv-config-manager", "overview"],
  "templating": {
    "list": [
      {
        "current": {},
        "hide": 0,
        "includeAll": false,
        "label": "Prometheus",
        "multi": false,
        "name": "DS_PROMETHEUS",
        "options": [],
        "query": "prometheus",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "type": "datasource"
      },
      {
        "current": {},
        "hide": 0,
        "includeAll": false,
        "label": "Loki",
        "multi": false,
        "name": "DS_LOKI",
        "options": [],
        "query": "loki",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "type": "datasource"
      },
      {
        "current": {
          "selected": true,
          "text": "namespace=\"nv-config-manager\"",
          "value": "namespace=\"nv-config-manager\""
        },
        "description": "Loki stream selector labels. Examples: namespace=\"nv-config-manager\" or cluster=\"my-cluster\", k8s_namespace_name=\"nv-config-manager-prod\"",
        "hide": 0,
        "label": "Log Selector",
        "name": "log_selector",
        "options": [],
        "query": "namespace=\"nv-config-manager\"",
        "skipUrlSync": false,
        "type": "textbox"
      },
      {
        "current": {
          "selected": true,
          "text": "nv-config-manager",
          "value": "nv-config-manager"
        },
        "description": "Kubernetes namespace for Prometheus metrics filtering",
        "hide": 0,
        "label": "Namespace",
        "name": "namespace",
        "options": [],
        "query": "nv-config-manager",
        "skipUrlSync": false,
        "type": "textbox"
      }
    ]
  },
  "time": {
    "from": "now-1h",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "",
  "title": "NVIDIA Config Manager Overview",
  "uid": "nv-config-manager-overview",
  "version": 0
}
