{
  "openapi": "3.1.0",
  "info": {
    "title": "AppSignal V2 API",
    "description": "REST API for metrics, traces, logs, Kubernetes monitoring, and deployment tracking.",
    "license": {
      "name": ""
    },
    "version": "0.1.0"
  },
  "paths": {
    "/api/v2": {
      "get": {
        "tags": [
          "System"
        ],
        "summary": "API home page",
        "operationId": "home",
        "responses": {
          "200": {
            "description": "HTML page with API information and links.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request, or input the server cannot process.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/auth": {
      "get": {
        "tags": [
          "System"
        ],
        "summary": "Test authentication",
        "operationId": "auth",
        "responses": {
          "200": {
            "description": "The token is valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request, or input the server cannot process.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    },
    "/api/v2/check_ins/test_cron": {
      "post": {
        "tags": [
          "Check-ins"
        ],
        "summary": "Test a cron expression",
        "description": "Returns the next check-in window for the cron expression. An invalid expression, timezone or timestamp still returns 200 with `error` set and no window.",
        "operationId": "test_cron",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CronQuery"
              },
              "example": {
                "cron": "0 6 * * *",
                "wait_time_minutes": 5,
                "timestamp": 1614556800,
                "timezone": "Europe/Amsterdam"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The next window, or an error message when the input is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CronQueryResult"
                },
                "examples": {
                  "Invalid": {
                    "summary": "Invalid expression",
                    "value": {
                      "now": "2021-03-01T00:00:00Z",
                      "next_start": null,
                      "next_end": null,
                      "error": "Invalid cron error: Invalid pattern: ..."
                    }
                  },
                  "Valid": {
                    "summary": "Valid expression",
                    "value": {
                      "now": "2021-03-01T00:00:00Z",
                      "next_start": "2021-03-01T05:00:00Z",
                      "next_end": "2021-03-01T05:05:00Z",
                      "error": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed request, or input the server cannot process.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    },
    "/api/v2/deploys/stats": {
      "post": {
        "tags": [
          "Deploys"
        ],
        "summary": "Query deployment statistics",
        "operationId": "stats",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StatsQuery"
              },
              "example": {
                "site_id": "6591f2705fa150d75339e232",
                "revision": "abc-123",
                "namespace": "web"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Statistics for the revision, zero when nothing was recorded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeployStatsResult"
                },
                "example": {
                  "throughput": 1001,
                  "mean": 1.95,
                  "error_rate": 1.05
                }
              }
            }
          },
          "400": {
            "description": "Malformed request, or input the server cannot process.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    },
    "/api/v2/docs": {
      "get": {
        "tags": [
          "System"
        ],
        "summary": "API documentation page",
        "operationId": "docs",
        "responses": {
          "200": {
            "description": "HTML page with the full API documentation.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request, or input the server cannot process.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/events/group_list": {
      "post": {
        "tags": [
          "Events"
        ],
        "summary": "List the top events of event groups",
        "operationId": "group_list",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EventGroupListQuery"
              },
              "example": {
                "site_id": "6591f2705fa150d75339e232",
                "from": "2024-01-01T00:00:00Z",
                "to": "2024-01-01T01:00:00Z",
                "resolution": "HOURLY",
                "groups": [
                  "active_record",
                  "moped"
                ],
                "order": "IMPACT"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Up to `limit` events across all requested groups, ranked by `order` descending. Some events are left out after ranking (transaction boundaries, and events without metadata or a group), so fewer rows than `limit` can come back.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EventGroupItem"
                  }
                }
              }
            }
          },
          "400": {
            "description": "`groups` is empty.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    },
    "/api/v2/kubernetes/nodes": {
      "post": {
        "tags": [
          "Kubernetes"
        ],
        "summary": "Query Kubernetes node metrics",
        "operationId": "nodes",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NodesQuery"
              },
              "example": {
                "site_id": "abc123",
                "from": "2024-01-01T00:00:00Z",
                "to": "2024-01-01T01:00:00Z",
                "node_name": "node-1"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "One row per node, ordered by node name.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NodesRow"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed request, or input the server cannot process.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    },
    "/api/v2/kubernetes/pods": {
      "post": {
        "tags": [
          "Kubernetes"
        ],
        "summary": "Query Kubernetes pod metrics",
        "operationId": "pods",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PodsQuery"
              },
              "example": {
                "site_id": "abc123",
                "from": "2024-01-01T00:00:00Z",
                "to": "2024-01-01T01:00:00Z",
                "namespaces": [
                  "default",
                  "kube-system"
                ],
                "state": "Running"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "One row per pod, ordered by namespace and pod name.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PodsRow"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed request, or input the server cannot process.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    },
    "/api/v2/kubernetes/pods/overview": {
      "post": {
        "tags": [
          "Kubernetes"
        ],
        "summary": "Query Kubernetes pod overviews",
        "operationId": "overview",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PodOverviewsQuery"
              },
              "example": {
                "site_id": "abc123",
                "from": "2024-01-01T00:00:00Z",
                "to": "2024-01-01T01:00:00Z",
                "namespaces": [
                  "default"
                ],
                "query": "nginx"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "One row per pod, ordered by namespace and pod name.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PodOverviewRow"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed request, or input the server cannot process.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    },
    "/api/v2/llms.txt": {
      "get": {
        "tags": [
          "System"
        ],
        "summary": "API documentation for LLMs",
        "operationId": "llms_txt",
        "responses": {
          "200": {
            "description": "Structured plain text following the llms.txt convention.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request, or input the server cannot process.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/logs/lines": {
      "post": {
        "tags": [
          "Logs"
        ],
        "summary": "Search log lines",
        "operationId": "lines",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LogsQueryParams"
              },
              "example": {
                "site_id": "abc123",
                "from": "2024-01-01T00:00:00Z",
                "to": "2024-01-01T01:00:00Z",
                "source_ids": [
                  "source-1",
                  "source-2"
                ],
                "query": "error",
                "pagination": {
                  "per_page": 50,
                  "order": "DESC",
                  "cursor": {
                    "time": null,
                    "id": null
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The matching log lines, or a server-sent event stream whose `data` fields are each a `LogStreamEvent`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LogLine"
                  }
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request, or input the server cannot process.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    },
    "/api/v2/metrics/anomaly": {
      "post": {
        "tags": [
          "Metrics"
        ],
        "summary": "Detect anomalies in a metrics timeseries",
        "operationId": "anomaly",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnomalyRequest"
              },
              "example": {
                "query": {
                  "site_id": "abc123",
                  "from": "2024-01-01T00:00:00Z",
                  "to": "2024-01-08T00:00:00Z",
                  "resolution": "HOURLY",
                  "select": [
                    {
                      "name": "disk_usage",
                      "field": "GAUGE",
                      "tags": {
                        "hostname": "server-1"
                      }
                    }
                  ]
                },
                "detector": "trend",
                "config": {
                  "ceiling": 100
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The fetched series and its detections.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnomalyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid query, including a window longer than 30 days.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    },
    "/api/v2/metrics/list": {
      "post": {
        "tags": [
          "Metrics"
        ],
        "summary": "List aggregated metrics",
        "operationId": "list",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ListQuery"
              },
              "example": {
                "site_id": "abc123",
                "from": "2024-01-01T00:00:00Z",
                "to": "2024-01-01T01:00:00Z",
                "select": [
                  {
                    "id": "cpu",
                    "name": "cpu",
                    "field": "GAUGE",
                    "tags": {
                      "hostname": "*"
                    }
                  }
                ],
                "group_by": [
                  {
                    "Tag": "hostname"
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "One row per unique combination of group-by values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/List"
                }
              }
            }
          },
          "400": {
            "description": "Invalid query; the `error` slug identifies why. Pagination slugs: `pagination_requires_deterministic_grouping`, `pagination_unsupported_for_selector`, `pagination_invalid_per_page`, `pagination_key_limit_exceeded`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    },
    "/api/v2/metrics/names/{site_id}": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "List metric names",
        "operationId": "metric_names",
        "parameters": [
          {
            "name": "site_id",
            "in": "path",
            "description": "The site to list metric names for.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter",
            "in": "query",
            "description": "Only return names containing this term, ignoring case (at most 200 characters).",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The site's metric names.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "example": [
                  "cpu",
                  "disk_io",
                  "memory",
                  "network_tx"
                ]
              }
            }
          },
          "400": {
            "description": "Malformed request, or a filter that is too long or contains control characters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    },
    "/api/v2/metrics/timeseries": {
      "post": {
        "tags": [
          "Metrics"
        ],
        "summary": "Query a metrics timeseries",
        "operationId": "timeseries",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimeseriesQuery"
              },
              "example": {
                "site_id": "abc123",
                "from": "2024-01-01T00:00:00Z",
                "to": "2024-01-01T01:00:00Z",
                "resolution": "MINUTELY",
                "select": [
                  {
                    "name": "cpu",
                    "field": "GAUGE",
                    "tags": {
                      "hostname": "server-1",
                      "state": "user"
                    }
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The matching series.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Timeseries"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request, or input the server cannot process.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    },
    "/api/v2/metrics/type_and_tags/{site_id}/{metric_name}": {
      "get": {
        "tags": [
          "Metrics"
        ],
        "summary": "Get a metric's type and tags",
        "operationId": "metric_type_and_tags",
        "parameters": [
          {
            "name": "site_id",
            "in": "path",
            "description": "The site the metric belongs to.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "metric_name",
            "in": "path",
            "description": "The metric to describe.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The metric's type and tag combinations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetricTypeAndTags"
                },
                "example": {
                  "metric_type": "GAUGE",
                  "available_tags": [
                    [
                      "hostname"
                    ],
                    [
                      "hostname",
                      "state"
                    ]
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Malformed request, or input the server cannot process.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The metric does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    },
    "/api/v2/openapi.json": {
      "get": {
        "tags": [
          "System"
        ],
        "summary": "OpenAPI specification",
        "operationId": "openapi_json",
        "responses": {
          "200": {
            "description": "The OpenAPI document describing every documented endpoint.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "400": {
            "description": "Malformed request, or input the server cannot process.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/raise_error": {
      "get": {
        "tags": [
          "System"
        ],
        "summary": "Trigger a test error",
        "operationId": "raise_error",
        "responses": {
          "400": {
            "description": "Malformed request, or input the server cannot process.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Always fails with an internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    },
    "/api/v2/saved_visuals/{id}": {
      "get": {
        "tags": [
          "Saved Visuals"
        ],
        "summary": "Get a saved visual",
        "operationId": "json",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Hex-encoded ObjectId of the saved visual.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The saved visual.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SavedVisualOut"
                },
                "example": {
                  "id": "60f3b3b3b3b3b3b3b3b3b3b3",
                  "resolution": "HOURLY",
                  "value_format": "number",
                  "value_input": null,
                  "series": [
                    {
                      "color": "rgb(0,0,0)",
                      "name": "test",
                      "renderer": "line",
                      "data": [
                        {
                          "x": "2020-04-12T22:10:57Z",
                          "y": 1.0
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`id` is not a valid ObjectId (`error` is `invalid_id`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "404": {
            "description": "No saved visual with this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/saved_visuals/{id}/csv": {
      "get": {
        "tags": [
          "Saved Visuals"
        ],
        "summary": "Export a saved visual as CSV",
        "operationId": "csv",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Hex-encoded ObjectId of the saved visual.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CSV with a `timestamp` column (RFC 3339) and one column per series, sorted by timestamp. Series with no point at a timestamp read `0`. Series names starting with `=`, `+`, `-`, `@`, tab or carriage return get a leading `'` so spreadsheets read them as text.",
            "headers": {
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                },
                "description": "`attachment; filename=\"{id}.csv\"`"
              }
            },
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                },
                "example": "timestamp,line one,line two\n2020-04-12T22:00:00+00:00,1,10\n2020-04-12T22:01:00+00:00,0,10\n2020-04-12T22:02:00+00:00,1,0\n"
              }
            }
          },
          "400": {
            "description": "`id` is not a valid ObjectId (`error` is `invalid_id`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "404": {
            "description": "No saved visual with this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/search": {
      "post": {
        "tags": [
          "Search"
        ],
        "summary": "Search traces",
        "operationId": "search",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchRequest"
              },
              "example": {
                "site_ids": [
                  "6591f2705fa150d75339e232"
                ],
                "query": "error:RuntimeError",
                "kind": "exception",
                "from": "2024-01-01T00:00:00Z",
                "to": "2024-01-02T00:00:00Z"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Up to `limit` results, newest first: one per incident digest of each matching span, so `trace_id` can repeat.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SearchResult"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed request, or input the server cannot process.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    },
    "/api/v2/tracing/action_edges": {
      "post": {
        "tags": [
          "Tracing"
        ],
        "summary": "List action edges",
        "operationId": "action_edges",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActionEdgesApiQuery"
              },
              "example": {
                "site_id": "abc123",
                "namespace": "PublicApi/web",
                "action": "UsersController#show",
                "from": "2024-01-01T00:00:00Z",
                "to": "2024-01-01T01:00:00Z"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The focused action's upstream and downstream edges.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionEdgesResponse"
                },
                "example": {
                  "upstream": [
                    {
                      "site_id": "def456",
                      "site_name": "Frontend",
                      "site_environment": "production",
                      "service": "Frontend",
                      "namespace": "web",
                      "action": "HomeController#index",
                      "caller_kind": "CLIENT",
                      "callee_kind": "SERVER",
                      "edge_type": "SYNC",
                      "count": 1200,
                      "error_count": 3,
                      "mean": 42.5,
                      "p_90": 80.1,
                      "p_95": 110.7
                    }
                  ],
                  "downstream": []
                }
              }
            }
          },
          "400": {
            "description": "`namespace` is not `<service>/<namespace>` with both halves non-empty, or the query is otherwise invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    },
    "/api/v2/tracing/actions": {
      "post": {
        "tags": [
          "Tracing"
        ],
        "summary": "List performance actions",
        "operationId": "actions",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActionsQuery"
              },
              "example": {
                "site_id": "abc123",
                "from": "2024-01-01T00:00:00Z",
                "to": "2024-01-01T01:00:00Z",
                "namespaces": [
                  "web"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "One row per namespace, action and digest.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ActionRow"
                  }
                },
                "example": [
                  {
                    "namespace": "web",
                    "action": "UsersController#show",
                    "digest": "a1b2c3",
                    "mean": 123.4,
                    "throughput": 5200.0,
                    "error_rate": 0.8,
                    "has_npo": false
                  }
                ]
              }
            }
          },
          "400": {
            "description": "Malformed request, or input the server cannot process.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    },
    "/api/v2/tracing/errors": {
      "post": {
        "tags": [
          "Tracing"
        ],
        "summary": "List incident error counts",
        "operationId": "errors",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IncidentErrorsQuery"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Incident digests matching the filter, with their error counts.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/IncidentErrorRow"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed request, or input the server cannot process.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    },
    "/api/v2/tracing/locator": {
      "post": {
        "tags": [
          "Tracing"
        ],
        "summary": "Locate a trace",
        "operationId": "locator",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LocatorQuery"
              },
              "example": {
                "site_ids": [
                  "abc123"
                ],
                "trace_id": "5baa0559ff2f4d35f3b2cd90d312bac3"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The performance actions and error incidents the trace appears in; both lists are empty when it is not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TraceLocation"
                },
                "example": {
                  "performance": [
                    {
                      "site_id": "abc123",
                      "namespace": "web",
                      "action_name": "POST /api/users"
                    }
                  ],
                  "errors": [
                    {
                      "site_id": "abc123",
                      "incident_number": 42,
                      "exception_name": "RuntimeError",
                      "incident_digests": [
                        "1234567890"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Malformed request, or input the server cannot process.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    },
    "/api/v2/tracing/metadata_distributions": {
      "post": {
        "tags": [
          "Tracing"
        ],
        "summary": "List incident metadata distributions",
        "operationId": "metadata_distributions",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MetadataDistributionsQuery"
              },
              "example": {
                "site_id": "abc123",
                "incident_digests": [
                  "1023993"
                ],
                "from": "2024-01-01T00:00:00Z",
                "group_by": "VALUE",
                "metadata_key": "hostname"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "A bare array: key rows in KEY mode, value rows in VALUE mode.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetadataDistributions"
                },
                "example": [
                  {
                    "key": "frontend1",
                    "value": 42
                  }
                ]
              }
            }
          },
          "400": {
            "description": "`incident_digests` is empty, or `group_by` is `VALUE` without a `metadata_key`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    },
    "/api/v2/tracing/site_edges": {
      "post": {
        "tags": [
          "Tracing"
        ],
        "summary": "List site edges",
        "operationId": "site_edges",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SiteEdgesApiQuery"
              },
              "example": {
                "site_id": "abc123",
                "from": "2024-01-01T00:00:00Z",
                "to": "2024-01-01T01:00:00Z"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The site's service edges, grouped by direction.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteEdgesResponse"
                },
                "example": {
                  "upstream": [],
                  "downstream": [
                    {
                      "site_id": "def456",
                      "site_name": "Billing",
                      "site_environment": "production",
                      "service": "Billing",
                      "count": 800,
                      "error_count": 2,
                      "mean": 35.2,
                      "p_90": 70.0,
                      "p_95": 95.3
                    }
                  ],
                  "internal": []
                }
              }
            }
          },
          "400": {
            "description": "Malformed request, or input the server cannot process.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    },
    "/api/v2/tracing/slow_events": {
      "post": {
        "tags": [
          "Tracing"
        ],
        "summary": "List slow events",
        "operationId": "slow_events",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SlowEventsParams"
              },
              "example": {
                "site_id": "abc123",
                "from": "2024-01-01T00:00:00Z",
                "to": "2024-01-01T01:00:00Z",
                "wanted_attributes": {
                  "payload": {
                    "Required": [
                      "db.query.text",
                      "db.statement"
                    ]
                  },
                  "system": {
                    "Optional": [
                      "db.system.name"
                    ]
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The slow events, with the requested attributes.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SlowEventItem"
                  }
                },
                "example": [
                  {
                    "digest": "1234567890",
                    "count": 42,
                    "mean": 125.5,
                    "impact": 5271.0,
                    "payload": "SELECT * FROM users WHERE id = ?",
                    "system": "postgresql"
                  }
                ]
              }
            }
          },
          "400": {
            "description": "`wanted_attributes` is empty, has no `Required` entry, or has an empty key list; or an attribute category or key is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    },
    "/api/v2/tracing/slow_events/actions": {
      "post": {
        "tags": [
          "Tracing"
        ],
        "summary": "List actions for a slow event",
        "operationId": "slow_event_actions",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActionsParams"
              },
              "example": {
                "site_id": "abc123",
                "from": "2024-01-01T00:00:00Z",
                "to": "2024-01-01T01:00:00Z",
                "digest": "1234567890"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The actions the slow event appears in.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RelatedTraceItem"
                  }
                },
                "example": [
                  {
                    "action_name": "UsersController#index",
                    "namespace": "web",
                    "count": 42,
                    "trace_id": "0af7651916cd43dd8448eb211c80319c",
                    "start_time": "2024-01-01 00:00:00.123456789"
                  }
                ]
              }
            }
          },
          "400": {
            "description": "Malformed request, or input the server cannot process.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    },
    "/api/v2/tracing/trace": {
      "post": {
        "tags": [
          "Tracing"
        ],
        "summary": "Get a trace",
        "operationId": "trace",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TraceQuery"
              },
              "example": {
                "site_ids": [
                  "abc123"
                ],
                "trace_id": "5baa0559ff2f4d35f3b2cd90d312bac3"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The trace's spans, or an empty array when the trace is not found.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TraceSpan"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed request, or input the server cannot process.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    },
    "/api/v2/tracing/trace/error": {
      "post": {
        "tags": [
          "Tracing"
        ],
        "summary": "Get an error incident's trace",
        "operationId": "trace",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ErrorTraceQuery"
              },
              "example": {
                "site_ids": [
                  "abc123"
                ],
                "digests": [
                  "1234567890"
                ],
                "trace_id": "last"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The trace's spans.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TraceSpan"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed request, or input the server cannot process.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No trace found for the digests or trace ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    },
    "/api/v2/tracing/trace/performance": {
      "post": {
        "tags": [
          "Tracing"
        ],
        "summary": "Get a performance action's trace",
        "operationId": "trace",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PerformanceTraceQuery"
              },
              "example": {
                "site_ids": [
                  "abc123"
                ],
                "namespace": "web",
                "action_name": "POST /api/users",
                "trace_id": "last"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The trace's spans.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TraceSpan"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed request, or input the server cannot process.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No trace found for the action or trace ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    },
    "/api/v2/tracing/traces/errors": {
      "post": {
        "tags": [
          "Tracing"
        ],
        "summary": "List error traces",
        "operationId": "traces",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ErrorTracesQuery"
              },
              "example": {
                "site_ids": [
                  "abc123"
                ],
                "digests": [
                  "1234567890"
                ],
                "pagination": {
                  "per_page": 50,
                  "order": "DESC",
                  "cursor": {
                    "time": null
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The matching trace summaries.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Trace"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed request, or input the server cannot process.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    },
    "/api/v2/tracing/traces/performance": {
      "post": {
        "tags": [
          "Tracing"
        ],
        "summary": "List performance traces",
        "operationId": "traces",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PerformanceTracesQuery"
              },
              "example": {
                "site_ids": [
                  "abc123"
                ],
                "namespace": "web",
                "action_name": "POST /api",
                "duration_ms": 1000,
                "pagination": {
                  "per_page": 50,
                  "order": "DESC",
                  "cursor": {
                    "time": null
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The matching trace summaries.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Trace"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed request, or input the server cannot process.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Route or resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "External query concurrency limit exceeded; retry shortly.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unhandled server-side failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          },
          {
            "token_query": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ActionEdge": {
        "type": "object",
        "description": "A single edge in the upstream or downstream list.",
        "required": [
          "service",
          "namespace",
          "action",
          "caller_kind",
          "callee_kind",
          "edge_type",
          "count",
          "error_count",
          "mean",
          "p_90",
          "p_95"
        ],
        "properties": {
          "site_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Site ID of the peer service if it is one the user has access to,\notherwise `None`. Resolved at ingestion via the in-memory site\nmetadata, so renames do not invalidate historical rows."
          },
          "site_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Current display name of the peer site, if accessible to the user."
          },
          "site_environment": {
            "type": [
              "string",
              "null"
            ],
            "description": "Environment of the peer site (e.g. \"production\"), if accessible to the user."
          },
          "service": {
            "type": "string",
            "description": "Peer service (app name) on the other end of the edge. For peers\nin the user's accessible sites this reflects the *current* name\n(looked up from MongoDB at query time); for external peers it\nfalls back to the value the agent reported at ingestion."
          },
          "namespace": {
            "type": "string",
            "description": "Peer namespace."
          },
          "action": {
            "type": "string",
            "description": "Peer action name."
          },
          "caller_kind": {
            "type": "string",
            "description": "OTel span kind on the caller side."
          },
          "callee_kind": {
            "type": "string",
            "description": "OTel span kind on the callee side."
          },
          "edge_type": {
            "type": "string",
            "description": "`SYNC` or `ASYNC`."
          },
          "count": {
            "type": "integer",
            "format": "u-int64",
            "description": "Total request count over the time range.",
            "minimum": 0
          },
          "error_count": {
            "type": "integer",
            "format": "u-int64",
            "description": "Total error count over the time range.",
            "minimum": 0
          },
          "mean": {
            "type": "number",
            "format": "double",
            "description": "Mean duration in milliseconds (count-weighted across the range)."
          },
          "p_90": {
            "type": "number",
            "format": "double",
            "description": "90th percentile duration in milliseconds. Approximation: traffic-weighted\naverage of per-minute pre-computed p_90 values (sum(p_90 * count) / sum(count))."
          },
          "p_95": {
            "type": "number",
            "format": "double",
            "description": "95th percentile duration in milliseconds. Approximation: traffic-weighted\naverage of per-minute pre-computed p_95 values (sum(p_95 * count) / sum(count))."
          }
        }
      },
      "ActionEdgesApiQuery": {
        "type": "object",
        "description": "Query parameters for listing upstream and downstream action edges.",
        "required": [
          "site_id",
          "namespace",
          "action",
          "from",
          "to"
        ],
        "properties": {
          "site_id": {
            "type": "string",
            "description": "Site ID that anchors the query (the focused action's site)."
          },
          "namespace": {
            "type": "string",
            "description": "Focused action's `\"<service>/<namespace>\"` (e.g. `\"PublicApi/web\"`), split on the first `/`\n(later `/` stay in the namespace). Both halves must be non-empty, else 400."
          },
          "action": {
            "type": "string",
            "description": "Action name of the focused action."
          },
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the time range (inclusive)."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "End of the time range (exclusive)."
          }
        }
      },
      "ActionEdgesResponse": {
        "type": "object",
        "description": "Response shape for the action edges endpoint.",
        "required": [
          "upstream",
          "downstream"
        ],
        "properties": {
          "upstream": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActionEdge"
            },
            "description": "Upstream edges (callers into the focused action)."
          },
          "downstream": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActionEdge"
            },
            "description": "Downstream edges (callees the focused action invoked)."
          }
        }
      },
      "ActionRow": {
        "type": "object",
        "description": "A single row in the actions list response, representing aggregated metrics\nfor one namespace/action/digest combination.",
        "required": [
          "namespace",
          "action",
          "digest",
          "mean",
          "throughput",
          "error_rate",
          "has_npo"
        ],
        "properties": {
          "namespace": {
            "type": "string",
            "description": "Application namespace (e.g. \"web\", \"background\")."
          },
          "action": {
            "type": "string",
            "description": "Action name (e.g. \"UsersController#show\")."
          },
          "digest": {
            "type": "string",
            "description": "Action digest identifier."
          },
          "mean": {
            "type": "number",
            "format": "double",
            "description": "Mean duration in milliseconds."
          },
          "throughput": {
            "type": "number",
            "format": "double",
            "description": "Total request count in the queried time range."
          },
          "error_rate": {
            "type": "number",
            "format": "double",
            "description": "Error percentage (0.0–100.0)."
          },
          "has_npo": {
            "type": "boolean",
            "description": "Whether an N+1 query has been detected for this action."
          }
        }
      },
      "ActionsParams": {
        "type": "object",
        "description": "Identifies the slow event whose actions to list.",
        "required": [
          "site_id",
          "from",
          "to",
          "digest"
        ],
        "properties": {
          "site_id": {
            "type": "string",
            "description": "Site to query."
          },
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the time range; clamped to the account's data retention."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "End of the time range; clamped to now."
          },
          "digest": {
            "type": "string",
            "description": "Digest of the slow event, as returned by the slow events endpoint."
          }
        }
      },
      "ActionsQuery": {
        "type": "object",
        "description": "Query parameters for listing performance actions with aggregated metrics.",
        "required": [
          "site_id",
          "from",
          "to"
        ],
        "properties": {
          "site_id": {
            "type": "string",
            "description": "Site identifier to scope the query to."
          },
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the time range (inclusive)."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "End of the time range (inclusive)."
          },
          "namespaces": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Namespaces to filter by. When empty, all namespaces are included."
          },
          "revision": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional deployment revision to filter by."
          },
          "action": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional action name to filter by."
          }
        }
      },
      "Aggregation": {
        "type": "string",
        "description": "The aggregation function applied when combining multiple values within a time bucket.\n\nSerialized as uppercase strings (e.g. `\"SUM\"`, `\"AVERAGE\"`). When no aggregation is\nexplicitly set on a selector, a default is chosen based on the [`Field`] type.",
        "enum": [
          "SUM",
          "AVERAGE",
          "MIN",
          "MAX",
          "FIRST",
          "LAST"
        ]
      },
      "AnomalyConfig": {
        "type": "object",
        "description": "Detector tuning for one anomaly run; each detector reads only its own fields.",
        "properties": {
          "ceiling": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "The value a series is projected to cross, e.g. `100` for disk-usage %. The trend\nand time_to_threshold detectors produce no detections without it."
          },
          "min_fit_quality": {
            "type": "number",
            "format": "double",
            "description": "Minimum R² below which the trend detector does not trust a projection.",
            "default": 0.8,
            "maximum": 1,
            "minimum": 0
          },
          "spike_threshold": {
            "type": "number",
            "format": "double",
            "description": "Modified z-score at/above which the spike detector flags a point.",
            "default": 3.5,
            "exclusiveMinimum": 0
          },
          "baseline_until": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Unix seconds; spike and rate baselines use only points before it, and only points\nat/after it are flagged (e.g. a deploy time). Unset: the whole window."
          },
          "changepoint_threshold": {
            "type": "number",
            "format": "double",
            "description": "MAD-scaled shift magnitude at/above which the changepoint detector reports a level shift.",
            "default": 3.5,
            "exclusiveMinimum": 0
          },
          "horizon_minutes": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "The time_to_threshold detector fires when `ceiling` is projected to be crossed\nwithin this many minutes; it produces no detections without it.",
            "exclusiveMinimum": 0
          },
          "rate_numerator": {
            "type": [
              "string",
              "null"
            ],
            "description": "Rate detector numerator metric (event count), e.g. `\"error_count\"`. Required,\nwith `rate_denominator`, for the rate detector to produce detections."
          },
          "rate_denominator": {
            "type": [
              "string",
              "null"
            ],
            "description": "Rate detector denominator metric (throughput), e.g. `\"trace_duration\"` selected\nwith the `COUNT` field, paired with `rate_numerator` by tags."
          },
          "rate_threshold": {
            "type": "number",
            "format": "double",
            "description": "Proportion z-score at/above which the rate detector flags a bucket.",
            "default": 3.5,
            "exclusiveMinimum": 0
          },
          "rate_min_denominator": {
            "type": "number",
            "format": "double",
            "description": "Minimum throughput a bucket needs before the rate detector tests it.",
            "default": 20.0,
            "minimum": 1
          }
        }
      },
      "AnomalyPoint": {
        "type": "object",
        "description": "A single anomalous point flagged by a point-anomaly detector (e.g. spike).\n\nThe changepoint detector reuses this struct to describe a detected level shift,\nreinterpreting the fields: `at` is the shift boundary, `baseline` the robust level\n*before* the shift, `value` the robust level *after* it, and `z_score` the MAD-scaled\nshift magnitude (sign = direction: positive = stepped up, negative = stepped down).\n\nThe rate detector likewise reuses it for an anomalous rate bucket: `at` is the bucket,\n`value` the observed rate (`numerator / denominator`), `baseline` the robust baseline\nrate, and `z_score` the one-sample proportion z (sign = direction: positive = rate rose,\nnegative = fell).",
        "required": [
          "at",
          "value",
          "z_score",
          "baseline"
        ],
        "properties": {
          "at": {
            "type": "integer",
            "format": "int64",
            "description": "Unix-seconds timestamp of the anomalous point (spike), shift boundary (changepoint)\nor rate bucket (rate)."
          },
          "value": {
            "type": "number",
            "format": "double",
            "description": "The point's value (spike), the robust level *after* the shift (changepoint) or the\nobserved rate (rate)."
          },
          "z_score": {
            "type": "number",
            "format": "double",
            "description": "Robust modified z-score (Iglewicz–Hoaglin) for a spike, the MAD-scaled shift\nmagnitude for a changepoint, or the one-sample proportion z for a rate; its sign\ncarries direction (positive = above the baseline / stepped up / rate rose, negative\n= below it / stepped down / rate fell)."
          },
          "baseline": {
            "type": "number",
            "format": "double",
            "description": "Robust baseline the point deviates from (spike), the robust level *before* the\nshift (changepoint) or the robust baseline rate (rate)."
          }
        }
      },
      "AnomalyRequest": {
        "type": "object",
        "description": "The series to analyse, the detector to run and its tuning.",
        "required": [
          "query"
        ],
        "properties": {
          "query": {
            "$ref": "#/components/schemas/TimeseriesQuery",
            "description": "The series to analyse; at most 30 days. Empty buckets are never filled, and\nprojections are measured from `to`."
          },
          "detector": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/DetectorKind",
                "description": "Which detection algorithm to run."
              }
            ],
            "default": "trend"
          },
          "config": {
            "$ref": "#/components/schemas/AnomalyConfig",
            "description": "Detector tuning (e.g. the `ceiling` a trend is projected to cross)."
          }
        }
      },
      "AnomalyResponse": {
        "type": "object",
        "description": "The analysed series and its detections.",
        "required": [
          "series",
          "detections"
        ],
        "properties": {
          "series": {
            "$ref": "#/components/schemas/Timeseries",
            "description": "The fetched series, to overlay the detections on."
          },
          "detections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Detection"
            },
            "description": "The detections produced by the detector, one per anomalous series (possibly empty)."
          }
        }
      },
      "AttributeRequirement": {
        "oneOf": [
          {
            "type": "object",
            "description": "Filters spans to those with at least one of these keys set to a non-empty value; the value is returned.",
            "required": [
              "Required"
            ],
            "properties": {
              "Required": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Filters spans to those with at least one of these keys set to a non-empty value; the value is returned."
              }
            }
          },
          {
            "type": "object",
            "description": "Always returned (empty when none of the keys is set); does not filter spans.",
            "required": [
              "Optional"
            ],
            "properties": {
              "Optional": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Always returned (empty when none of the keys is set); does not filter spans."
              }
            }
          }
        ],
        "description": "Whether a group of attribute keys filters the slow events or is only returned."
      },
      "AuthResponse": {
        "type": "object",
        "description": "Response body for the authentication test endpoint.",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "Confirmation message including the authenticated user ID."
          }
        },
        "example": {
          "message": "Authenticated user 6694fca622fa81b8dd2e7178"
        }
      },
      "BadRequestResponse": {
        "type": "object",
        "description": "Standard body for HTTP 400 Bad Request responses. Branch on the stable `error` slug, display `message` as-is, and read per-error structured data from `details`.",
        "required": [
          "error",
          "message"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Stable, machine-readable slug identifying the specific error case."
          },
          "message": {
            "type": "string",
            "description": "Human-readable message. Safe to log or display to end users."
          },
          "details": {
            "description": "Per-error structured payload. Shape varies by [`error`](Self::error)."
          }
        }
      },
      "Container": {
        "type": "object",
        "description": "A container within a Kubernetes pod.",
        "required": [
          "name",
          "status",
          "exit_code",
          "reason"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the container."
          },
          "status": {
            "$ref": "#/components/schemas/ContainerStatus",
            "description": "Current status of the container."
          },
          "exit_code": {
            "type": "integer",
            "format": "int32",
            "description": "Exit code of the container process (0 means success)."
          },
          "reason": {
            "type": "string",
            "description": "Human-readable reason for the container's current status."
          }
        }
      },
      "ContainerStatus": {
        "type": "string",
        "description": "Status of a container within a pod.",
        "enum": [
          "Running",
          "Terminated",
          "Waiting",
          "Unknown"
        ]
      },
      "CronQuery": {
        "type": "object",
        "description": "Request body for testing a cron schedule expression.",
        "required": [
          "cron",
          "wait_time_minutes"
        ],
        "properties": {
          "cron": {
            "type": "string",
            "description": "Cron expression to test (e.g. `\"0 * * * *\"`)."
          },
          "wait_time_minutes": {
            "type": "integer",
            "format": "int64",
            "description": "Wait time in minutes for the check-in window."
          },
          "timestamp": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Unix timestamp in seconds to evaluate against. Defaults to the current time."
          },
          "timezone": {
            "type": "string",
            "description": "IANA timezone for cron evaluation (e.g. `\"Europe/Amsterdam\"`). An empty string means UTC.",
            "default": ""
          }
        }
      },
      "CronQueryResult": {
        "type": "object",
        "description": "Result of evaluating a cron schedule expression.",
        "required": [
          "now",
          "next_start",
          "next_end",
          "error"
        ],
        "properties": {
          "now": {
            "type": "string",
            "format": "date-time",
            "description": "The time evaluated against: `timestamp`, or the current time when omitted or out of range."
          },
          "next_start": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Next scheduled start time; `null` when `error` is set."
          },
          "next_end": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Next scheduled end time (start + wait time); `null` when `error` is set."
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why no window could be computed (invalid expression, timezone or timestamp); `null` on success."
          }
        }
      },
      "DataPointOut": {
        "type": "object",
        "description": "A single data point in a saved visual series.",
        "required": [
          "x",
          "y"
        ],
        "properties": {
          "x": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp of this data point."
          },
          "y": {
            "type": "number",
            "format": "double",
            "description": "Primary value."
          },
          "y0": {
            "type": "number",
            "format": "double",
            "description": "Lower bound value for area charts."
          },
          "y1": {
            "type": "number",
            "format": "double",
            "description": "Upper bound value for area charts."
          }
        }
      },
      "DeployStatsResult": {
        "type": "object",
        "description": "Aggregated metrics for one deployment. Without recorded samples, `throughput` is the\nerror count, `error_rate` 100 (0 without errors) and `mean` 0.",
        "required": [
          "throughput",
          "mean",
          "error_rate"
        ],
        "properties": {
          "throughput": {
            "type": "integer",
            "format": "u-int64",
            "description": "Recorded requests and background jobs.",
            "minimum": 0
          },
          "mean": {
            "type": "number",
            "format": "double",
            "description": "Mean duration in milliseconds."
          },
          "error_rate": {
            "type": "number",
            "format": "double",
            "description": "Error rate as a percentage (0-100)."
          }
        }
      },
      "Detection": {
        "type": "object",
        "description": "A single anomaly detected on one series.",
        "required": [
          "kind",
          "series_id",
          "score",
          "severity",
          "explanation"
        ],
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/DetectorKind",
            "description": "Which detector produced this detection."
          },
          "series_id": {
            "type": "string",
            "description": "The `id` of the series this detection refers to."
          },
          "score": {
            "type": "number",
            "format": "double",
            "description": "Detector-specific score: fit quality `0.0..=1.0` (trend), urgency `0.0..=1.0`\n(time_to_threshold) or the max `|z-score|` (spike, changepoint, rate). Compare\nonly within one `kind`; `severity` is comparable across detectors."
          },
          "severity": {
            "$ref": "#/components/schemas/Severity",
            "description": "Severity bucket."
          },
          "projection": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Projection",
                "description": "Forward projection, from the trend and time_to_threshold detectors."
              }
            ]
          },
          "points": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnomalyPoint"
            },
            "description": "The series' flagged points, from the spike, changepoint and rate detectors."
          },
          "explanation": {
            "type": "string",
            "description": "Human-readable explanation, e.g. \"disk_usage is projected to cross 100 in ~6 days\"."
          }
        }
      },
      "DetectorKind": {
        "type": "string",
        "description": "Which detection algorithm produced (or is requested to produce) a result.",
        "enum": [
          "trend",
          "spike",
          "changepoint",
          "time_to_threshold",
          "rate"
        ]
      },
      "ErrorLocation": {
        "type": "object",
        "description": "Error incident where a trace appears.",
        "required": [
          "site_id",
          "incident_number",
          "exception_name",
          "incident_digests"
        ],
        "properties": {
          "site_id": {
            "type": "string",
            "description": "Site identifier."
          },
          "incident_number": {
            "type": "integer",
            "format": "int64",
            "description": "Incident number that groups related errors."
          },
          "exception_name": {
            "type": "string",
            "description": "Name of the exception (e.g. `\"RuntimeError\"`)."
          },
          "incident_digests": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Digests from this trace that belong to this incident, matching the `appsignal.incident_digest` attribute on exception events."
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "description": "Error body returned for 401, 404 and 500 responses.",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Human-readable error message."
          }
        }
      },
      "ErrorTraceQuery": {
        "type": "object",
        "description": "The error incident whose trace to fetch.",
        "required": [
          "site_ids",
          "digests"
        ],
        "properties": {
          "site_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Sites to search; the token must have access to all of them."
          },
          "digests": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Digests of the error incident."
          },
          "trace_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "A specific trace ID, or `\"last\"` (the default) for the most recent trace with a matching digest."
          }
        }
      },
      "ErrorTracesQuery": {
        "type": "object",
        "description": "Filters and pagination for listing the traces of error incidents.",
        "required": [
          "site_ids",
          "digests",
          "pagination"
        ],
        "properties": {
          "site_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Sites to search; the caller must have access to all of them."
          },
          "digests": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Digests of the error incidents to list traces for."
          },
          "query": {
            "type": [
              "string",
              "null"
            ],
            "description": "Filter query; supports revision and tag filters."
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination_TracePagination",
            "description": "Page size (capped at 100), order and cursor."
          }
        }
      },
      "EventGroupItem": {
        "type": "object",
        "description": "One event in the event group list.",
        "required": [
          "digest",
          "group",
          "name",
          "count",
          "mean",
          "impact"
        ],
        "properties": {
          "digest": {
            "type": "string",
            "description": "Digest identifying the event."
          },
          "group": {
            "type": "string",
            "description": "Group the event belongs to (e.g. `active_record`), derived from `name`."
          },
          "name": {
            "type": "string",
            "description": "Event name (e.g. `sql.active_record`)."
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "description": "Human-readable title."
          },
          "body": {
            "type": [
              "string",
              "null"
            ],
            "description": "Event body (e.g. the query text)."
          },
          "count": {
            "type": "integer",
            "format": "u-int64",
            "description": "Number of occurrences in the time range.",
            "minimum": 0
          },
          "mean": {
            "type": "number",
            "format": "double",
            "description": "Weighted mean duration in milliseconds."
          },
          "impact": {
            "type": "number",
            "format": "double",
            "description": "Total time spent in milliseconds (`count * mean`)."
          }
        }
      },
      "EventGroupListQuery": {
        "type": "object",
        "description": "Query for the event group list.",
        "required": [
          "site_id",
          "from",
          "to",
          "groups"
        ],
        "properties": {
          "site_id": {
            "type": "string",
            "description": "Site to fetch events for, as a BSON ObjectId."
          },
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the time range, rounded down to the start of its `resolution` bucket."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "End of the time range (inclusive). Capped at now, then rounded up to the end of its\n`resolution` bucket; `MINUTELY` stops at the end of the minute 2 minutes ago."
          },
          "resolution": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Resolution",
                "description": "Sets how `from` and `to` are rounded. `MINUTELY` fits ranges of up to 12 hours within the\nlast 2 days; when absent or unfit, `MINUTELY` is used if it fits, otherwise `HOURLY`."
              }
            ]
          },
          "groups": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Event groups to include (e.g. `[\"active_record\", \"moped\"]`). At least one."
          },
          "order": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/EventGroupOrder",
                "description": "Field to rank and truncate by."
              }
            ],
            "default": "IMPACT"
          },
          "limit": {
            "type": "integer",
            "format": "int32",
            "description": "Maximum number of rows to return. Clamped to 1–1000.",
            "default": 1000
          }
        }
      },
      "EventGroupOrder": {
        "type": "string",
        "description": "Field the event group list is ranked and truncated by.",
        "enum": [
          "IMPACT",
          "MEAN",
          "THROUGHPUT"
        ]
      },
      "Field": {
        "type": "string",
        "description": "The specific measurement within a metric to retrieve.\n\nA gauge metric only has a [`Gauge`](Self::Gauge) field; a counter metric only has a\n[`Counter`](Self::Counter) field; a measurement metric has statistical fields such as\n[`Mean`](Self::Mean), [`Count`](Self::Count), [`Min`](Self::Min), [`Max`](Self::Max)\nand percentiles.\n\nSerialized as uppercase strings (e.g. `\"GAUGE\"`, `\"P95\"`).",
        "enum": [
          "GAUGE",
          "COUNTER",
          "MEAN",
          "COUNT",
          "MIN",
          "MAX",
          "P99",
          "P95",
          "P90",
          "P80",
          "P75",
          "P70",
          "P60",
          "P50",
          "P40",
          "P30",
          "P20",
          "P10"
        ]
      },
      "FillMode": {
        "type": "string",
        "description": "How missing data points (empty time buckets) are filled when assembling a series.",
        "enum": [
          "ZERO",
          "PREVIOUS",
          "NONE"
        ]
      },
      "GroupBy": {
        "oneOf": [
          {
            "type": "object",
            "description": "Group by the value of a specific tag (e.g. `\"hostname\"`). The tag value becomes\npart of the row's id and group map.",
            "required": [
              "Tag"
            ],
            "properties": {
              "Tag": {
                "type": "string",
                "description": "Group by the value of a specific tag (e.g. `\"hostname\"`). The tag value becomes\npart of the row's id and group map."
              }
            }
          },
          {
            "type": "string",
            "description": "Group by the metric name itself.",
            "enum": [
              "Name"
            ]
          }
        ],
        "description": "Specifies how rows in a [`List`](super::output::List) are grouped."
      },
      "IncidentErrorRow": {
        "type": "object",
        "description": "A single incident digest's error count within the queried selection.",
        "required": [
          "incident_digest",
          "namespace",
          "revision",
          "error_count"
        ],
        "properties": {
          "incident_digest": {
            "type": "string",
            "description": "The incident digest."
          },
          "namespace": {
            "type": "string",
            "description": "Application namespace the incident occurred in."
          },
          "revision": {
            "type": "string",
            "description": "Most recent deployment revision the incident occurred in within the\nqueried time range."
          },
          "error_count": {
            "type": "integer",
            "format": "u-int64",
            "description": "Total error occurrences for this digest across the queried time\nrange, summed across every matching revision.",
            "minimum": 0
          }
        }
      },
      "IncidentErrorsQuery": {
        "type": "object",
        "description": "Query for the incident error list.",
        "required": [
          "site_id",
          "from",
          "to"
        ],
        "properties": {
          "site_id": {
            "type": "string",
            "description": "Site to fetch incident error counts for."
          },
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the time range (inclusive)."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "End of the time range (inclusive)."
          },
          "namespaces": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Namespaces to filter by. When empty, all namespaces are included."
          },
          "revision": {
            "type": [
              "string",
              "null"
            ],
            "description": "Deployment revision to filter by. When absent, all revisions are\nincluded."
          }
        }
      },
      "IncidentKind": {
        "type": "string",
        "description": "Whether something represents an exception or a performance incident.",
        "enum": [
          "exception",
          "performance"
        ]
      },
      "List": {
        "type": "object",
        "description": "A tabular collection of [`Row`]s, returned for list-view queries.\n\nEach row represents an aggregated metric value grouped by tags, used for displaying\nmetric data in table format in the frontend.",
        "required": [
          "resolution",
          "from",
          "to",
          "rows"
        ],
        "properties": {
          "resolution": {
            "$ref": "#/components/schemas/Resolution",
            "description": "The time interval used for aggregation (e.g. one minute, one hour)."
          },
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the queried time range (inclusive)."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "End of the queried time range (inclusive)."
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Row"
            },
            "description": "The rows of aggregated metric data."
          }
        }
      },
      "ListQuery": {
        "type": "object",
        "description": "Query for fetching aggregated metric data in tabular form, used to populate list views.\n\nUnlike [`TimeseriesQuery`], which returns data points over time, a `ListQuery` returns\none [`Row`](super::output::Row) per unique combination of group-by values, with each row\ncontaining aggregated metric values.",
        "required": [
          "from",
          "to",
          "site_id",
          "select",
          "group_by"
        ],
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the time range to query (inclusive)."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "End of the time range to query (inclusive)."
          },
          "resolution": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Resolution",
                "description": "The desired interval for aggregation. When `None`, a resolution is\nautomatically chosen based on the time range."
              }
            ]
          },
          "site_id": {
            "type": "string",
            "description": "The site to fetch metrics for."
          },
          "select": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ListSelector"
            },
            "description": "Selectors that define which metrics and fields to fetch. Each selector contributes\na key-value entry in the resulting [`Row::data`](super::output::Row::data) map."
          },
          "group_by": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroupBy"
            },
            "description": "How to group metrics into rows. Each unique combination of group-by values produces\none [`Row`](super::output::Row), whose id is derived from the grouped values."
          },
          "limit": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Maximum number of rows to return. When `None`, no limit is applied."
          },
          "pagination": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Pagination_MetricsPagination",
                "description": "Id-cursor paging (`per_page` 1 to 1000, rows ordered by `id`); takes precedence over\n`limit`. A page shorter than `per_page` is the last."
              }
            ]
          }
        }
      },
      "ListSelector": {
        "type": "object",
        "description": "Selects a specific metric, field and tag combination to include in a list response.\n\nEach selector contributes one entry in the resulting [`Row::data`](super::output::Row::data)\nmap, keyed by [`id`](Self::id).",
        "required": [
          "id",
          "name",
          "tags",
          "field"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The key under which this selector's aggregated value appears in\n[`Row::data`](super::output::Row::data) (e.g. `\"mean\"`, `\"count\"`)."
          },
          "name": {
            "type": "string",
            "description": "The metric name to query (e.g. `\"cpu_usage\"`, `\"transaction_duration\"`)."
          },
          "tags": {
            "type": "object",
            "description": "Tag key-value pairs to filter on. May contain wildcard values (`*`) for tags\nthat are included in the query's [`group_by`](ListQuery::group_by).",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "field": {
            "$ref": "#/components/schemas/Field",
            "description": "The specific measurement field to retrieve (e.g. `Gauge`, `Mean`, `P95`)."
          },
          "aggregation": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Aggregation",
                "description": "The aggregation function to apply when combining values within a time bucket.\nWhen `None`, a default is chosen based on the field type."
              }
            ]
          }
        }
      },
      "LocatorQuery": {
        "type": "object",
        "description": "The trace to locate and the sites to search.",
        "required": [
          "site_ids",
          "trace_id"
        ],
        "properties": {
          "site_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Sites to search across; the token must have access to all of them."
          },
          "trace_id": {
            "type": "string",
            "description": "The trace to locate."
          }
        }
      },
      "LogLine": {
        "type": "object",
        "description": "A log line; its attributes live inside `json`.",
        "required": [
          "timestamp"
        ],
        "properties": {
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "When the line was logged, with millisecond precision."
          },
          "id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Unique ID of the line."
          },
          "source_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Log source the line was ingested through."
          },
          "group": {
            "type": [
              "string",
              "null"
            ],
            "description": "Group the line belongs to, such as the app or service name."
          },
          "severity": {
            "type": [
              "string",
              "null"
            ],
            "description": "Severity level, such as `info` or `error`."
          },
          "message": {
            "type": [
              "string",
              "null"
            ],
            "description": "The log message."
          },
          "hostname": {
            "type": [
              "string",
              "null"
            ],
            "description": "Host that emitted the line."
          },
          "json": {
            "type": [
              "string",
              "null"
            ],
            "description": "The line's attributes as a JSON-encoded string."
          }
        }
      },
      "LogStreamEvent": {
        "oneOf": [
          {
            "type": "object",
            "description": "Query statistics, sent after every searched time chunk.",
            "required": [
              "data",
              "type"
            ],
            "properties": {
              "data": {
                "$ref": "#/components/schemas/QueryProgress",
                "description": "Query statistics, sent after every searched time chunk."
              },
              "type": {
                "type": "string",
                "enum": [
                  "Progress"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "Log lines found in the last searched time chunk.",
            "required": [
              "data",
              "type"
            ],
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/LogLine"
                },
                "description": "Log lines found in the last searched time chunk."
              },
              "type": {
                "type": "string",
                "enum": [
                  "Data"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "The search finished; always the last event.",
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "Complete"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "The search failed; followed by `Complete`.",
            "required": [
              "data",
              "type"
            ],
            "properties": {
              "data": {
                "type": "string",
                "description": "The search failed; followed by `Complete`."
              },
              "type": {
                "type": "string",
                "enum": [
                  "error"
                ]
              }
            }
          }
        ],
        "description": "One server-sent event of a streamed log search, as the JSON `data` of the event."
      },
      "LogsQueryParams": {
        "type": "object",
        "description": "Filters and pagination for searching log lines.",
        "required": [
          "site_id",
          "source_ids",
          "query",
          "pagination"
        ],
        "properties": {
          "site_id": {
            "type": "string",
            "description": "Site to search; an empty value returns no log lines."
          },
          "from": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Start of the time range; defaults to the start of the account's log retention and is clamped to it and now."
          },
          "to": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "End of the time range; defaults to now and is clamped to `from`..now."
          },
          "source_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Log sources to search; an empty list returns no log lines."
          },
          "query": {
            "type": "string",
            "description": "Log search query; an empty string matches every line."
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination_LogPagination",
            "description": "Page size, order and cursor."
          }
        }
      },
      "MetadataDistributions": {
        "anyOf": [
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MetadataKeyDistribution"
            }
          },
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MetadataValueDistribution"
            }
          }
        ],
        "description": "A bare JSON array of key rows or value rows."
      },
      "MetadataDistributionsQuery": {
        "type": "object",
        "description": "Query for the metadata distribution list.",
        "required": [
          "site_id",
          "incident_digests",
          "from",
          "group_by"
        ],
        "properties": {
          "site_id": {
            "type": "string",
            "description": "Site to fetch metadata for."
          },
          "incident_digests": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Incident digests to include."
          },
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the time range (inclusive)."
          },
          "to": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "End of the time range (inclusive). Defaults to now."
          },
          "group_by": {
            "$ref": "#/components/schemas/MetadataGroupBy",
            "description": "Which dimension to group by (`KEY` or `VALUE`)."
          },
          "metadata_key": {
            "type": [
              "string",
              "null"
            ],
            "description": "The metadata key to filter values by. Required when `group_by` is\n`VALUE`; ignored in `KEY` mode."
          },
          "limit": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Maximum rows to return, clamped to 1–1000. Defaults to 10 in `VALUE` mode;\nin `KEY` mode absent means no limit."
          }
        }
      },
      "MetadataGroupBy": {
        "type": "string",
        "description": "Which dimension the metadata distribution query groups by.",
        "enum": [
          "KEY",
          "VALUE"
        ]
      },
      "MetadataKeyDistribution": {
        "type": "object",
        "description": "A single metadata key row (KEY mode).",
        "required": [
          "key",
          "total",
          "unique"
        ],
        "properties": {
          "key": {
            "type": [
              "string",
              "null"
            ],
            "description": "The metadata key (e.g. `hostname`)."
          },
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Total occurrences across all values."
          },
          "unique": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Number of distinct values."
          }
        }
      },
      "MetadataValueDistribution": {
        "type": "object",
        "description": "A single metadata value row (VALUE mode).",
        "required": [
          "key",
          "value"
        ],
        "properties": {
          "key": {
            "type": [
              "string",
              "null"
            ],
            "description": "The metadata value (e.g. `frontend1`), under the field name `key`."
          },
          "value": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Occurrences of this value."
          }
        }
      },
      "MetricType": {
        "type": "string",
        "description": "The category of a metric, which determines how its values are interpreted.\n\nSerialized as uppercase strings (e.g. `\"GAUGE\"`, `\"COUNTER\"`, `\"MEASUREMENT\"`).",
        "enum": [
          "GAUGE",
          "COUNTER",
          "MEASUREMENT"
        ]
      },
      "MetricTypeAndTags": {
        "type": "object",
        "description": "Metadata describing a metric's type and the tag combinations it can be queried with.\n\nUsed to communicate which timeseries are available for a given metric name,\nso consumers know what tags they can filter or group by.",
        "required": [
          "metric_type",
          "available_tags"
        ],
        "properties": {
          "metric_type": {
            "$ref": "#/components/schemas/MetricType",
            "description": "The category of the metric (gauge, counter or measurement)."
          },
          "available_tags": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "The tag combinations available for this metric. Each inner vector represents one\nvalid combination of tag names (e.g. `[[\"hostname\"], [\"hostname\", \"namespace\"]]`)."
          }
        }
      },
      "NodesQuery": {
        "type": "object",
        "description": "Query for fetching Kubernetes node metrics.",
        "required": [
          "site_id",
          "from",
          "to"
        ],
        "properties": {
          "site_id": {
            "type": "string",
            "description": "Site identifier to query nodes for."
          },
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the time range (inclusive)."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "End of the time range (exclusive)."
          },
          "node_name": {
            "type": "string",
            "description": "Optional node name filter. Empty means all nodes."
          }
        }
      },
      "NodesRow": {
        "type": "object",
        "description": "The latest Kubernetes node metrics within the requested time range.",
        "required": [
          "timestamp",
          "node_name",
          "cpu_usage_nano_cores",
          "memory_rss_bytes",
          "memory_usage_bytes",
          "memory_working_set_bytes",
          "memory_page_faults",
          "memory_major_page_faults",
          "fs_used_bytes",
          "fs_available_bytes",
          "fs_capacity_bytes",
          "fs_inodes_free",
          "fs_inodes_used",
          "fs_inodes",
          "network_rx_bytes",
          "network_tx_bytes",
          "phase"
        ],
        "properties": {
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp of the metrics snapshot."
          },
          "node_name": {
            "type": "string",
            "description": "Name of the Kubernetes node."
          },
          "cpu_usage_nano_cores": {
            "type": "number",
            "format": "double",
            "description": "CPU usage in nanocores."
          },
          "memory_rss_bytes": {
            "type": "number",
            "format": "double",
            "description": "Resident set size (RSS) memory in bytes."
          },
          "memory_usage_bytes": {
            "type": "number",
            "format": "double",
            "description": "Total memory usage in bytes."
          },
          "memory_working_set_bytes": {
            "type": "number",
            "format": "double",
            "description": "Working set memory in bytes."
          },
          "memory_page_faults": {
            "type": "number",
            "format": "double",
            "description": "Number of page faults."
          },
          "memory_major_page_faults": {
            "type": "number",
            "format": "double",
            "description": "Number of major page faults."
          },
          "fs_used_bytes": {
            "type": "number",
            "format": "double",
            "description": "Filesystem space used in bytes."
          },
          "fs_available_bytes": {
            "type": "number",
            "format": "double",
            "description": "Filesystem space available in bytes."
          },
          "fs_capacity_bytes": {
            "type": "number",
            "format": "double",
            "description": "Total filesystem capacity in bytes."
          },
          "fs_inodes_free": {
            "type": "number",
            "format": "double",
            "description": "Number of free filesystem inodes."
          },
          "fs_inodes_used": {
            "type": "number",
            "format": "double",
            "description": "Number of used filesystem inodes."
          },
          "fs_inodes": {
            "type": "number",
            "format": "double",
            "description": "Total number of filesystem inodes."
          },
          "network_rx_bytes": {
            "type": "number",
            "format": "double",
            "description": "Network bytes received."
          },
          "network_tx_bytes": {
            "type": "number",
            "format": "double",
            "description": "Network bytes transmitted."
          },
          "phase": {
            "type": "integer",
            "format": "u-int8",
            "description": "Node phase as a numeric value.",
            "minimum": 0
          }
        }
      },
      "Order": {
        "type": "string",
        "description": "Sort order for query results\n\nUsed across multiple domains for paginated and ordered queries.",
        "enum": [
          "ASC",
          "DESC"
        ]
      },
      "OwnerReference": {
        "type": "object",
        "description": "A Kubernetes owner reference linking a pod to its controller.",
        "required": [
          "name",
          "kind",
          "namespace"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the owning resource (e.g. `\"my-deployment-abc123\"`)."
          },
          "kind": {
            "type": "string",
            "description": "Kind of the owning resource (e.g. `\"ReplicaSet\"`, `\"DaemonSet\"`)."
          },
          "namespace": {
            "type": "string",
            "description": "Namespace of the owning resource."
          }
        }
      },
      "Pagination_LogPagination": {
        "type": "object",
        "description": "Keyset pagination settings, generic over each domain's cursor type.",
        "required": [
          "per_page",
          "order",
          "cursor"
        ],
        "properties": {
          "per_page": {
            "type": "integer",
            "format": "int32",
            "description": "Number of results per page.",
            "minimum": 1
          },
          "order": {
            "$ref": "#/components/schemas/Order",
            "description": "Sort order for results."
          },
          "cursor": {
            "type": "object",
            "description": "Pagination cursor for log lines.",
            "properties": {
              "time": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "Timestamp of the last line on the previous page; `null` starts from the first page."
              },
              "id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "ID of the last line on the previous page; without it, lines sharing `time` are skipped."
              }
            }
          }
        }
      },
      "Pagination_MetricsPagination": {
        "type": "object",
        "description": "Keyset pagination settings, generic over each domain's cursor type.",
        "required": [
          "per_page",
          "order",
          "cursor"
        ],
        "properties": {
          "per_page": {
            "type": "integer",
            "format": "int32",
            "description": "Number of results per page.",
            "minimum": 1
          },
          "order": {
            "$ref": "#/components/schemas/Order",
            "description": "Sort order for results."
          },
          "cursor": {
            "oneOf": [
              {
                "type": "object",
                "description": "Cursor: the id of the last row of the previous page; rows are ordered by id.",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Cursor: the id of the last row of the previous page; rows are ordered by id."
                  }
                }
              }
            ],
            "description": "Pagination cursor type for metric lists."
          }
        }
      },
      "Pagination_TracePagination": {
        "type": "object",
        "description": "Keyset pagination settings, generic over each domain's cursor type.",
        "required": [
          "per_page",
          "order",
          "cursor"
        ],
        "properties": {
          "per_page": {
            "type": "integer",
            "format": "int32",
            "description": "Number of results per page.",
            "minimum": 1
          },
          "order": {
            "$ref": "#/components/schemas/Order",
            "description": "Sort order for results."
          },
          "cursor": {
            "oneOf": [
              {
                "type": "object",
                "description": "Page by trace time; `null` starts from the first page.",
                "required": [
                  "time"
                ],
                "properties": {
                  "time": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "Page by trace time; `null` starts from the first page."
                  }
                }
              },
              {
                "type": "object",
                "description": "Page by trace duration in milliseconds; `null` starts from the first page.",
                "required": [
                  "duration"
                ],
                "properties": {
                  "duration": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "format": "double",
                    "description": "Page by trace duration in milliseconds; `null` starts from the first page."
                  }
                }
              }
            ],
            "description": "Pagination cursor type for traces."
          }
        }
      },
      "PerformanceLocation": {
        "type": "object",
        "description": "Performance action where a trace appears.",
        "required": [
          "site_id",
          "namespace",
          "action_name"
        ],
        "properties": {
          "site_id": {
            "type": "string",
            "description": "Site identifier."
          },
          "namespace": {
            "type": "string",
            "description": "Namespace of the action (e.g. `\"web\"`)."
          },
          "action_name": {
            "type": "string",
            "description": "Name of the action (e.g. `\"POST /api/users\"`)."
          }
        }
      },
      "PerformanceTraceQuery": {
        "type": "object",
        "description": "The performance action whose trace to fetch.",
        "required": [
          "site_ids",
          "action_name",
          "namespace"
        ],
        "properties": {
          "site_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Sites to search; the token must have access to all of them."
          },
          "action_name": {
            "type": "string",
            "description": "Name of the action, e.g. `POST /api/users`."
          },
          "namespace": {
            "type": "string",
            "description": "Namespace of the action, e.g. `web`."
          },
          "trace_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "A specific trace ID, or `\"last\"` (the default) for the most recent trace of the action."
          }
        }
      },
      "PerformanceTracesQuery": {
        "type": "object",
        "description": "Filters and pagination for listing the performance traces of one action.",
        "required": [
          "site_ids",
          "action_name",
          "namespace",
          "pagination"
        ],
        "properties": {
          "site_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Sites to search; the caller must have access to all of them."
          },
          "action_name": {
            "type": "string",
            "description": "Action to list traces for, e.g. `POST /api`."
          },
          "namespace": {
            "type": "string",
            "description": "Namespace the action belongs to, e.g. `web`."
          },
          "query": {
            "type": [
              "string",
              "null"
            ],
            "description": "Filter query; supports revision and tag filters."
          },
          "duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Only return traces at least this long, in milliseconds."
          },
          "from": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Start of the time range."
          },
          "to": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "End of the time range."
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination_TracePagination",
            "description": "Page size (capped at 100), order and cursor."
          }
        }
      },
      "PodOverviewRow": {
        "type": "object",
        "description": "A Kubernetes pod overview with metadata and status information.",
        "required": [
          "timestamp",
          "node_name",
          "pod_name",
          "pod_namespace",
          "pod_uuid",
          "phase",
          "labels",
          "owner_references",
          "containers",
          "state",
          "pod_restart_count",
          "pod_uptime_seconds"
        ],
        "properties": {
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp of the metrics snapshot."
          },
          "node_name": {
            "type": "string",
            "description": "Name of the node this pod is running on."
          },
          "pod_name": {
            "type": "string",
            "description": "Name of the pod."
          },
          "pod_namespace": {
            "type": "string",
            "description": "Kubernetes namespace the pod belongs to."
          },
          "pod_uuid": {
            "type": "string",
            "description": "Unique pod identifier."
          },
          "phase": {
            "$ref": "#/components/schemas/PodPhase",
            "description": "Current phase of the pod lifecycle."
          },
          "labels": {
            "type": "object",
            "description": "Kubernetes labels attached to the pod.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "owner_references": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OwnerReference"
            },
            "description": "Owner references (e.g. Deployment, ReplicaSet) for this pod."
          },
          "containers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Container"
            },
            "description": "Containers running in this pod."
          },
          "state": {
            "$ref": "#/components/schemas/PodState",
            "description": "Derived pod state based on phase and container statuses."
          },
          "pod_restart_count": {
            "type": "integer",
            "format": "u-int32",
            "description": "Total number of container restarts for this pod.",
            "minimum": 0
          },
          "pod_uptime_seconds": {
            "type": "integer",
            "format": "u-int64",
            "description": "Pod uptime in seconds.",
            "minimum": 0
          }
        }
      },
      "PodOverviewsQuery": {
        "type": "object",
        "description": "Query for fetching Kubernetes pod overview data.",
        "required": [
          "site_id",
          "from",
          "to"
        ],
        "properties": {
          "site_id": {
            "type": "string",
            "description": "Site identifier to query pod overviews for."
          },
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the time range (inclusive)."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "End of the time range (exclusive)."
          },
          "namespaces": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Optional namespace filter. Empty means all namespaces."
          },
          "query": {
            "type": "string",
            "description": "Optional substring of the pod name to match. Empty means all pods."
          }
        }
      },
      "PodPhase": {
        "type": "string",
        "description": "Kubernetes pod lifecycle phase.",
        "enum": [
          "Running",
          "Succeeded",
          "Pending",
          "Failed",
          "Unknown"
        ]
      },
      "PodState": {
        "type": "string",
        "description": "Derived state of a pod, combining phase and container statuses.",
        "enum": [
          "Unknown",
          "Pending",
          "Running",
          "Succeeded",
          "Failed"
        ]
      },
      "PodsQuery": {
        "type": "object",
        "description": "Query for fetching detailed Kubernetes pod metrics.",
        "required": [
          "site_id",
          "from",
          "to"
        ],
        "properties": {
          "site_id": {
            "type": "string",
            "description": "Site identifier to query pods for."
          },
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the time range (inclusive)."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "End of the time range (exclusive)."
          },
          "namespaces": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Optional namespace filter. Empty means all namespaces."
          },
          "pod_name": {
            "type": "string",
            "description": "Optional substring of the pod name to match. Empty means all pods."
          },
          "node_names": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Optional node name filter. Empty means all nodes."
          },
          "state": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PodState",
                "description": "Optional pod state filter, applied to every snapshot in the time range rather than only the latest."
              }
            ]
          }
        }
      },
      "PodsRow": {
        "type": "object",
        "description": "The latest detailed Kubernetes pod metrics within the requested time range.",
        "required": [
          "timestamp",
          "pod_name",
          "pod_namespace",
          "node_name",
          "cpu_usage_nano_cores",
          "cpu_usage_core_nano_seconds",
          "memory_rss_bytes",
          "memory_usage_bytes",
          "memory_working_set_bytes",
          "memory_page_faults",
          "memory_major_page_faults",
          "ephemeral_storage_used_bytes",
          "ephemeral_storage_capacity_bytes",
          "network_rx_bytes",
          "network_tx_bytes",
          "process_count",
          "phase",
          "state",
          "containers",
          "pod_restart_count",
          "pod_uptime_seconds"
        ],
        "properties": {
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp of the metrics snapshot."
          },
          "pod_name": {
            "type": "string",
            "description": "Name of the pod."
          },
          "pod_namespace": {
            "type": "string",
            "description": "Kubernetes namespace the pod belongs to."
          },
          "node_name": {
            "type": "string",
            "description": "Name of the node this pod is running on."
          },
          "cpu_usage_nano_cores": {
            "type": "number",
            "format": "double",
            "description": "CPU usage in nanocores."
          },
          "cpu_usage_core_nano_seconds": {
            "type": "number",
            "format": "double",
            "description": "Cumulative CPU usage in core-nanoseconds."
          },
          "memory_rss_bytes": {
            "type": "number",
            "format": "double",
            "description": "Resident set size (RSS) memory in bytes."
          },
          "memory_usage_bytes": {
            "type": "number",
            "format": "double",
            "description": "Total memory usage in bytes."
          },
          "memory_working_set_bytes": {
            "type": "number",
            "format": "double",
            "description": "Working set memory in bytes."
          },
          "memory_page_faults": {
            "type": "number",
            "format": "double",
            "description": "Number of page faults."
          },
          "memory_major_page_faults": {
            "type": "number",
            "format": "double",
            "description": "Number of major page faults."
          },
          "ephemeral_storage_used_bytes": {
            "type": "number",
            "format": "double",
            "description": "Ephemeral storage used in bytes."
          },
          "ephemeral_storage_capacity_bytes": {
            "type": "number",
            "format": "double",
            "description": "Ephemeral storage capacity in bytes."
          },
          "network_rx_bytes": {
            "type": "number",
            "format": "double",
            "description": "Network bytes received."
          },
          "network_tx_bytes": {
            "type": "number",
            "format": "double",
            "description": "Network bytes transmitted."
          },
          "process_count": {
            "type": "number",
            "format": "double",
            "description": "Number of running processes."
          },
          "phase": {
            "$ref": "#/components/schemas/PodPhase",
            "description": "Current phase of the pod lifecycle."
          },
          "state": {
            "$ref": "#/components/schemas/PodState",
            "description": "Derived pod state based on phase and container statuses."
          },
          "containers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Container"
            },
            "description": "Containers running in this pod."
          },
          "pod_restart_count": {
            "type": "integer",
            "format": "u-int32",
            "description": "Total number of container restarts for this pod.",
            "minimum": 0
          },
          "pod_uptime_seconds": {
            "type": "integer",
            "format": "u-int64",
            "description": "Pod uptime in seconds.",
            "minimum": 0
          }
        }
      },
      "Point": {
        "type": "object",
        "description": "A single data point in a timeseries, representing a value at a specific moment in time.",
        "required": [
          "timestamp",
          "value"
        ],
        "properties": {
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "The moment in time this data point represents, aligned to the query's timeframe resolution."
          },
          "value": {
            "type": "number",
            "format": "double",
            "description": "The numeric metric value at this timestamp."
          }
        }
      },
      "Projection": {
        "type": "object",
        "description": "A forward projection of a fitted linear trend toward a ceiling.",
        "required": [
          "slope_per_second",
          "fit_quality",
          "ceiling",
          "cross_at",
          "seconds_to_cross"
        ],
        "properties": {
          "slope_per_second": {
            "type": "number",
            "format": "double",
            "description": "Fitted slope, in value-units per second."
          },
          "fit_quality": {
            "type": "number",
            "format": "double",
            "description": "Goodness-of-fit (R², `0.0..=1.0`) of the linear fit the projection rests on."
          },
          "ceiling": {
            "type": "number",
            "format": "double",
            "description": "The ceiling the series is projected to cross."
          },
          "cross_at": {
            "type": "integer",
            "format": "int64",
            "description": "Unix-seconds timestamp at which the series is projected to cross the ceiling."
          },
          "seconds_to_cross": {
            "type": "integer",
            "format": "int64",
            "description": "Seconds from the reference time (`now`) until the projected crossing."
          }
        }
      },
      "QueryProgress": {
        "type": "object",
        "description": "Progress of a log search, which runs over the time range in chunks.",
        "required": [
          "rows_read",
          "bytes_read",
          "total_rows_to_read",
          "progress_percentage",
          "processed_chunks",
          "total_chunks",
          "rows_returned"
        ],
        "properties": {
          "rows_read": {
            "type": "integer",
            "format": "u-int64",
            "description": "Number of rows read so far across all chunks.",
            "minimum": 0
          },
          "bytes_read": {
            "type": "integer",
            "format": "u-int64",
            "description": "Number of bytes read so far across all chunks.",
            "minimum": 0
          },
          "total_rows_to_read": {
            "type": "integer",
            "format": "u-int64",
            "description": "Estimated total rows to read across all chunks.",
            "minimum": 0
          },
          "progress_percentage": {
            "type": "number",
            "format": "double",
            "description": "Overall progress as a percentage (0.0–100.0)."
          },
          "processed_chunks": {
            "type": "integer",
            "format": "u-int64",
            "description": "Number of time chunks processed so far.",
            "minimum": 0
          },
          "total_chunks": {
            "type": "integer",
            "format": "u-int64",
            "description": "Total number of time chunks to process.",
            "minimum": 0
          },
          "rows_returned": {
            "type": "integer",
            "format": "u-int64",
            "description": "Number of rows included in the response so far.",
            "minimum": 0
          }
        }
      },
      "RelatedTraceItem": {
        "type": "object",
        "description": "Related trace item showing an action where a slow event appears.",
        "required": [
          "action_name",
          "namespace",
          "count",
          "trace_id",
          "start_time"
        ],
        "properties": {
          "action_name": {
            "type": "string",
            "description": "Name of the action containing the slow event."
          },
          "namespace": {
            "type": "string",
            "description": "Namespace the action belongs to."
          },
          "count": {
            "type": "integer",
            "format": "u-int64",
            "description": "Number of times the slow event appeared in this action.",
            "minimum": 0
          },
          "trace_id": {
            "type": "string",
            "description": "Trace ID of the most recent occurrence."
          },
          "start_time": {
            "type": "string",
            "description": "Start time of the most recent occurrence.",
            "example": "2024-01-01 00:00:00.123456789"
          }
        }
      },
      "Resolution": {
        "type": "string",
        "description": "Time resolution that metrics can be returned in",
        "enum": [
          "HOURLY",
          "MINUTELY",
          "DAILY"
        ]
      },
      "Row": {
        "type": "object",
        "description": "A single row in a [`List`], representing aggregated metric values for one group of tags.\n\nRows from different metric sources can be merged together using [`Row::merge`],\ncombining their data maps into a single row.",
        "required": [
          "id",
          "group",
          "data"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for this row, typically derived from the group tag values."
          },
          "group": {
            "type": "object",
            "description": "Tag key-value pairs that define this row's grouping\n(e.g. `{\"hostname\": \"frontend1\"}`).",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "data": {
            "type": "object",
            "description": "Aggregated metric values keyed by selector id (e.g. `{\"mean\": 42.5, \"count\": 100.0}`).",
            "additionalProperties": {
              "type": "number",
              "format": "double"
            },
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "SampleKind": {
        "type": "string",
        "description": "Specifies whether to search errors, performance samples, or both.",
        "enum": [
          "all",
          "exception",
          "performance"
        ]
      },
      "SavedVisualOut": {
        "type": "object",
        "description": "JSON response representation of a saved visual (chart).",
        "required": [
          "id",
          "resolution",
          "value_format",
          "value_input",
          "series"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "MongoDB ObjectId of the saved visual (hex-encoded)."
          },
          "resolution": {
            "type": "string",
            "description": "Time resolution (e.g. `\"HOURLY\"`, `\"MINUTELY\"`)."
          },
          "value_format": {
            "type": "string",
            "description": "Value format type (e.g. `\"number\"`, `\"duration\"`)."
          },
          "value_input": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional input format specification; `null` when unset."
          },
          "series": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SerieOut"
            },
            "description": "Data series contained in this visual."
          }
        }
      },
      "SearchRequest": {
        "type": "object",
        "description": "Request body for the unified search endpoint.",
        "required": [
          "site_ids"
        ],
        "properties": {
          "site_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Sites to search, as BSON ObjectIds: at least one, all in one account."
          },
          "query": {
            "type": [
              "string",
              "null"
            ],
            "description": "Bare words match an action name, exception name or tag value exactly, as one phrase.\n`action:`, `error:` and `tag:` match one field exactly, `message:` a case-insensitive whole-word phrase; quote values with spaces."
          },
          "namespace": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional namespace filter (e.g. `\"web\"`, `\"background\"`)."
          },
          "kind": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/SampleKind",
                "description": "Sample kind filter."
              }
            ],
            "default": "all"
          },
          "from": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Start of the time range (inclusive). Defaults to, and is clamped to, the\nstart of the account's retention."
          },
          "to": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "End of the time range (inclusive). Defaults to now."
          },
          "limit": {
            "type": "integer",
            "description": "Maximum number of results to return. Clamped to at most 2000.",
            "default": 50,
            "minimum": 0
          }
        }
      },
      "SearchResult": {
        "type": "object",
        "description": "A search result item returned by the unified search endpoint.",
        "required": [
          "result_type",
          "source",
          "trace_id",
          "site_id",
          "time",
          "duration",
          "tags"
        ],
        "properties": {
          "result_type": {
            "$ref": "#/components/schemas/IncidentKind",
            "description": "Whether this is an exception or performance result."
          },
          "source": {
            "$ref": "#/components/schemas/SearchResultSource",
            "description": "Where this result came from; always `trace`."
          },
          "trace_id": {
            "type": "string",
            "description": "Identifier to open the trace with."
          },
          "site_id": {
            "type": "string",
            "description": "Site identifier this result belongs to."
          },
          "namespace": {
            "type": [
              "string",
              "null"
            ],
            "description": "Namespace the result belongs to (e.g. `\"web\"`, `\"background\"`)."
          },
          "revision": {
            "type": [
              "string",
              "null"
            ],
            "description": "Git revision or deployment identifier active when the result was recorded."
          },
          "action_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Action name of the result (e.g. `\"POST /api/users\"`)."
          },
          "time": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the result was recorded."
          },
          "duration": {
            "type": "number",
            "format": "double",
            "description": "Duration in milliseconds of the matched span."
          },
          "tags": {
            "type": "object",
            "description": "User-defined tags.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "exception_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Exception name; present for exception results only."
          },
          "exception_message": {
            "type": [
              "string",
              "null"
            ],
            "description": "Exception message; present for exception results only."
          },
          "incident_digest": {
            "type": [
              "string",
              "null"
            ],
            "description": "Incident digest used to link to the incident page."
          },
          "incident_number": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Incident number, when the incident digest matches a known incident."
          }
        }
      },
      "SearchResultSource": {
        "type": "string",
        "description": "Where a search result originates from.",
        "enum": [
          "trace"
        ]
      },
      "Serie": {
        "type": "object",
        "description": "A single timeseries: a named sequence of points that share the same tags and field.",
        "required": [
          "id",
          "name",
          "tags",
          "max",
          "min",
          "field",
          "data"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for this series, composed of the metric name, sorted tags and field\n(e.g. `\"cpu_usage{hostname=frontend1};GAUGE\"`)."
          },
          "name": {
            "type": "string",
            "description": "The metric name (e.g. `\"cpu_usage\"`, `\"transaction_duration\"`)."
          },
          "tags": {
            "type": "object",
            "description": "Tag key-value pairs that distinguish this series from others with the same name\n(e.g. `{\"hostname\": \"frontend1\"}`).",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "max": {
            "type": "number",
            "format": "double",
            "description": "The maximum value across all data points in this series."
          },
          "min": {
            "type": "number",
            "format": "double",
            "description": "The minimum value across all data points in this series."
          },
          "field": {
            "$ref": "#/components/schemas/Field",
            "description": "The type of measurement this series represents (e.g. gauge, mean, a percentile)."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Point"
            },
            "description": "The ordered sequence of data points, aligned to the query's timeframe resolution."
          }
        }
      },
      "SerieOut": {
        "type": "object",
        "description": "A single data series within a saved visual.",
        "required": [
          "color",
          "name",
          "renderer",
          "data"
        ],
        "properties": {
          "color": {
            "type": "string",
            "description": "Series color as a CSS color string (e.g. `\"rgb(0,0,0)\"`)."
          },
          "name": {
            "type": "string",
            "description": "Display name of the series."
          },
          "renderer": {
            "type": "string",
            "description": "Renderer type (e.g. `\"line\"`, `\"area\"`)."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DataPointOut"
            },
            "description": "Ordered data points in this series."
          }
        }
      },
      "Severity": {
        "type": "string",
        "description": "Severity bucket for a detection, derived from how imminent / large the anomaly is.",
        "enum": [
          "info",
          "warning",
          "critical"
        ]
      },
      "SiteEdge": {
        "type": "object",
        "description": "A single service-level edge for the site dependency map. Unlike\n`ActionEdge`, this is aggregated across all actions in a service and\ncarries no namespace or action name.",
        "required": [
          "service",
          "count",
          "error_count",
          "mean",
          "p_90",
          "p_95"
        ],
        "properties": {
          "site_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Site ID of the peer service if accessible to the user, else `None`."
          },
          "site_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Current display name of the peer site, if accessible to the user."
          },
          "site_environment": {
            "type": [
              "string",
              "null"
            ],
            "description": "Environment of the peer site (e.g. \"production\"), if accessible to the user."
          },
          "service": {
            "type": "string",
            "description": "Peer service name (app name on the other end of the edge)."
          },
          "count": {
            "type": "integer",
            "format": "u-int64",
            "description": "Total request count over the time range.",
            "minimum": 0
          },
          "error_count": {
            "type": "integer",
            "format": "u-int64",
            "description": "Total error count over the time range.",
            "minimum": 0
          },
          "mean": {
            "type": "number",
            "format": "double",
            "description": "Mean duration in milliseconds (count-weighted across the range)."
          },
          "p_90": {
            "type": "number",
            "format": "double",
            "description": "90th percentile duration in milliseconds. Approximation: traffic-weighted\naverage of per-minute pre-computed p_90 values (sum(p_90 * count) / sum(count))."
          },
          "p_95": {
            "type": "number",
            "format": "double",
            "description": "95th percentile duration in milliseconds. Approximation: traffic-weighted\naverage of per-minute pre-computed p_95 values (sum(p_95 * count) / sum(count))."
          }
        }
      },
      "SiteEdgesApiQuery": {
        "type": "object",
        "description": "Query parameters for listing site-level service dependency edges.",
        "required": [
          "site_id",
          "from",
          "to"
        ],
        "properties": {
          "site_id": {
            "type": "string",
            "description": "Site ID that anchors the query."
          },
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the time range (inclusive)."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "End of the time range (exclusive)."
          }
        }
      },
      "SiteEdgesResponse": {
        "type": "object",
        "description": "Response shape for the site edges endpoint.",
        "required": [
          "upstream",
          "downstream",
          "internal"
        ],
        "properties": {
          "upstream": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SiteEdge"
            },
            "description": "External services calling into this site (upstream)."
          },
          "downstream": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SiteEdge"
            },
            "description": "External services this site calls (downstream)."
          },
          "internal": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SiteEdge"
            },
            "description": "Internal services this site calls within itself (both sides share the focused site_id)."
          }
        }
      },
      "SlowEventItem": {
        "type": "object",
        "description": "A slow event aggregation (e.g. a slow database query).",
        "required": [
          "digest",
          "count",
          "mean",
          "impact"
        ],
        "properties": {
          "digest": {
            "type": "string",
            "description": "Hash digest identifying the slow event's operation."
          },
          "count": {
            "type": "integer",
            "format": "u-int64",
            "description": "Number of times this slow event occurred in the time range.",
            "minimum": 0
          },
          "mean": {
            "type": "number",
            "format": "double",
            "description": "Mean duration of this slow event in milliseconds."
          },
          "impact": {
            "type": "number",
            "format": "double",
            "description": "Relative impact score (higher means more total time spent)."
          }
        },
        "additionalProperties": {
          "type": "string",
          "description": "Additional attributes for the slow event (e.g. query body, category)."
        }
      },
      "SlowEventsParams": {
        "type": "object",
        "description": "Filters for listing slow events such as slow database queries.",
        "required": [
          "site_id",
          "from",
          "to",
          "wanted_attributes"
        ],
        "properties": {
          "site_id": {
            "type": "string",
            "description": "Site to query."
          },
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the time range; clamped to the account's data retention."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "End of the time range; clamped to now."
          },
          "span_kind": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SpanKind",
                "description": "Only return spans of this kind."
              }
            ]
          },
          "wanted_attributes": {
            "type": "object",
            "description": "Attributes to return, keyed by category (e.g. `payload`, `system`). The key `appsignal.library`\nreturns what follows `appsignal/` in the span's scope (e.g. `active_record`), empty for other scopes.",
            "additionalProperties": {
              "$ref": "#/components/schemas/AttributeRequirement"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "excluded_attributes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Attribute keys to exclude; a span is excluded if any listed key is present."
          }
        }
      },
      "SpanKind": {
        "type": "string",
        "description": "The OpenTelemetry kind of a span, as a PascalCase string.\n\n`Client` and `Server` are synchronous calls; `Producer` and `Consumer` are async jobs.",
        "enum": [
          "Client",
          "Server",
          "Internal",
          "Producer",
          "Consumer"
        ]
      },
      "StatsQuery": {
        "type": "object",
        "description": "Query for the aggregated metrics of one deployment revision, over all retained data.",
        "required": [
          "site_id",
          "revision"
        ],
        "properties": {
          "site_id": {
            "type": "string",
            "description": "Site identifier, as a BSON ObjectId."
          },
          "revision": {
            "type": "string",
            "description": "Git revision or deployment identifier."
          },
          "namespace": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional namespace filter (e.g., \"web\", \"api\"). Absent means all namespaces."
          }
        }
      },
      "Timeseries": {
        "type": "object",
        "description": "A collection of series over a time range, aligned to the given resolution.",
        "required": [
          "resolution",
          "from",
          "to",
          "series"
        ],
        "properties": {
          "resolution": {
            "$ref": "#/components/schemas/Resolution",
            "description": "The time interval between consecutive data points (e.g. one minute, one hour)."
          },
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the queried time range (inclusive)."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "End of the queried time range (inclusive)."
          },
          "series": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Serie"
            },
            "description": "The individual timeseries that matched the query."
          }
        }
      },
      "TimeseriesQuery": {
        "type": "object",
        "description": "Query for fetching timeseries metric data, used to populate graphs.",
        "required": [
          "from",
          "to",
          "site_id",
          "select"
        ],
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the time range to query (inclusive)."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "End of the time range to query (inclusive)."
          },
          "resolution": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Resolution",
                "description": "The desired interval between data points. When `None`, a resolution is\nautomatically chosen based on the time range."
              }
            ]
          },
          "site_id": {
            "type": "string",
            "description": "The site to fetch metrics for."
          },
          "select": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimeseriesSelector"
            },
            "description": "Selectors that define which metrics and fields to fetch."
          },
          "limit": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Maximum number of unique series to return. When `None`, no limit is applied."
          }
        }
      },
      "TimeseriesSelector": {
        "type": "object",
        "description": "Selects a specific metric, field and tag combination to include in a timeseries response.",
        "required": [
          "name",
          "tags",
          "field"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The metric name to query (e.g. `\"cpu_usage\"`, `\"transaction_duration\"`)."
          },
          "tags": {
            "type": "object",
            "description": "Tag key-value pairs to filter on (e.g. `{\"hostname\": \"frontend1\"}`).",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "field": {
            "$ref": "#/components/schemas/Field",
            "description": "The specific measurement field to retrieve (e.g. `GAUGE`, `MEAN`, `P95`)."
          },
          "aggregation": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Aggregation",
                "description": "The aggregation function to apply when combining values within a time bucket.\nWhen omitted, a default is chosen based on the field (e.g. `SUM` for counters,\n`AVERAGE` for percentiles)."
              }
            ]
          },
          "draw_null_as_zero": {
            "type": "boolean",
            "description": "Legacy fill policy: `true` fills missing data points with `0.0`, `false` carries\nthe previous value forward. Superseded by `fill`.",
            "default": true
          },
          "fill": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/FillMode",
                "description": "Preferred fill policy; takes precedence over `draw_null_as_zero` when set."
              }
            ]
          }
        }
      },
      "TooManyRequestsResponse": {
        "type": "object",
        "description": "Error body returned for 429 responses.",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Human-readable error message."
          },
          "suggestion": {
            "type": [
              "string",
              "null"
            ],
            "description": "A cheaper way to write the request's filter. Only the trace list\nendpoints set it, and only for a filter with a known indexed rewrite."
          }
        }
      },
      "Trace": {
        "type": "object",
        "description": "A trace summary representing a root span.",
        "required": [
          "span_id",
          "trace_id",
          "site_id",
          "time",
          "duration",
          "tags",
          "has_npo"
        ],
        "properties": {
          "span_id": {
            "type": "string",
            "description": "Unique identifier for the root span."
          },
          "trace_id": {
            "type": "string",
            "description": "Unique identifier for the entire trace."
          },
          "site_id": {
            "type": "string",
            "description": "Site identifier this trace belongs to."
          },
          "namespace": {
            "type": [
              "string",
              "null"
            ],
            "description": "Namespace the trace belongs to (e.g. `\"web\"`, `\"background\"`)."
          },
          "revision": {
            "type": [
              "string",
              "null"
            ],
            "description": "Git revision or deployment identifier active when the trace was recorded."
          },
          "action_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Action name for the trace (e.g. `\"POST /api/users\"`)."
          },
          "time": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the trace started."
          },
          "duration": {
            "type": "number",
            "format": "double",
            "description": "Total duration of the trace in milliseconds."
          },
          "tags": {
            "type": "object",
            "description": "User-defined tags extracted from span attributes.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "has_npo": {
            "type": "boolean",
            "description": "Whether this trace contains N+1 query detection results."
          }
        }
      },
      "TraceLocation": {
        "type": "object",
        "description": "Locations of a trace in performance and error contexts.",
        "required": [
          "performance",
          "errors"
        ],
        "properties": {
          "performance": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PerformanceLocation"
            },
            "description": "Performance actions where this trace appears."
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ErrorLocation"
            },
            "description": "Error incidents where this trace appears."
          }
        }
      },
      "TraceQuery": {
        "type": "object",
        "description": "The trace to fetch and the sites to search.",
        "required": [
          "site_ids",
          "trace_id"
        ],
        "properties": {
          "site_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Sites to search; the token must have access to all of them."
          },
          "trace_id": {
            "type": "string",
            "description": "The trace to fetch."
          },
          "include_linked_spans": {
            "type": "boolean",
            "description": "Also return spans from other traces that link to this one."
          }
        }
      },
      "TraceSpan": {
        "type": "object",
        "description": "A complete span with all its attributes, events and links.",
        "required": [
          "start_time",
          "end_time",
          "site_id",
          "trace_id",
          "parent_span_id",
          "span_id",
          "digest",
          "duration",
          "trace_state",
          "subtrace_root",
          "resource_attributes",
          "service_name",
          "namespace",
          "revision",
          "scope_name",
          "scope_version",
          "action_name",
          "span_name",
          "span_kind",
          "span_attributes",
          "status_code",
          "status_message",
          "events.timestamp",
          "events.name",
          "events.attributes",
          "links.trace_id",
          "links.span_id",
          "links.trace_state",
          "links.attributes"
        ],
        "properties": {
          "start_time": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the span started."
          },
          "end_time": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the span ended."
          },
          "site_id": {
            "type": "string",
            "description": "Identifier of the site this span belongs to."
          },
          "trace_id": {
            "type": "string",
            "description": "Unique identifier for the entire trace."
          },
          "parent_span_id": {
            "type": "string",
            "description": "Span ID of the parent span, empty for root spans."
          },
          "span_id": {
            "type": "string",
            "description": "Unique identifier for this span."
          },
          "digest": {
            "type": "string",
            "description": "Hash digest identifying the span's operation."
          },
          "duration": {
            "type": "number",
            "format": "double",
            "description": "Duration of the span in milliseconds."
          },
          "trace_state": {
            "type": "string",
            "description": "W3C trace state header value."
          },
          "subtrace_root": {
            "type": "boolean",
            "description": "Whether this span is the root of a subtrace (a separate service boundary)."
          },
          "resource_attributes": {
            "type": "object",
            "description": "Resource-level attributes (e.g. host, service metadata).",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "service_name": {
            "type": "string",
            "description": "Name of the service that produced this span."
          },
          "namespace": {
            "type": "string",
            "description": "Namespace the span belongs to (e.g. `\"web\"`, `\"background\"`)."
          },
          "revision": {
            "type": "string",
            "description": "Git revision or deployment identifier active when the span was recorded."
          },
          "scope_name": {
            "type": "string",
            "description": "Instrumentation scope name (e.g. the library that produced the span)."
          },
          "scope_version": {
            "type": "string",
            "description": "Instrumentation scope version."
          },
          "action_name": {
            "type": "string",
            "description": "Action name for the span (e.g. `\"POST /api/users\"`)."
          },
          "span_name": {
            "type": "string",
            "description": "Low-cardinality name of the operation (e.g. `\"HTTP GET\"`)."
          },
          "span_kind": {
            "type": "string",
            "description": "Span kind (e.g. `\"server\"`, `\"client\"`, `\"internal\"`)."
          },
          "span_attributes": {
            "type": "object",
            "description": "Span-level attributes (e.g. HTTP headers, database statements).",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "status_code": {
            "type": "string",
            "description": "OpenTelemetry status code: `\"unset\"`, `\"ok\"` or `\"error\"`."
          },
          "status_message": {
            "type": "string",
            "description": "Human-readable status message, typically set on error."
          },
          "events.timestamp": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Timestamps of span events."
          },
          "events.name": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Names of span events (e.g. `\"exception\"`)."
          },
          "events.attributes": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              },
              "propertyNames": {
                "type": "string"
              }
            },
            "description": "Attributes for each span event."
          },
          "links.trace_id": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Trace IDs of linked spans."
          },
          "links.span_id": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Span IDs of linked spans."
          },
          "links.trace_state": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Trace state values of linked spans."
          },
          "links.attributes": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              },
              "propertyNames": {
                "type": "string"
              }
            },
            "description": "Attributes for each span link."
          }
        }
      }
    },
    "securitySchemes": {
      "bearer_auth": {
        "type": "http",
        "scheme": "bearer",
        "description": "`Authorization: Bearer <token>`"
      },
      "token_query": {
        "type": "apiKey",
        "in": "query",
        "name": "token",
        "description": "Alternative to the Authorization header: pass the token as a `?token=<token>` query parameter."
      }
    }
  },
  "tags": [
    {
      "name": "Metrics"
    },
    {
      "name": "Tracing"
    },
    {
      "name": "Events"
    },
    {
      "name": "Search"
    },
    {
      "name": "Logs"
    },
    {
      "name": "Kubernetes"
    },
    {
      "name": "Deploys"
    },
    {
      "name": "Check-ins"
    },
    {
      "name": "Saved Visuals"
    },
    {
      "name": "System"
    }
  ]
}