{
  "type": "record",
  "Aspect": {
    "name": "monitorBootstrapStatus"
  },
  "name": "AssertionMonitorBootstrapStatus",
  "namespace": "com.linkedin.pegasus2avro.monitor",
  "fields": [
    {
      "type": [
        "null",
        {
          "type": "record",
          "name": "AssertionMonitorMetricsCubeBootstrapStatus",
          "namespace": "com.linkedin.pegasus2avro.monitor",
          "fields": [
            {
              "Searchable": {
                "fieldName": "bootstrapState"
              },
              "type": {
                "type": "enum",
                "symbolDocs": {
                  "COMPLETED": "All historical buckets have been successfully processed.",
                  "FAILED": "The bootstrap task failed with an unrecoverable error.",
                  "PENDING": "Awaiting pickup by the bootstrap job.",
                  "REJECTED": "Bootstrap was rejected. This can occur when bootstrapConfig is\nnot present on the monitor, or when the bootstrap job determines the\nmonitor is ineligible (e.g. missing or invalid bootstrapConfig).",
                  "RUNNING": "The bootstrap job is actively running.",
                  "SUBMITTED": "The bootstrap task has been submitted to the bootstrap job queue."
                },
                "name": "AssertionMonitorMetricsCubeBootstrapState",
                "namespace": "com.linkedin.pegasus2avro.monitor",
                "symbols": [
                  "PENDING",
                  "SUBMITTED",
                  "RUNNING",
                  "FAILED",
                  "COMPLETED",
                  "REJECTED"
                ]
              },
              "name": "state",
              "doc": "The state of the metrics cube bootstrap for this monitor.\n\nState transitions:\n  PENDING -> SUBMITTED  (bootstrap job picks up the task)\n  PENDING -> REJECTED   (scheduler finds monitor ineligible, e.g. missing bootstrapConfig)\n  SUBMITTED -> RUNNING  (bootstrap job begins processing)\n  SUBMITTED -> PENDING  (sweeper resets stale SUBMITTED task for re-submission)\n  RUNNING -> COMPLETED  (all buckets processed)\n  RUNNING -> FAILED     (unrecoverable error during processing)\n  FAILED -> PENDING     (bootstrapConfig changed or re-provided)\n  COMPLETED -> PENDING  (bootstrapConfig changed or re-provided)\n  REJECTED -> PENDING   (bootstrapConfig changed or re-provided)\n-> REJECTED         (bootstrapConfig removed from monitor)"
            },
            {
              "type": [
                "null",
                "long"
              ],
              "name": "submissionTimeMs",
              "default": null,
              "doc": "Timestamp (ms since epoch) when the bootstrap task was submitted to the bootstrap job queue."
            },
            {
              "type": [
                "null",
                "long"
              ],
              "name": "heartbeatTimestampMs",
              "default": null,
              "doc": "Timestamp (ms since epoch) of the last heartbeat from the bootstrap job running the bootstrap.\nUsed to detect stale RUNNING jobs."
            },
            {
              "type": [
                "null",
                "long"
              ],
              "name": "lastBucketStartTimeMs",
              "default": null,
              "doc": "Start timestamp (ms since epoch) of the last bucket that was successfully processed."
            },
            {
              "type": [
                "null",
                "long"
              ],
              "name": "firstBucketStartTimeMs",
              "default": null,
              "doc": "Start timestamp (ms since epoch) of the first bucket that was processed during the\ncurrent or most recent backfill run. Used to detect lookback increases: if a new run\ncomputes a start earlier than this value, only the leading gap needs to be filled."
            },
            {
              "type": [
                "null",
                "boolean"
              ],
              "name": "isHardReset",
              "default": null,
              "doc": "When true, signals the bootstrap fetcher to pass hard_reset=true to the executor,\nwhich will ignore any resume/gap-fill logic and redo the entire backfill from scratch.\nSet by the retryMonitorBackfill mutation; consumed by the fetcher when building the\nExecutionRequest."
            },
            {
              "type": [
                "null",
                "string"
              ],
              "name": "message",
              "default": null,
              "doc": "The message associated with the bootstrap status.\nI.e., an error message if the bootstrap job failed."
            }
          ]
        }
      ],
      "name": "metricsCubeBootstrapStatus",
      "default": null,
      "doc": "The status of the metrics cube bootstrap."
    }
  ],
  "doc": "The status of bootstrap actions performed on an assertion monitor.\nThis is a separate aspect from monitorInfo so that the executor can update\nbootstrap progress without conflicting with user-initiated monitor config changes."
}