{
  "GlobalSettings": {
    "type": "dynamic"
  },
  "vectors": [
    {
      "URL": "$BaseURL/lag",
      "urlId": 1,
      "URLSetting": {
        "requestType": "get"
      },
      "path": [
        {
          "isPartOfHierarchy": true,
          "query": "$.status..cluster"
        },
        {
          "isPartOfHierarchy": true,
          "query": "$.status..group"
        },
        {
          "isPartOfHierarchy": true,
          "query": "$.status['maxlag']..topic",
          "replaceVectorKey": "processorKey"
        },
        {
          "isPartOfHierarchy": true,
          "query": "$.status.maxlag[?(@.topic == 'processorKey')].partition"
        }
      ],
      "metrics": [
        {
          "mPath": "$.status.",
          "attribute": [
            {
              "name": "maxlag.[?(@.topic == 'processorKey')]start.offset",
              "index": 1
            },
            {
              "name": "maxlag.[?(@.topic == 'processorKey')].end.offset",
              "index": 2
            },
            {
              "name": "maxlag.[?(@.topic == 'processorKey')].start.lag",
              "index": 3
            },
            {
              "name": "maxlag.[?(@.topic == 'processorKey')].end.lag",
              "index": 4
            },
            {
              "name": "maxlag.[?(@.topic == 'processorKey')].current_lag",
              "index": 5
            },
            {
              "name": "maxlag.[?(@.topic == 'processorKey')].status",
              "index": 6,
              "dataFromPattern": {
                "value": true,
                "pattern": [
                  {
                    "pValue": "OK",
                    "updatedValue": 1,
                    "useAsRegex": false
                  },
                  {
                    "pValue": "WARN",
                    "updatedValue": 2,
                    "useAsRegex": false
                  },
                  {
                    "pValue": "STOP",
                    "updatedValue": 3,
                    "useAsRegex": false
                  },
                  {
                    "pValue": "STALL",
                    "updatedValue": 4,
                    "useAsRegex": false
                  }
                ]
              }
            },
            {
              "name": "maxlag.[?(@.topic == 'processorKey')].complete",
              "index": 7
            }
          ]
        }
      ]
    }
  ]
}
