{
  "consumes": [
    "application/json"
  ],
  "definitions": {
    "MetricUsageQueryExecutionCountsByType": {
      "properties": {
        "explorer": {
          "format": "int32",
          "type": "integer"
        },
        "dashboard": {
          "format": "int32",
          "type": "integer"
        },
        "external": {
          "format": "int32",
          "type": "integer"
        }
      },
      "type": "object"
    },
    "MetricUsageReferenceCountsByType": {
      "properties": {
        "dashboards": {
          "format": "int32",
          "type": "integer"
        },
        "monitors": {
          "format": "int32",
          "type": "integer"
        },
        "recording_rules": {
          "format": "int32",
          "type": "integer"
        },
        "drop_rules": {
          "format": "int32",
          "type": "integer"
        },
        "aggregation_rules": {
          "format": "int32",
          "type": "integer"
        }
      },
      "type": "object"
    },
    "RuleEvaluationRuleType": {
      "enum": [
        "MONITOR",
        "RECORDING"
      ],
      "type": "string"
    },
    "RuleEvaluationSeverity": {
      "description": "Severity of the rule evaluation issue.\n\n - SEVERITY_ERROR: A hard evaluation failure.\n - SEVERITY_WARNING: A non-fatal warning; the evaluation succeeded but something needs attention.",
      "enum": [
        "SEVERITY_ERROR",
        "SEVERITY_WARNING"
      ],
      "type": "string"
    },
    "apiError": {
      "properties": {
        "code": {
          "description": "An optional private error code whose values are undefined.",
          "format": "int32",
          "type": "integer"
        },
        "message": {
          "description": "An error message describing what went wrong.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "configv1PageResult": {
      "properties": {
        "next_token": {
          "description": "An opaque page token that identifies the next page of items that the\nclient should request. An empty value indicates that there are no\nmore items to return.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "statev1ListMetricUsagesByLabelNameResponse": {
      "properties": {
        "page": {
          "$ref": "#/definitions/configv1PageResult"
        },
        "usages": {
          "items": {
            "$ref": "#/definitions/statev1MetricUsageByLabelName"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "statev1ListMetricUsagesByMetricNameResponse": {
      "properties": {
        "page": {
          "$ref": "#/definitions/configv1PageResult"
        },
        "usages": {
          "items": {
            "$ref": "#/definitions/statev1MetricUsageByMetricName"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "statev1ListRuleEvaluationsResponse": {
      "properties": {
        "page": {
          "$ref": "#/definitions/configv1PageResult"
        },
        "rule_evaluations": {
          "items": {
            "$ref": "#/definitions/statev1RuleEvaluation"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "statev1MetricUsage": {
      "properties": {
        "total_references": {
          "format": "int32",
          "type": "integer"
        },
        "total_query_executions": {
          "format": "int32",
          "type": "integer"
        },
        "total_unique_users": {
          "format": "int32",
          "type": "integer"
        },
        "utility_score": {
          "format": "double",
          "type": "number"
        },
        "reference_counts_by_type": {
          "$ref": "#/definitions/MetricUsageReferenceCountsByType"
        },
        "query_execution_counts_by_type": {
          "$ref": "#/definitions/MetricUsageQueryExecutionCountsByType"
        }
      },
      "type": "object"
    },
    "statev1MetricUsageByLabelName": {
      "properties": {
        "label_name": {
          "type": "string"
        },
        "usage": {
          "$ref": "#/definitions/statev1MetricUsage"
        },
        "total_unique_values": {
          "format": "int32",
          "type": "integer"
        },
        "dpps": {
          "format": "double",
          "type": "number"
        },
        "percent_of_series_with_label_name": {
          "description": "Percent of persisted series observed to have the label name.\nReturns in format: [0.0, 100.0]",
          "format": "double",
          "type": "number"
        }
      },
      "type": "object"
    },
    "statev1MetricUsageByMetricName": {
      "properties": {
        "metric_name": {
          "type": "string"
        },
        "usage": {
          "$ref": "#/definitions/statev1MetricUsage"
        },
        "dpps": {
          "format": "double",
          "type": "number"
        }
      },
      "type": "object"
    },
    "statev1RuleEvaluation": {
      "properties": {
        "rule_slug": {
          "description": "Unique identifier of the rule.",
          "type": "string"
        },
        "rule_type": {
          "$ref": "#/definitions/RuleEvaluationRuleType"
        },
        "detected_at": {
          "description": "Timestamp when the rule evaluation issues are detected.\nRule evaluations issues are aggregated over last 5 minute leading up to detected_at.",
          "format": "date-time",
          "type": "string"
        },
        "count": {
          "description": "The number of rule evaluation issues occurred over last 5 minutes.",
          "format": "int32",
          "type": "integer"
        },
        "message": {
          "description": "Detailed message related to rule evaluation issue. See \"Admin \u003e Evaluation failures\" in the Chronosphere documentation for more information.",
          "type": "string"
        },
        "severity": {
          "$ref": "#/definitions/RuleEvaluationSeverity"
        }
      },
      "type": "object"
    }
  },
  "info": {
    "description": "\nThe State API provides HTTP/JSON REST endpoints for accessing the runtime state\nof the Chronosphere system.\n\nUse this link to download the raw Swagger specification:\n\u003ca href=\"/api/v1/state/swagger.json\"\u003e/api/v1/state/swagger.json\u003c/a\u003e\n",
    "title": "State V1 API",
    "version": "v1"
  },
  "paths": {
    "/api/v1/state/metric-usages-by-label-name": {
      "get": {
        "operationId": "ListMetricUsagesByLabelName",
        "parameters": [
          {
            "description": "Sets the preferred number of items to return per page. If set to `0`, the\nserver will use its default value. Regardless of the value specified, clients\nmust never assume how many items will be returned.",
            "format": "int64",
            "in": "query",
            "name": "page.max_size",
            "type": "integer"
          },
          {
            "description": "An opaque page token that identifies which page the client should request.\nAn empty value indicates the first page.",
            "in": "query",
            "name": "page.token",
            "type": "string"
          },
          {
            "in": "query",
            "name": "order.ascending",
            "type": "boolean"
          },
          {
            "enum": [
              "VALUABLE",
              "DPPS",
              "UTILITY",
              "REFERENCES",
              "EXECUTIONS",
              "UNIQUE_VALUES",
              "UNIQUE_USERS"
            ],
            "in": "query",
            "name": "order.by",
            "type": "string"
          },
          {
            "description": "Controls the time range over which query executions are included in usages. Defaults to `2592000` (30 days).",
            "format": "int32",
            "in": "query",
            "name": "lookback_secs",
            "type": "integer"
          },
          {
            "description": "Glob match string for filtering results by label name.",
            "in": "query",
            "name": "label_name_glob",
            "type": "string"
          },
          {
            "description": "If `true`, responses include the fields `reference_counts_by_type` and `query_execution_counts_by_type`. If `false`, these fields are returned empty.",
            "in": "query",
            "name": "include_counts_by_type",
            "type": "boolean"
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/statev1ListMetricUsagesByLabelNameResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/apiError"
            }
          }
        },
        "tags": [
          "MetricUsagesByLabelName"
        ]
      }
    },
    "/api/v1/state/metric-usages-by-metric-name": {
      "get": {
        "operationId": "ListMetricUsagesByMetricName",
        "parameters": [
          {
            "description": "Sets the preferred number of items to return per page. If set to `0`, the\nserver will use its default value. Regardless of the value specified, clients\nmust never assume how many items will be returned.",
            "format": "int64",
            "in": "query",
            "name": "page.max_size",
            "type": "integer"
          },
          {
            "description": "An opaque page token that identifies which page the client should request.\nAn empty value indicates the first page.",
            "in": "query",
            "name": "page.token",
            "type": "string"
          },
          {
            "in": "query",
            "name": "order.ascending",
            "type": "boolean"
          },
          {
            "enum": [
              "VALUABLE",
              "DPPS",
              "UTILITY",
              "REFERENCES",
              "EXECUTIONS",
              "UNIQUE_VALUES",
              "UNIQUE_USERS"
            ],
            "in": "query",
            "name": "order.by",
            "type": "string"
          },
          {
            "description": "Controls the time range over which query executions are included in usages. Defaults to `2592000` (30 days).",
            "format": "int32",
            "in": "query",
            "name": "lookback_secs",
            "type": "integer"
          },
          {
            "description": "Glob match string for filtering results by metric name.",
            "in": "query",
            "name": "metric_name_glob",
            "type": "string"
          },
          {
            "description": "If `true`, responses include the fields `reference_counts_by_type` and `query_execution_counts_by_type`. If `false`, these fields are returned empty.",
            "in": "query",
            "name": "include_counts_by_type",
            "type": "boolean"
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/statev1ListMetricUsagesByMetricNameResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/apiError"
            }
          }
        },
        "tags": [
          "MetricUsagesByMetricName"
        ]
      }
    },
    "/api/v1/state/rule-evaluations": {
      "get": {
        "operationId": "ListRuleEvaluations",
        "parameters": [
          {
            "description": "Sets the preferred number of items to return per page. If set to `0`, the\nserver will use its default value. Regardless of the value specified, clients\nmust never assume how many items will be returned.",
            "format": "int64",
            "in": "query",
            "name": "page.max_size",
            "type": "integer"
          },
          {
            "description": "An opaque page token that identifies which page the client should request.\nAn empty value indicates the first page.",
            "in": "query",
            "name": "page.token",
            "type": "string"
          },
          {
            "description": "When false (default), only failures are returned. Set true to also include non-fatal warnings.",
            "in": "query",
            "name": "include_warnings",
            "type": "boolean"
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/statev1ListRuleEvaluationsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/apiError"
            }
          }
        },
        "tags": [
          "RuleEvaluations"
        ]
      }
    }
  },
  "produces": [
    "application/json"
  ],
  "swagger": "2.0",
  "tags": [
    {
      "name": "StateV1"
    }
  ]
}