{
  "annotations": {
    "list": []
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 0,
  "id": null,
  "links": [],
  "panels": [
    {
      "datasource": {
        "type": "prometheus",
        "uid": "Prometheus"
      },
      "fieldConfig": {
        "defaults": {
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 6,
        "x": 0,
        "y": 0
      },
      "id": 1,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto",
        "wideLayout": true
      },
      "pluginVersion": "11.3.1",
      "targets": [
        {
          "expr": "ours_rp_publication_points",
          "legendFormat": "publication points",
          "refId": "A"
        }
      ],
      "title": "Publication Points",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "Prometheus"
      },
      "fieldConfig": {
        "defaults": {
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 6,
        "x": 6,
        "y": 0
      },
      "id": 2,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto",
        "wideLayout": true
      },
      "pluginVersion": "11.3.1",
      "targets": [
        {
          "expr": "ours_rp_repo_sync_phase_count{phase=\"rrdp_ok\"}",
          "legendFormat": "rrdp ok",
          "refId": "A"
        }
      ],
      "title": "RRDP OK Points",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "Prometheus"
      },
      "fieldConfig": {
        "defaults": {
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 6,
        "x": 12,
        "y": 0
      },
      "id": 3,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto",
        "wideLayout": true
      },
      "pluginVersion": "11.3.1",
      "targets": [
        {
          "expr": "sum(ours_rp_repo_sync_phase_count{phase=\"rrdp_failed_rsync_ok\"}) or vector(0)",
          "legendFormat": "fallback",
          "refId": "A"
        }
      ],
      "title": "Rsync Fallback Points",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "Prometheus"
      },
      "fieldConfig": {
        "defaults": {
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 6,
        "x": 18,
        "y": 0
      },
      "id": 4,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto",
        "wideLayout": true
      },
      "pluginVersion": "11.3.1",
      "targets": [
        {
          "expr": "ours_rp_repo_terminal_state_count{terminal_state=\"failed_no_cache\"}",
          "legendFormat": "failed no cache",
          "refId": "A"
        }
      ],
      "title": "Failed No Cache Points",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "Prometheus"
      },
      "fieldConfig": {
        "defaults": {
          "unit": "s"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 4
      },
      "id": 5,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull"
          ],
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "targets": [
        {
          "expr": "ours_rp_run_stage_duration_seconds{stage=\"repo_sync_total\"}",
          "legendFormat": "repo sync total",
          "refId": "A"
        },
        {
          "expr": "ours_rp_run_stage_duration_seconds{stage=\"rrdp_download_total\"}",
          "legendFormat": "rrdp download",
          "refId": "B"
        },
        {
          "expr": "ours_rp_run_stage_duration_seconds{stage=\"rsync_download_total\"}",
          "legendFormat": "rsync download",
          "refId": "C"
        }
      ],
      "title": "Repo Sync Download Durations",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "Prometheus"
      },
      "fieldConfig": {
        "defaults": {
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "x": 0,
        "y": 12,
        "w": 12,
        "h": 8
      },
      "id": 6,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull"
          ],
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "targets": [
        {
          "expr": "ours_rp_repo_sync_phase_count",
          "legendFormat": "{{phase}}",
          "refId": "A"
        }
      ],
      "title": "Repo Sync Phase Counts",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "Prometheus"
      },
      "fieldConfig": {
        "defaults": {
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "x": 12,
        "y": 12,
        "w": 12,
        "h": 8
      },
      "id": 7,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull"
          ],
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "targets": [
        {
          "expr": "ours_rp_repo_sync_phase_count{phase=\"rrdp_failed_rsync_ok\"}",
          "legendFormat": "rrdp failed, rsync ok",
          "refId": "A"
        },
        {
          "expr": "ours_rp_repo_sync_phase_count{phase=\"rrdp_failed_rsync_failed\"}",
          "legendFormat": "rrdp failed, rsync failed",
          "refId": "B"
        },
        {
          "expr": "ours_rp_repo_terminal_state_count{terminal_state=\"failed_no_cache\"}",
          "legendFormat": "failed no cache",
          "refId": "C"
        },
        {
          "expr": "ours_rp_tree_instances{state=\"failed\"}",
          "legendFormat": "tree failed",
          "refId": "D"
        }
      ],
      "title": "Repo Failure / Fallback Counts",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "Prometheus"
      },
      "fieldConfig": {
        "defaults": {
          "unit": "s"
        },
        "overrides": []
      },
      "gridPos": {
        "x": 0,
        "y": 20,
        "w": 12,
        "h": 8
      },
      "id": 8,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull"
          ],
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "targets": [
        {
          "expr": "ours_rp_repo_sync_phase_duration_seconds_total{phase=\"rrdp_failed_rsync_ok\"}",
          "legendFormat": "rsync fallback duration",
          "refId": "A"
        },
        {
          "expr": "ours_rp_repo_sync_phase_duration_seconds_total{phase=\"rrdp_failed_rsync_failed\"}",
          "legendFormat": "failed duration",
          "refId": "B"
        },
        {
          "expr": "ours_rp_repo_terminal_state_duration_seconds_total{terminal_state=\"failed_no_cache\"}",
          "legendFormat": "failed no cache duration",
          "refId": "C"
        }
      ],
      "title": "Repo Failure / Fallback Durations",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "Prometheus"
      },
      "fieldConfig": {
        "defaults": {
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "x": 0,
        "y": 29,
        "w": 12,
        "h": 9
      },
      "id": 9,
      "options": {
        "showHeader": true,
        "cellHeight": "sm",
        "footer": {
          "show": false,
          "reducer": [
            "sum"
          ],
          "countRows": false,
          "fields": ""
        }
      },
      "pluginVersion": "11.3.1",
      "targets": [
        {
          "expr": "ours_rp_rrdp_rsync_failed_repository_duration_seconds",
          "format": "table",
          "instant": true,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "RRDP + Rsync Failed Repositories",
      "type": "table",
      "transformations": [
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "job": true,
              "terminal_state": true,
              "rank": true,
              "transport": true,
              "__name__": true,
              "publication_points": true,
              "instance": true,
              "repo_id": true,
              "pp_id": true,
              "exported_instance": true,
              "rp": true,
              "source": true
            },
            "indexByName": {
              "Time": 0,
              "host": 1,
              "phase": 2,
              "uri": 3,
              "Value": 4
            },
            "renameByName": {
              "Value": "duration"
            }
          }
        }
      ]
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "Prometheus"
      },
      "fieldConfig": {
        "defaults": {
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "x": 12,
        "y": 29,
        "w": 12,
        "h": 9
      },
      "id": 11,
      "options": {
        "showHeader": true,
        "cellHeight": "sm",
        "footer": {
          "show": false,
          "reducer": [
            "sum"
          ],
          "countRows": false,
          "fields": ""
        }
      },
      "pluginVersion": "11.3.1",
      "targets": [
        {
          "expr": "topk(20, ours_rp_top_repository_sync_duration_seconds)",
          "format": "table",
          "instant": true,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "Top 20 Repositories by Sync Duration",
      "type": "table",
      "transformations": [
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "job": true,
              "terminal_state": true,
              "__name__": true,
              "publication_points": true,
              "instance": true,
              "repo_id": true,
              "phase": true,
              "pp_id": true,
              "exported_instance": true,
              "rp": true,
              "source": true
            },
            "indexByName": {
              "Time": 0,
              "host": 1,
              "rank": 2,
              "transport": 3,
              "uri": 4,
              "Value": 5
            },
            "renameByName": {
              "Value": "value"
            }
          }
        }
      ]
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "Prometheus"
      },
      "fieldConfig": {
        "defaults": {
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "x": 0,
        "y": 38,
        "w": 24,
        "h": 9
      },
      "id": 10,
      "options": {
        "showHeader": true,
        "cellHeight": "sm",
        "footer": {
          "show": false,
          "reducer": [
            "sum"
          ],
          "countRows": false,
          "fields": ""
        }
      },
      "pluginVersion": "11.3.1",
      "targets": [
        {
          "expr": "topk(20, ours_rp_top_publication_point_object_count)",
          "format": "table",
          "instant": true,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "Top Publication Points by Objects",
      "type": "table",
      "transformations": [
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "job": true,
              "__name__": true,
              "publication_points": true,
              "instance": true,
              "repo_id": true,
              "phase": true,
              "pp_id": true,
              "exported_instance": true,
              "rp": true,
              "source": true
            },
            "indexByName": {
              "Time": 0,
              "host": 1,
              "rank": 2,
              "terminal_state": 3,
              "transport": 4,
              "uri": 5,
              "Value": 6
            },
            "renameByName": {}
          }
        }
      ]
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "Prometheus"
      },
      "description": "Per-repository sync success in the latest successful run; 1 means successful, 0 means failed or failed_no_cache.",
      "fieldConfig": {
        "defaults": {
          "unit": "bool"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 47
      },
      "id": 12,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull"
          ],
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "expr": "ours_rp_repository_sync_success",
          "legendFormat": "{{host}} {{repo_id}}",
          "refId": "A"
        }
      ],
      "title": "Repository Sync Success by Repo",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "Prometheus"
      },
      "description": "Per-repository total sync duration aggregated from publication point repo_sync_duration_ms.",
      "fieldConfig": {
        "defaults": {
          "unit": "s"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 55
      },
      "id": 13,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull"
          ],
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "expr": "ours_rp_repository_sync_duration_seconds{stat=\"sum\"}",
          "legendFormat": "{{host}} {{repo_id}}",
          "refId": "A"
        }
      ],
      "title": "Repository Sync Duration by Repo",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "Prometheus"
      },
      "description": "Per-repository downloaded bytes attributed from report.json downloads events.",
      "fieldConfig": {
        "defaults": {
          "unit": "bytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 63
      },
      "id": 14,
      "options": {
        "legend": {
          "calcs": [
            "lastNotNull"
          ],
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "expr": "ours_rp_repository_download_bytes",
          "legendFormat": "{{host}} {{repo_id}}",
          "refId": "A"
        }
      ],
      "title": "Repository Download Bytes by Repo",
      "type": "timeseries"
    }
  ],
  "refresh": "5s",
  "schemaVersion": 40,
  "tags": [
    "ours-rp",
    "rpki",
    "soak",
    "repo-sync"
  ],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-30m",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "browser",
  "title": "Ours RP Repo Sync",
  "uid": "ours-rp-repo-sync",
  "version": 3,
  "weekStart": ""
}
