mirror of
https://github.com/hyperdxio/hyperdx
synced 2026-04-21 13:37:15 +00:00
Closes HDX-3450 # Summary This PR adds a list webhooks endpoint to the external API, to better support alert creation via the API (which requires a webhook ID). <img width="2275" height="1048" alt="Screenshot 2026-02-25 at 11 54 54 AM" src="https://github.com/user-attachments/assets/a9a4f1cb-d3e9-4d18-bb9c-6647b784adf9" /> <img width="1463" height="1057" alt="Screenshot 2026-02-25 at 11 55 45 AM" src="https://github.com/user-attachments/assets/b7864e67-b8d0-4f71-aedf-04d2d13e27f1" />
3832 lines
No EOL
115 KiB
JSON
3832 lines
No EOL
115 KiB
JSON
{
|
|
"openapi": "3.0.0",
|
|
"info": {
|
|
"title": "HyperDX External API",
|
|
"description": "API for managing HyperDX alerts and dashboards",
|
|
"version": "2.0.0"
|
|
},
|
|
"servers": [
|
|
{
|
|
"url": "/",
|
|
"description": "Your HyperDX instance (http://<host>:<port>)"
|
|
}
|
|
],
|
|
"tags": [
|
|
{
|
|
"name": "Dashboards",
|
|
"description": "Endpoints for managing dashboards and their visualizations"
|
|
},
|
|
{
|
|
"name": "Alerts",
|
|
"description": "Endpoints for managing monitoring alerts"
|
|
}
|
|
],
|
|
"components": {
|
|
"securitySchemes": {
|
|
"BearerAuth": {
|
|
"type": "http",
|
|
"scheme": "bearer",
|
|
"bearerFormat": "API Key"
|
|
}
|
|
},
|
|
"schemas": {
|
|
"Error": {
|
|
"type": "object",
|
|
"properties": {
|
|
"message": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"AlertInterval": {
|
|
"type": "string",
|
|
"enum": [
|
|
"1m",
|
|
"5m",
|
|
"15m",
|
|
"30m",
|
|
"1h",
|
|
"6h",
|
|
"12h",
|
|
"1d"
|
|
],
|
|
"description": "Evaluation interval."
|
|
},
|
|
"AlertThresholdType": {
|
|
"type": "string",
|
|
"enum": [
|
|
"above",
|
|
"below"
|
|
],
|
|
"description": "Threshold comparison direction."
|
|
},
|
|
"AlertSource": {
|
|
"type": "string",
|
|
"enum": [
|
|
"saved_search",
|
|
"tile"
|
|
],
|
|
"description": "Alert source type."
|
|
},
|
|
"AlertState": {
|
|
"type": "string",
|
|
"enum": [
|
|
"ALERT",
|
|
"OK",
|
|
"INSUFFICIENT_DATA",
|
|
"DISABLED"
|
|
],
|
|
"description": "Current alert state."
|
|
},
|
|
"AlertChannelType": {
|
|
"type": "string",
|
|
"enum": [
|
|
"webhook"
|
|
],
|
|
"description": "Channel type."
|
|
},
|
|
"AlertSilenced": {
|
|
"type": "object",
|
|
"description": "Silencing metadata.",
|
|
"properties": {
|
|
"by": {
|
|
"type": "string",
|
|
"description": "User ID who silenced the alert.",
|
|
"nullable": true
|
|
},
|
|
"at": {
|
|
"type": "string",
|
|
"description": "Silence start timestamp.",
|
|
"format": "date-time"
|
|
},
|
|
"until": {
|
|
"type": "string",
|
|
"description": "Silence end timestamp.",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
},
|
|
"AlertChannelWebhook": {
|
|
"type": "object",
|
|
"required": [
|
|
"type",
|
|
"webhookId"
|
|
],
|
|
"properties": {
|
|
"type": {
|
|
"$ref": "#/components/schemas/AlertChannelType"
|
|
},
|
|
"webhookId": {
|
|
"type": "string",
|
|
"description": "Webhook destination ID.",
|
|
"example": "65f5e4a3b9e77c001a789012"
|
|
}
|
|
}
|
|
},
|
|
"AlertChannel": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/components/schemas/AlertChannelWebhook"
|
|
}
|
|
],
|
|
"discriminator": {
|
|
"propertyName": "type"
|
|
}
|
|
},
|
|
"Alert": {
|
|
"type": "object",
|
|
"properties": {
|
|
"dashboardId": {
|
|
"type": "string",
|
|
"description": "Dashboard ID for tile-based alerts.",
|
|
"nullable": true,
|
|
"example": "65f5e4a3b9e77c001a567890"
|
|
},
|
|
"tileId": {
|
|
"type": "string",
|
|
"description": "Tile ID for tile-based alerts.",
|
|
"nullable": true,
|
|
"example": "65f5e4a3b9e77c001a901234"
|
|
},
|
|
"savedSearchId": {
|
|
"type": "string",
|
|
"description": "Saved search ID for saved_search alerts.",
|
|
"nullable": true,
|
|
"example": "65f5e4a3b9e77c001a345678"
|
|
},
|
|
"groupBy": {
|
|
"type": "string",
|
|
"description": "Group-by key for saved search alerts.",
|
|
"nullable": true,
|
|
"example": "ServiceName"
|
|
},
|
|
"threshold": {
|
|
"type": "number",
|
|
"description": "Threshold value for triggering the alert.",
|
|
"example": 100
|
|
},
|
|
"interval": {
|
|
"$ref": "#/components/schemas/AlertInterval",
|
|
"example": "1h"
|
|
},
|
|
"source": {
|
|
"$ref": "#/components/schemas/AlertSource",
|
|
"example": "tile"
|
|
},
|
|
"thresholdType": {
|
|
"$ref": "#/components/schemas/AlertThresholdType",
|
|
"example": "above"
|
|
},
|
|
"channel": {
|
|
"$ref": "#/components/schemas/AlertChannel",
|
|
"description": "Alert notification channel configuration."
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"description": "Human-friendly alert name.",
|
|
"nullable": true,
|
|
"example": "Test Alert"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"description": "Alert message template.",
|
|
"nullable": true,
|
|
"example": "Test Alert Message"
|
|
}
|
|
}
|
|
},
|
|
"AlertResponse": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/Alert"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"description": "Unique alert identifier.",
|
|
"example": "65f5e4a3b9e77c001a123456"
|
|
},
|
|
"state": {
|
|
"$ref": "#/components/schemas/AlertState",
|
|
"example": "ALERT"
|
|
},
|
|
"teamId": {
|
|
"type": "string",
|
|
"description": "Team identifier.",
|
|
"example": "65f5e4a3b9e77c001a345678"
|
|
},
|
|
"silenced": {
|
|
"$ref": "#/components/schemas/AlertSilenced",
|
|
"description": "Silencing metadata.",
|
|
"nullable": true
|
|
},
|
|
"createdAt": {
|
|
"type": "string",
|
|
"nullable": true,
|
|
"format": "date-time",
|
|
"description": "Creation timestamp.",
|
|
"example": "2023-01-01T00:00:00.000Z"
|
|
},
|
|
"updatedAt": {
|
|
"type": "string",
|
|
"nullable": true,
|
|
"format": "date-time",
|
|
"description": "Last update timestamp.",
|
|
"example": "2023-01-01T00:00:00.000Z"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"CreateAlertRequest": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/Alert"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"required": [
|
|
"threshold",
|
|
"interval",
|
|
"thresholdType",
|
|
"channel"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"UpdateAlertRequest": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/Alert"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"required": [
|
|
"threshold",
|
|
"interval",
|
|
"thresholdType",
|
|
"channel"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"AlertResponseEnvelope": {
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/components/schemas/AlertResponse"
|
|
}
|
|
}
|
|
},
|
|
"AlertsListResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/AlertResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"EmptyResponse": {
|
|
"type": "object",
|
|
"properties": {}
|
|
},
|
|
"ChartSeries": {
|
|
"type": "object",
|
|
"required": [
|
|
"sourceId",
|
|
"aggFn",
|
|
"where",
|
|
"groupBy"
|
|
],
|
|
"properties": {
|
|
"sourceId": {
|
|
"type": "string",
|
|
"description": "ID of the data source for this series",
|
|
"example": "65f5e4a3b9e77c001a123456"
|
|
},
|
|
"aggFn": {
|
|
"type": "string",
|
|
"description": "Aggregation function to use on the data",
|
|
"enum": [
|
|
"avg",
|
|
"count",
|
|
"count_distinct",
|
|
"last_value",
|
|
"max",
|
|
"min",
|
|
"quantile",
|
|
"sum"
|
|
],
|
|
"example": "count"
|
|
},
|
|
"field": {
|
|
"type": "string",
|
|
"description": "Field to aggregate",
|
|
"example": "duration"
|
|
},
|
|
"where": {
|
|
"type": "string",
|
|
"description": "Filter condition in Lucene query syntax",
|
|
"example": "service:api AND level:error"
|
|
},
|
|
"whereLanguage": {
|
|
"type": "string",
|
|
"description": "Query language used in the where clause",
|
|
"enum": [
|
|
"lucene",
|
|
"sql"
|
|
],
|
|
"example": "lucene"
|
|
},
|
|
"groupBy": {
|
|
"type": "array",
|
|
"description": "Fields to group the results by",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"example": [
|
|
"service",
|
|
"host"
|
|
]
|
|
},
|
|
"metricName": {
|
|
"type": "string",
|
|
"description": "Name of the metric (for metric data sources)",
|
|
"example": "http_requests_total"
|
|
},
|
|
"metricDataType": {
|
|
"type": "string",
|
|
"description": "Type of metric data",
|
|
"enum": [
|
|
"sum",
|
|
"gauge",
|
|
"histogram"
|
|
],
|
|
"example": "gauge"
|
|
}
|
|
}
|
|
},
|
|
"SeriesQueryRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"series",
|
|
"startTime",
|
|
"endTime"
|
|
],
|
|
"properties": {
|
|
"series": {
|
|
"type": "array",
|
|
"description": "Array of series configurations",
|
|
"items": {
|
|
"$ref": "#/components/schemas/ChartSeries"
|
|
},
|
|
"minItems": 1,
|
|
"maxItems": 5
|
|
},
|
|
"startTime": {
|
|
"type": "number",
|
|
"description": "Start timestamp in milliseconds",
|
|
"example": 1647014400000
|
|
},
|
|
"endTime": {
|
|
"type": "number",
|
|
"description": "End timestamp in milliseconds",
|
|
"example": 1647100800000
|
|
},
|
|
"granularity": {
|
|
"type": "string",
|
|
"description": "Time bucket size for aggregations",
|
|
"enum": [
|
|
"30s",
|
|
"1m",
|
|
"5m",
|
|
"10m",
|
|
"15m",
|
|
"30m",
|
|
"1h",
|
|
"2h",
|
|
"6h",
|
|
"12h",
|
|
"1d",
|
|
"2d",
|
|
"7d",
|
|
"30d",
|
|
"auto"
|
|
],
|
|
"example": "1h"
|
|
},
|
|
"seriesReturnType": {
|
|
"type": "string",
|
|
"description": "Format of the returned data",
|
|
"enum": [
|
|
"ratio",
|
|
"column"
|
|
],
|
|
"example": "column"
|
|
}
|
|
}
|
|
},
|
|
"SeriesDataPoint": {
|
|
"type": "object",
|
|
"properties": {
|
|
"ts_bucket": {
|
|
"type": "number",
|
|
"description": "Timestamp of the data point (bucket start time)",
|
|
"example": 1647014400000
|
|
},
|
|
"series_0.data": {
|
|
"type": "number",
|
|
"description": "Value for the first series",
|
|
"example": 42
|
|
},
|
|
"series_1.data": {
|
|
"type": "number",
|
|
"description": "Value for the second series",
|
|
"example": 18
|
|
},
|
|
"group": {
|
|
"type": "array",
|
|
"description": "Group by values if groupBy was specified",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"example": [
|
|
"api",
|
|
"prod-host-1"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"SeriesResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/SeriesDataPoint"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"NumberFormatOutput": {
|
|
"type": "string",
|
|
"enum": [
|
|
"currency",
|
|
"percent",
|
|
"byte",
|
|
"time",
|
|
"number"
|
|
],
|
|
"description": "Output format type (currency, percent, byte, time, number)."
|
|
},
|
|
"AggregationFunction": {
|
|
"type": "string",
|
|
"enum": [
|
|
"avg",
|
|
"count",
|
|
"count_distinct",
|
|
"last_value",
|
|
"max",
|
|
"min",
|
|
"quantile",
|
|
"sum",
|
|
"any",
|
|
"none"
|
|
],
|
|
"description": "Aggregation function to apply to the field or metric value."
|
|
},
|
|
"QueryLanguage": {
|
|
"type": "string",
|
|
"enum": [
|
|
"sql",
|
|
"lucene"
|
|
],
|
|
"description": "Query language for the where clause."
|
|
},
|
|
"MetricDataType": {
|
|
"type": "string",
|
|
"enum": [
|
|
"sum",
|
|
"gauge",
|
|
"histogram",
|
|
"summary",
|
|
"exponential histogram"
|
|
],
|
|
"description": "Metric data type for metrics data sources."
|
|
},
|
|
"TimeSeriesDisplayType": {
|
|
"type": "string",
|
|
"enum": [
|
|
"stacked_bar",
|
|
"line"
|
|
],
|
|
"description": "Visual representation type for the time series."
|
|
},
|
|
"QuantileLevel": {
|
|
"type": "number",
|
|
"enum": [
|
|
0.5,
|
|
0.9,
|
|
0.95,
|
|
0.99
|
|
],
|
|
"description": "Percentile level; only valid when aggFn is \"quantile\"."
|
|
},
|
|
"SortOrder": {
|
|
"type": "string",
|
|
"enum": [
|
|
"desc",
|
|
"asc"
|
|
],
|
|
"description": "Sort order for table rows."
|
|
},
|
|
"NumberFormat": {
|
|
"type": "object",
|
|
"properties": {
|
|
"output": {
|
|
"$ref": "#/components/schemas/NumberFormatOutput",
|
|
"example": "number"
|
|
},
|
|
"mantissa": {
|
|
"type": "integer",
|
|
"description": "Number of decimal places.",
|
|
"example": 2
|
|
},
|
|
"thousandSeparated": {
|
|
"type": "boolean",
|
|
"description": "Whether to use thousand separators.",
|
|
"example": true
|
|
},
|
|
"average": {
|
|
"type": "boolean",
|
|
"description": "Whether to show as average.",
|
|
"example": false
|
|
},
|
|
"decimalBytes": {
|
|
"type": "boolean",
|
|
"description": "Use decimal bytes (1000) vs binary bytes (1024).",
|
|
"example": false
|
|
},
|
|
"factor": {
|
|
"type": "number",
|
|
"description": "Multiplication factor.",
|
|
"example": 1
|
|
},
|
|
"currencySymbol": {
|
|
"type": "string",
|
|
"description": "Currency symbol for currency format.",
|
|
"example": "$"
|
|
},
|
|
"unit": {
|
|
"type": "string",
|
|
"description": "Custom unit label.",
|
|
"example": "ms"
|
|
}
|
|
}
|
|
},
|
|
"TimeChartSeries": {
|
|
"type": "object",
|
|
"required": [
|
|
"type",
|
|
"sourceId",
|
|
"aggFn",
|
|
"where",
|
|
"whereLanguage",
|
|
"groupBy"
|
|
],
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"time"
|
|
],
|
|
"example": "time"
|
|
},
|
|
"sourceId": {
|
|
"type": "string",
|
|
"description": "ID of the data source to query",
|
|
"example": "65f5e4a3b9e77c001a567890"
|
|
},
|
|
"aggFn": {
|
|
"$ref": "#/components/schemas/AggregationFunction",
|
|
"description": "Aggregation function to apply to the field or metric value",
|
|
"example": "count"
|
|
},
|
|
"level": {
|
|
"type": "number",
|
|
"minimum": 0,
|
|
"maximum": 1,
|
|
"description": "Percentile level for quantile aggregations (e.g., 0.95 for p95)",
|
|
"example": 0.95
|
|
},
|
|
"field": {
|
|
"type": "string",
|
|
"description": "Field/property name to aggregate (required for most aggregation functions except count)",
|
|
"example": "duration"
|
|
},
|
|
"alias": {
|
|
"type": "string",
|
|
"description": "Display name for the series in the chart",
|
|
"example": "Request Duration"
|
|
},
|
|
"where": {
|
|
"type": "string",
|
|
"description": "Filter query for the data (syntax depends on whereLanguage)",
|
|
"example": "service:api"
|
|
},
|
|
"whereLanguage": {
|
|
"$ref": "#/components/schemas/QueryLanguage",
|
|
"description": "Query language for the where clause",
|
|
"example": "lucene"
|
|
},
|
|
"groupBy": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"maxItems": 10,
|
|
"description": "Fields to group results by (creates separate series for each group)",
|
|
"example": [
|
|
"host"
|
|
]
|
|
},
|
|
"numberFormat": {
|
|
"$ref": "#/components/schemas/NumberFormat"
|
|
},
|
|
"metricDataType": {
|
|
"$ref": "#/components/schemas/MetricDataType",
|
|
"example": "sum"
|
|
},
|
|
"metricName": {
|
|
"type": "string",
|
|
"description": "Metric name for metrics data sources",
|
|
"example": "http.server.duration"
|
|
},
|
|
"displayType": {
|
|
"$ref": "#/components/schemas/TimeSeriesDisplayType",
|
|
"description": "Visual representation type for the time series",
|
|
"example": "line"
|
|
}
|
|
}
|
|
},
|
|
"TableChartSeries": {
|
|
"type": "object",
|
|
"required": [
|
|
"type",
|
|
"sourceId",
|
|
"aggFn",
|
|
"where",
|
|
"whereLanguage",
|
|
"groupBy"
|
|
],
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"table"
|
|
],
|
|
"example": "table"
|
|
},
|
|
"sourceId": {
|
|
"type": "string",
|
|
"description": "ID of the data source to query",
|
|
"example": "65f5e4a3b9e77c001a567890"
|
|
},
|
|
"aggFn": {
|
|
"$ref": "#/components/schemas/AggregationFunction",
|
|
"description": "Aggregation function to apply to the field or metric value",
|
|
"example": "count"
|
|
},
|
|
"level": {
|
|
"type": "number",
|
|
"minimum": 0,
|
|
"maximum": 1,
|
|
"description": "Percentile level for quantile aggregations (e.g., 0.95 for p95)",
|
|
"example": 0.95
|
|
},
|
|
"field": {
|
|
"type": "string",
|
|
"example": "duration"
|
|
},
|
|
"alias": {
|
|
"type": "string",
|
|
"example": "Total Count"
|
|
},
|
|
"where": {
|
|
"type": "string",
|
|
"example": "level:error"
|
|
},
|
|
"whereLanguage": {
|
|
"$ref": "#/components/schemas/QueryLanguage",
|
|
"example": "lucene"
|
|
},
|
|
"groupBy": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"maxItems": 10,
|
|
"example": [
|
|
"errorType"
|
|
]
|
|
},
|
|
"sortOrder": {
|
|
"$ref": "#/components/schemas/SortOrder",
|
|
"description": "Sort order for table rows",
|
|
"example": "desc"
|
|
},
|
|
"numberFormat": {
|
|
"$ref": "#/components/schemas/NumberFormat"
|
|
},
|
|
"metricDataType": {
|
|
"$ref": "#/components/schemas/MetricDataType",
|
|
"description": "Metric data type for metrics data sources",
|
|
"example": "sum"
|
|
},
|
|
"metricName": {
|
|
"type": "string",
|
|
"description": "Metric name for metrics data sources",
|
|
"example": "http.server.duration"
|
|
}
|
|
}
|
|
},
|
|
"NumberChartSeries": {
|
|
"type": "object",
|
|
"required": [
|
|
"type",
|
|
"sourceId",
|
|
"aggFn",
|
|
"where",
|
|
"whereLanguage"
|
|
],
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"number"
|
|
],
|
|
"example": "number"
|
|
},
|
|
"sourceId": {
|
|
"type": "string",
|
|
"description": "ID of the data source to query",
|
|
"example": "65f5e4a3b9e77c001a567890"
|
|
},
|
|
"aggFn": {
|
|
"$ref": "#/components/schemas/AggregationFunction",
|
|
"description": "Aggregation function to apply to the field or metric value",
|
|
"example": "count"
|
|
},
|
|
"level": {
|
|
"type": "number",
|
|
"minimum": 0,
|
|
"maximum": 1,
|
|
"description": "Percentile level for quantile aggregations (e.g., 0.95 for p95)",
|
|
"example": 0.95
|
|
},
|
|
"field": {
|
|
"type": "string",
|
|
"example": "duration"
|
|
},
|
|
"alias": {
|
|
"type": "string",
|
|
"example": "Total Requests"
|
|
},
|
|
"where": {
|
|
"type": "string",
|
|
"example": "service:api"
|
|
},
|
|
"whereLanguage": {
|
|
"$ref": "#/components/schemas/QueryLanguage",
|
|
"example": "lucene"
|
|
},
|
|
"numberFormat": {
|
|
"$ref": "#/components/schemas/NumberFormat"
|
|
},
|
|
"metricDataType": {
|
|
"$ref": "#/components/schemas/MetricDataType",
|
|
"example": "sum"
|
|
},
|
|
"metricName": {
|
|
"type": "string",
|
|
"example": "http.server.duration"
|
|
}
|
|
}
|
|
},
|
|
"SearchChartSeries": {
|
|
"type": "object",
|
|
"required": [
|
|
"type",
|
|
"sourceId",
|
|
"fields",
|
|
"where",
|
|
"whereLanguage"
|
|
],
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"search"
|
|
],
|
|
"example": "search"
|
|
},
|
|
"sourceId": {
|
|
"type": "string",
|
|
"description": "ID of the data source to query",
|
|
"example": "65f5e4a3b9e77c001a567890"
|
|
},
|
|
"fields": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"description": "List of field names to display in the search results table",
|
|
"example": [
|
|
"timestamp",
|
|
"level",
|
|
"message"
|
|
]
|
|
},
|
|
"where": {
|
|
"type": "string",
|
|
"description": "Filter query for the data (syntax depends on whereLanguage)",
|
|
"example": "level:error"
|
|
},
|
|
"whereLanguage": {
|
|
"$ref": "#/components/schemas/QueryLanguage",
|
|
"description": "Query language for the where clause",
|
|
"example": "lucene"
|
|
}
|
|
}
|
|
},
|
|
"MarkdownChartSeries": {
|
|
"type": "object",
|
|
"required": [
|
|
"type",
|
|
"content"
|
|
],
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"markdown"
|
|
],
|
|
"example": "markdown"
|
|
},
|
|
"content": {
|
|
"type": "string",
|
|
"example": "# Dashboard Title\n\nThis is a markdown widget.",
|
|
"maxLength": 100000
|
|
}
|
|
}
|
|
},
|
|
"DashboardChartSeries": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/components/schemas/TimeChartSeries"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/TableChartSeries"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/NumberChartSeries"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/SearchChartSeries"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/MarkdownChartSeries"
|
|
}
|
|
],
|
|
"discriminator": {
|
|
"propertyName": "type",
|
|
"mapping": {
|
|
"time": "#/components/schemas/TimeChartSeries",
|
|
"table": "#/components/schemas/TableChartSeries",
|
|
"number": "#/components/schemas/NumberChartSeries",
|
|
"search": "#/components/schemas/SearchChartSeries",
|
|
"markdown": "#/components/schemas/MarkdownChartSeries"
|
|
}
|
|
}
|
|
},
|
|
"SelectItem": {
|
|
"type": "object",
|
|
"required": [
|
|
"aggFn"
|
|
],
|
|
"description": "A single aggregated value to compute. The valueExpression must be omitted when aggFn is \"count\", and required for all other functions. The level field may only be used with aggFn \"quantile\".\n",
|
|
"properties": {
|
|
"aggFn": {
|
|
"$ref": "#/components/schemas/AggregationFunction",
|
|
"description": "Aggregation function to apply. \"count\" does not require a valueExpression; \"quantile\" requires a level field indicating the desired percentile (e.g., 0.95).\n",
|
|
"example": "count"
|
|
},
|
|
"valueExpression": {
|
|
"type": "string",
|
|
"maxLength": 10000,
|
|
"description": "Expression for the column or value to aggregate. Must be omitted when aggFn is \"count\"; required for all other aggFn values.\n",
|
|
"example": "Duration"
|
|
},
|
|
"alias": {
|
|
"type": "string",
|
|
"maxLength": 10000,
|
|
"description": "Display alias for this select item in chart legends.",
|
|
"example": "Request Duration"
|
|
},
|
|
"level": {
|
|
"$ref": "#/components/schemas/QuantileLevel"
|
|
},
|
|
"where": {
|
|
"type": "string",
|
|
"maxLength": 10000,
|
|
"description": "SQL or Lucene filter condition applied before aggregation.",
|
|
"default": "",
|
|
"example": "service:api"
|
|
},
|
|
"whereLanguage": {
|
|
"$ref": "#/components/schemas/QueryLanguage"
|
|
},
|
|
"metricName": {
|
|
"type": "string",
|
|
"description": "Name of the metric to aggregate; only applicable when the source is a metrics source."
|
|
},
|
|
"metricType": {
|
|
"$ref": "#/components/schemas/MetricDataType",
|
|
"description": "Metric type; only applicable when the source is a metrics source."
|
|
},
|
|
"periodAggFn": {
|
|
"type": "string",
|
|
"enum": [
|
|
"delta"
|
|
],
|
|
"description": "Optional period aggregation function for Gauge metrics (e.g., compute the delta over the period)."
|
|
}
|
|
}
|
|
},
|
|
"LineChartConfig": {
|
|
"type": "object",
|
|
"required": [
|
|
"displayType",
|
|
"sourceId",
|
|
"select"
|
|
],
|
|
"description": "Configuration for a line time-series chart.",
|
|
"properties": {
|
|
"displayType": {
|
|
"type": "string",
|
|
"enum": [
|
|
"line"
|
|
],
|
|
"example": "line"
|
|
},
|
|
"sourceId": {
|
|
"type": "string",
|
|
"description": "ID of the data source to query.",
|
|
"example": "65f5e4a3b9e77c001a111111"
|
|
},
|
|
"select": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"maxItems": 20,
|
|
"description": "One or more aggregated values to plot. When asRatio is true, exactly two select items are required.\n",
|
|
"items": {
|
|
"$ref": "#/components/schemas/SelectItem"
|
|
}
|
|
},
|
|
"groupBy": {
|
|
"type": "string",
|
|
"description": "Field expression to group results by (creates separate lines per group value).",
|
|
"example": "host",
|
|
"maxLength": 10000
|
|
},
|
|
"asRatio": {
|
|
"type": "boolean",
|
|
"description": "Plot select[0] / select[1] as a ratio. Requires exactly two select items.",
|
|
"default": false
|
|
},
|
|
"alignDateRangeToGranularity": {
|
|
"type": "boolean",
|
|
"description": "Expand date range boundaries to the query granularity interval.",
|
|
"default": true
|
|
},
|
|
"fillNulls": {
|
|
"type": "boolean",
|
|
"description": "Fill missing time buckets with zero instead of leaving gaps.",
|
|
"default": true
|
|
},
|
|
"numberFormat": {
|
|
"$ref": "#/components/schemas/NumberFormat"
|
|
},
|
|
"compareToPreviousPeriod": {
|
|
"type": "boolean",
|
|
"description": "Overlay the equivalent previous time period for comparison.",
|
|
"default": false
|
|
}
|
|
}
|
|
},
|
|
"BarChartConfig": {
|
|
"type": "object",
|
|
"required": [
|
|
"displayType",
|
|
"sourceId",
|
|
"select"
|
|
],
|
|
"description": "Configuration for a stacked-bar time-series chart.",
|
|
"properties": {
|
|
"displayType": {
|
|
"type": "string",
|
|
"enum": [
|
|
"stacked_bar"
|
|
],
|
|
"example": "stacked_bar"
|
|
},
|
|
"sourceId": {
|
|
"type": "string",
|
|
"description": "ID of the data source to query.",
|
|
"example": "65f5e4a3b9e77c001a111111"
|
|
},
|
|
"select": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"maxItems": 20,
|
|
"description": "One or more aggregated values to plot. When asRatio is true, exactly two select items are required.\n",
|
|
"items": {
|
|
"$ref": "#/components/schemas/SelectItem"
|
|
}
|
|
},
|
|
"groupBy": {
|
|
"type": "string",
|
|
"description": "Field expression to group results by (creates separate bars segments per group value).",
|
|
"example": "service",
|
|
"maxLength": 10000
|
|
},
|
|
"asRatio": {
|
|
"type": "boolean",
|
|
"description": "Plot select[0] / select[1] as a ratio. Requires exactly two select items.",
|
|
"default": false
|
|
},
|
|
"alignDateRangeToGranularity": {
|
|
"type": "boolean",
|
|
"description": "Align the date range boundaries to the query granularity interval.",
|
|
"default": true
|
|
},
|
|
"fillNulls": {
|
|
"type": "boolean",
|
|
"description": "Fill missing time buckets with zero instead of leaving gaps.",
|
|
"default": true
|
|
},
|
|
"numberFormat": {
|
|
"$ref": "#/components/schemas/NumberFormat"
|
|
}
|
|
}
|
|
},
|
|
"TableChartConfig": {
|
|
"type": "object",
|
|
"required": [
|
|
"displayType",
|
|
"sourceId",
|
|
"select"
|
|
],
|
|
"description": "Configuration for a table aggregation chart.",
|
|
"properties": {
|
|
"displayType": {
|
|
"type": "string",
|
|
"enum": [
|
|
"table"
|
|
],
|
|
"example": "table"
|
|
},
|
|
"sourceId": {
|
|
"type": "string",
|
|
"description": "ID of the data source to query.",
|
|
"example": "65f5e4a3b9e77c001a111111"
|
|
},
|
|
"select": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"maxItems": 20,
|
|
"description": "One or more aggregated values to display as table columns. When asRatio is true, exactly two select items are required.\n",
|
|
"items": {
|
|
"$ref": "#/components/schemas/SelectItem"
|
|
}
|
|
},
|
|
"groupBy": {
|
|
"type": "string",
|
|
"maxLength": 10000,
|
|
"description": "Field expression to group results by (one row per group value).",
|
|
"example": "service"
|
|
},
|
|
"having": {
|
|
"type": "string",
|
|
"maxLength": 10000,
|
|
"description": "Post-aggregation SQL HAVING condition.",
|
|
"example": "count > 100"
|
|
},
|
|
"orderBy": {
|
|
"type": "string",
|
|
"maxLength": 10000,
|
|
"description": "SQL ORDER BY expression for sorting table rows.",
|
|
"example": "count DESC"
|
|
},
|
|
"asRatio": {
|
|
"type": "boolean",
|
|
"description": "Display select[0] / select[1] as a ratio. Requires exactly two select items.",
|
|
"example": false
|
|
},
|
|
"numberFormat": {
|
|
"$ref": "#/components/schemas/NumberFormat"
|
|
}
|
|
}
|
|
},
|
|
"NumberChartConfig": {
|
|
"type": "object",
|
|
"required": [
|
|
"displayType",
|
|
"sourceId",
|
|
"select"
|
|
],
|
|
"description": "Configuration for a single big-number chart.",
|
|
"properties": {
|
|
"displayType": {
|
|
"type": "string",
|
|
"enum": [
|
|
"number"
|
|
],
|
|
"example": "number"
|
|
},
|
|
"sourceId": {
|
|
"type": "string",
|
|
"description": "ID of the data source to query.",
|
|
"example": "65f5e4a3b9e77c001a111111"
|
|
},
|
|
"select": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"maxItems": 1,
|
|
"description": "Exactly one aggregated value to display as a single number.",
|
|
"items": {
|
|
"$ref": "#/components/schemas/SelectItem"
|
|
}
|
|
},
|
|
"numberFormat": {
|
|
"$ref": "#/components/schemas/NumberFormat"
|
|
}
|
|
}
|
|
},
|
|
"PieChartConfig": {
|
|
"type": "object",
|
|
"required": [
|
|
"displayType",
|
|
"sourceId",
|
|
"select"
|
|
],
|
|
"description": "Configuration for a pie chart tile. Each slice represents one group value.",
|
|
"properties": {
|
|
"displayType": {
|
|
"type": "string",
|
|
"enum": [
|
|
"pie"
|
|
],
|
|
"example": "pie"
|
|
},
|
|
"sourceId": {
|
|
"type": "string",
|
|
"description": "ID of the data source to query.",
|
|
"example": "65f5e4a3b9e77c001a111111"
|
|
},
|
|
"select": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"maxItems": 1,
|
|
"description": "Exactly one aggregated value used to size each pie slice.",
|
|
"items": {
|
|
"$ref": "#/components/schemas/SelectItem"
|
|
}
|
|
},
|
|
"groupBy": {
|
|
"type": "string",
|
|
"maxLength": 10000,
|
|
"description": "Field expression to group results by (one slice per group value).",
|
|
"example": "service"
|
|
},
|
|
"numberFormat": {
|
|
"$ref": "#/components/schemas/NumberFormat"
|
|
}
|
|
}
|
|
},
|
|
"SearchChartConfig": {
|
|
"type": "object",
|
|
"required": [
|
|
"displayType",
|
|
"sourceId",
|
|
"select",
|
|
"whereLanguage"
|
|
],
|
|
"description": "Configuration for a raw-event search / log viewer tile.",
|
|
"properties": {
|
|
"displayType": {
|
|
"type": "string",
|
|
"enum": [
|
|
"search"
|
|
],
|
|
"example": "search"
|
|
},
|
|
"sourceId": {
|
|
"type": "string",
|
|
"description": "ID of the data source to query.",
|
|
"example": "65f5e4a3b9e77c001a111111"
|
|
},
|
|
"select": {
|
|
"type": "string",
|
|
"maxLength": 10000,
|
|
"description": "Comma-separated list of expressions to display.",
|
|
"example": "timestamp, level, message"
|
|
},
|
|
"where": {
|
|
"type": "string",
|
|
"maxLength": 10000,
|
|
"description": "Filter condition for the search (syntax depends on whereLanguage).",
|
|
"default": "",
|
|
"example": "level:error"
|
|
},
|
|
"whereLanguage": {
|
|
"$ref": "#/components/schemas/QueryLanguage"
|
|
}
|
|
}
|
|
},
|
|
"MarkdownChartConfig": {
|
|
"type": "object",
|
|
"required": [
|
|
"displayType"
|
|
],
|
|
"description": "Configuration for a freeform Markdown text tile.",
|
|
"properties": {
|
|
"displayType": {
|
|
"type": "string",
|
|
"enum": [
|
|
"markdown"
|
|
],
|
|
"example": "markdown"
|
|
},
|
|
"markdown": {
|
|
"type": "string",
|
|
"maxLength": 50000,
|
|
"description": "Markdown content to render inside the tile.",
|
|
"example": "# Dashboard Title\n\nThis is a markdown widget."
|
|
}
|
|
}
|
|
},
|
|
"TileConfig": {
|
|
"description": "Tile chart configuration. The displayType field determines which variant is used.\n",
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/components/schemas/LineChartConfig"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/BarChartConfig"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/TableChartConfig"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/NumberChartConfig"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/PieChartConfig"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/SearchChartConfig"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/MarkdownChartConfig"
|
|
}
|
|
],
|
|
"discriminator": {
|
|
"propertyName": "displayType",
|
|
"mapping": {
|
|
"line": "#/components/schemas/LineChartConfig",
|
|
"stacked_bar": "#/components/schemas/BarChartConfig",
|
|
"table": "#/components/schemas/TableChartConfig",
|
|
"number": "#/components/schemas/NumberChartConfig",
|
|
"pie": "#/components/schemas/PieChartConfig",
|
|
"search": "#/components/schemas/SearchChartConfig",
|
|
"markdown": "#/components/schemas/MarkdownChartConfig"
|
|
}
|
|
}
|
|
},
|
|
"TileBase": {
|
|
"type": "object",
|
|
"description": "Common fields shared by tile input and output",
|
|
"required": [
|
|
"name",
|
|
"x",
|
|
"y",
|
|
"w",
|
|
"h"
|
|
],
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"description": "Display name for the tile",
|
|
"example": "Error Rate"
|
|
},
|
|
"x": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 23,
|
|
"description": "Horizontal position in the grid (0-based)",
|
|
"example": 0
|
|
},
|
|
"y": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"description": "Vertical position in the grid (0-based)",
|
|
"example": 0
|
|
},
|
|
"w": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 24,
|
|
"description": "Width in grid units",
|
|
"example": 6
|
|
},
|
|
"h": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"description": "Height in grid units",
|
|
"example": 3
|
|
},
|
|
"config": {
|
|
"$ref": "#/components/schemas/TileConfig",
|
|
"description": "Chart configuration for the tile. The displayType field determines which variant is used. Replaces the deprecated \"series\" and \"asRatio\" fields."
|
|
}
|
|
}
|
|
},
|
|
"TileOutput": {
|
|
"description": "Response format for dashboard tiles",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/TileBase"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"required": [
|
|
"id"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"maxLength": 36,
|
|
"example": "65f5e4a3b9e77c001a901234"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"TileInput": {
|
|
"description": "Input / request format when creating or updating tiles. The id field is optional: on create it is ignored (the server always assigns a new ID); on update, a matching id is used to identify the existing tile to preserve — tiles whose id does not match an existing tile are assigned a new generated ID.\n",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/TileBase"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"maxLength": 36,
|
|
"description": "Optional tile ID. Omit to generate a new ID.",
|
|
"example": "65f5e4a3b9e77c001a901234"
|
|
},
|
|
"asRatio": {
|
|
"type": "boolean",
|
|
"description": "Display two series as a ratio (series[0] / series[1]). Only applicable when providing \"series\". Deprecated in favor of \"config.asRatio\".",
|
|
"example": false,
|
|
"deprecated": true
|
|
},
|
|
"series": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"description": "Data series to display in this tile (all must be the same type). Deprecated; use \"config\" instead.",
|
|
"deprecated": true,
|
|
"items": {
|
|
"$ref": "#/components/schemas/DashboardChartSeries"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"FilterInput": {
|
|
"type": "object",
|
|
"description": "Dashboard filter key that can be added to a dashboard",
|
|
"required": [
|
|
"type",
|
|
"name",
|
|
"expression",
|
|
"sourceId"
|
|
],
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"QUERY_EXPRESSION"
|
|
]
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"description": "Display name for the dashboard filter key"
|
|
},
|
|
"expression": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"description": "Key expression used when applying this dashboard filter key"
|
|
},
|
|
"sourceId": {
|
|
"type": "string",
|
|
"description": "Source ID this dashboard filter key applies to"
|
|
},
|
|
"sourceMetricType": {
|
|
"type": "string",
|
|
"enum": [
|
|
"sum",
|
|
"gauge",
|
|
"histogram",
|
|
"summary",
|
|
"exponential histogram"
|
|
],
|
|
"description": "Metric type when source is metrics"
|
|
}
|
|
}
|
|
},
|
|
"Filter": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/FilterInput"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"required": [
|
|
"id"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"description": "Unique dashboard filter key ID"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"Dashboard": {
|
|
"type": "object",
|
|
"description": "Dashboard with tiles and configuration",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"description": "Dashboard ID",
|
|
"example": "65f5e4a3b9e77c001a567890"
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"description": "Dashboard name",
|
|
"maxLength": 1024,
|
|
"example": "Service Overview"
|
|
},
|
|
"tiles": {
|
|
"type": "array",
|
|
"description": "List of tiles/charts in the dashboard",
|
|
"items": {
|
|
"$ref": "#/components/schemas/TileOutput"
|
|
}
|
|
},
|
|
"tags": {
|
|
"type": "array",
|
|
"description": "Tags for organizing and filtering dashboards",
|
|
"items": {
|
|
"type": "string",
|
|
"maxLength": 32
|
|
},
|
|
"maxItems": 50,
|
|
"example": [
|
|
"production",
|
|
"monitoring"
|
|
]
|
|
},
|
|
"filters": {
|
|
"type": "array",
|
|
"description": "Dashboard filter keys added to the dashboard and applied to all tiles",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Filter"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"CreateDashboardRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"name",
|
|
"tiles"
|
|
],
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"maxLength": 1024,
|
|
"example": "New Dashboard"
|
|
},
|
|
"tiles": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/TileInput"
|
|
}
|
|
},
|
|
"tags": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string",
|
|
"maxLength": 32
|
|
},
|
|
"maxItems": 50,
|
|
"example": [
|
|
"development"
|
|
]
|
|
},
|
|
"filters": {
|
|
"type": "array",
|
|
"description": "Dashboard filter keys to add to the dashboard and apply across all tiles",
|
|
"items": {
|
|
"$ref": "#/components/schemas/FilterInput"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"UpdateDashboardRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"name",
|
|
"tiles"
|
|
],
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"maxLength": 1024,
|
|
"example": "Updated Dashboard Name"
|
|
},
|
|
"tiles": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/TileInput"
|
|
},
|
|
"description": "Full list of tiles for the dashboard. Existing tiles are matched by ID; tiles with an ID that does not match an existing tile will be assigned a new generated ID."
|
|
},
|
|
"tags": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string",
|
|
"maxLength": 32
|
|
},
|
|
"maxItems": 50,
|
|
"example": [
|
|
"production",
|
|
"updated"
|
|
]
|
|
},
|
|
"filters": {
|
|
"type": "array",
|
|
"description": "Dashboard filter keys on the dashboard, applied across all tiles",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Filter"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"DashboardResponse": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/Dashboard"
|
|
}
|
|
]
|
|
},
|
|
"DashboardResponseEnvelope": {
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/components/schemas/DashboardResponse"
|
|
}
|
|
}
|
|
},
|
|
"DashboardsListResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/DashboardResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"QuerySetting": {
|
|
"type": "object",
|
|
"required": [
|
|
"setting",
|
|
"value"
|
|
],
|
|
"properties": {
|
|
"setting": {
|
|
"type": "string",
|
|
"description": "ClickHouse setting name"
|
|
},
|
|
"value": {
|
|
"type": "string",
|
|
"description": "Setting value"
|
|
}
|
|
}
|
|
},
|
|
"SourceFrom": {
|
|
"type": "object",
|
|
"required": [
|
|
"databaseName",
|
|
"tableName"
|
|
],
|
|
"properties": {
|
|
"databaseName": {
|
|
"type": "string",
|
|
"description": "ClickHouse database name"
|
|
},
|
|
"tableName": {
|
|
"type": "string",
|
|
"description": "ClickHouse table name"
|
|
}
|
|
}
|
|
},
|
|
"MetricSourceFrom": {
|
|
"type": "object",
|
|
"required": [
|
|
"databaseName"
|
|
],
|
|
"properties": {
|
|
"databaseName": {
|
|
"type": "string",
|
|
"description": "ClickHouse database name"
|
|
},
|
|
"tableName": {
|
|
"type": "string",
|
|
"description": "ClickHouse table name",
|
|
"nullable": true
|
|
}
|
|
}
|
|
},
|
|
"MetricTables": {
|
|
"type": "object",
|
|
"description": "Mapping of metric data types to table names. At least one must be specified.",
|
|
"properties": {
|
|
"gauge": {
|
|
"type": "string",
|
|
"description": "Table containing gauge metrics data"
|
|
},
|
|
"histogram": {
|
|
"type": "string",
|
|
"description": "Table containing histogram metrics data"
|
|
},
|
|
"sum": {
|
|
"type": "string",
|
|
"description": "Table containing sum metrics data"
|
|
},
|
|
"summary": {
|
|
"type": "string",
|
|
"description": "Table containing summary metrics data. Note - not yet fully supported by HyperDX"
|
|
},
|
|
"exponential histogram": {
|
|
"type": "string",
|
|
"description": "Table containing exponential histogram metrics data. Note - not yet fully supported by HyperDX"
|
|
}
|
|
}
|
|
},
|
|
"HighlightedAttributeExpression": {
|
|
"type": "object",
|
|
"required": [
|
|
"sqlExpression"
|
|
],
|
|
"properties": {
|
|
"sqlExpression": {
|
|
"type": "string",
|
|
"description": "SQL expression for the attribute"
|
|
},
|
|
"luceneExpression": {
|
|
"type": "string",
|
|
"description": "An optional, Lucene version of the sqlExpression expression. If provided, it is used when searching for this attribute value.",
|
|
"nullable": true
|
|
},
|
|
"alias": {
|
|
"type": "string",
|
|
"description": "Optional alias for the attribute",
|
|
"nullable": true
|
|
}
|
|
}
|
|
},
|
|
"AggregatedColumn": {
|
|
"type": "object",
|
|
"required": [
|
|
"mvColumn",
|
|
"aggFn"
|
|
],
|
|
"properties": {
|
|
"sourceColumn": {
|
|
"type": "string",
|
|
"description": "Source column name",
|
|
"nullable": true
|
|
},
|
|
"aggFn": {
|
|
"type": "string",
|
|
"description": "Aggregation function (e.g., count, sum, avg)"
|
|
},
|
|
"mvColumn": {
|
|
"type": "string",
|
|
"description": "Materialized view column name"
|
|
}
|
|
}
|
|
},
|
|
"MaterializedView": {
|
|
"type": "object",
|
|
"required": [
|
|
"databaseName",
|
|
"tableName",
|
|
"dimensionColumns",
|
|
"minGranularity",
|
|
"timestampColumn",
|
|
"aggregatedColumns"
|
|
],
|
|
"properties": {
|
|
"databaseName": {
|
|
"type": "string",
|
|
"description": "Database name for the materialized view"
|
|
},
|
|
"tableName": {
|
|
"type": "string",
|
|
"description": "Table name for the materialized view"
|
|
},
|
|
"dimensionColumns": {
|
|
"type": "string",
|
|
"description": "Columns which are not pre-aggregated in the materialized view and can be used for filtering and grouping."
|
|
},
|
|
"minGranularity": {
|
|
"type": "string",
|
|
"description": "The granularity of the timestamp column",
|
|
"enum": [
|
|
"1s",
|
|
"15s",
|
|
"30s",
|
|
"1m",
|
|
"5m",
|
|
"15m",
|
|
"30m",
|
|
"1h",
|
|
"2h",
|
|
"6h",
|
|
"12h",
|
|
"1d",
|
|
"2d",
|
|
"7d",
|
|
"30d"
|
|
]
|
|
},
|
|
"minDate": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "(Optional) The earliest date and time for which the materialized view contains data. If not provided, then HyperDX will assume that the materialized view contains data for all dates for which the source table contains data.",
|
|
"nullable": true
|
|
},
|
|
"timestampColumn": {
|
|
"type": "string",
|
|
"description": "Timestamp column name"
|
|
},
|
|
"aggregatedColumns": {
|
|
"type": "array",
|
|
"description": "Columns which are pre-aggregated by the materialized view",
|
|
"items": {
|
|
"$ref": "#/components/schemas/AggregatedColumn"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"SourceKind": {
|
|
"type": "string",
|
|
"enum": [
|
|
"log",
|
|
"trace",
|
|
"session",
|
|
"metric"
|
|
],
|
|
"description": "The type of data source."
|
|
},
|
|
"LogSource": {
|
|
"type": "object",
|
|
"required": [
|
|
"id",
|
|
"name",
|
|
"kind",
|
|
"connection",
|
|
"from",
|
|
"defaultTableSelectExpression",
|
|
"timestampValueExpression"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"kind": {
|
|
"type": "string",
|
|
"enum": [
|
|
"log"
|
|
]
|
|
},
|
|
"connection": {
|
|
"type": "string"
|
|
},
|
|
"from": {
|
|
"$ref": "#/components/schemas/SourceFrom"
|
|
},
|
|
"querySettings": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/QuerySetting"
|
|
},
|
|
"nullable": true
|
|
},
|
|
"defaultTableSelectExpression": {
|
|
"type": "string",
|
|
"description": "Default columns selected in search results (this can be customized per search later)"
|
|
},
|
|
"timestampValueExpression": {
|
|
"type": "string",
|
|
"description": "DateTime column or expression that is part of your table's primary key."
|
|
},
|
|
"serviceNameExpression": {
|
|
"type": "string",
|
|
"nullable": true
|
|
},
|
|
"severityTextExpression": {
|
|
"type": "string",
|
|
"nullable": true
|
|
},
|
|
"bodyExpression": {
|
|
"type": "string",
|
|
"nullable": true
|
|
},
|
|
"eventAttributesExpression": {
|
|
"type": "string",
|
|
"nullable": true
|
|
},
|
|
"resourceAttributesExpression": {
|
|
"type": "string",
|
|
"nullable": true
|
|
},
|
|
"displayedTimestampValueExpression": {
|
|
"type": "string",
|
|
"description": "This DateTime column is used to display and order search results.",
|
|
"nullable": true
|
|
},
|
|
"metricSourceId": {
|
|
"type": "string",
|
|
"description": "HyperDX Source for metrics associated with logs. Optional",
|
|
"nullable": true
|
|
},
|
|
"traceSourceId": {
|
|
"type": "string",
|
|
"description": "HyperDX Source for traces associated with logs. Optional",
|
|
"nullable": true
|
|
},
|
|
"traceIdExpression": {
|
|
"type": "string",
|
|
"nullable": true
|
|
},
|
|
"spanIdExpression": {
|
|
"type": "string",
|
|
"nullable": true
|
|
},
|
|
"implicitColumnExpression": {
|
|
"type": "string",
|
|
"description": "Column used for full text search if no property is specified in a Lucene-based search. Typically the message body of a log.",
|
|
"nullable": true
|
|
},
|
|
"highlightedTraceAttributeExpressions": {
|
|
"type": "array",
|
|
"description": "Expressions defining trace-level attributes which are displayed in the trace view for the selected trace.",
|
|
"items": {
|
|
"$ref": "#/components/schemas/HighlightedAttributeExpression"
|
|
},
|
|
"nullable": true
|
|
},
|
|
"highlightedRowAttributeExpressions": {
|
|
"type": "array",
|
|
"description": "Expressions defining row-level attributes which are displayed in the row side panel for the selected row.",
|
|
"items": {
|
|
"$ref": "#/components/schemas/HighlightedAttributeExpression"
|
|
},
|
|
"nullable": true
|
|
},
|
|
"materializedViews": {
|
|
"type": "array",
|
|
"description": "Configure materialized views for query optimization. These pre-aggregated views can significantly improve query performance on aggregation queries.",
|
|
"items": {
|
|
"$ref": "#/components/schemas/MaterializedView"
|
|
},
|
|
"nullable": true
|
|
}
|
|
}
|
|
},
|
|
"TraceSource": {
|
|
"type": "object",
|
|
"required": [
|
|
"id",
|
|
"name",
|
|
"kind",
|
|
"connection",
|
|
"from",
|
|
"timestampValueExpression",
|
|
"durationExpression",
|
|
"durationPrecision",
|
|
"traceIdExpression",
|
|
"spanIdExpression",
|
|
"parentSpanIdExpression",
|
|
"spanNameExpression",
|
|
"spanKindExpression"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"kind": {
|
|
"type": "string",
|
|
"enum": [
|
|
"trace"
|
|
]
|
|
},
|
|
"connection": {
|
|
"type": "string"
|
|
},
|
|
"from": {
|
|
"$ref": "#/components/schemas/SourceFrom"
|
|
},
|
|
"querySettings": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/QuerySetting"
|
|
},
|
|
"nullable": true
|
|
},
|
|
"defaultTableSelectExpression": {
|
|
"type": "string",
|
|
"description": "Default columns selected in search results (this can be customized per search later)",
|
|
"nullable": true
|
|
},
|
|
"timestampValueExpression": {
|
|
"type": "string",
|
|
"description": "DateTime column or expression defines the start of the span"
|
|
},
|
|
"durationExpression": {
|
|
"type": "string"
|
|
},
|
|
"durationPrecision": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 9,
|
|
"default": 3
|
|
},
|
|
"traceIdExpression": {
|
|
"type": "string"
|
|
},
|
|
"spanIdExpression": {
|
|
"type": "string"
|
|
},
|
|
"parentSpanIdExpression": {
|
|
"type": "string"
|
|
},
|
|
"spanNameExpression": {
|
|
"type": "string"
|
|
},
|
|
"spanKindExpression": {
|
|
"type": "string"
|
|
},
|
|
"logSourceId": {
|
|
"type": "string",
|
|
"description": "HyperDX Source for logs associated with traces. Optional",
|
|
"nullable": true
|
|
},
|
|
"sessionSourceId": {
|
|
"type": "string",
|
|
"description": "HyperDX Source for sessions associated with traces. Optional",
|
|
"nullable": true
|
|
},
|
|
"metricSourceId": {
|
|
"type": "string",
|
|
"description": "HyperDX Source for metrics associated with traces. Optional",
|
|
"nullable": true
|
|
},
|
|
"statusCodeExpression": {
|
|
"type": "string",
|
|
"nullable": true
|
|
},
|
|
"statusMessageExpression": {
|
|
"type": "string",
|
|
"nullable": true
|
|
},
|
|
"serviceNameExpression": {
|
|
"type": "string",
|
|
"nullable": true
|
|
},
|
|
"resourceAttributesExpression": {
|
|
"type": "string",
|
|
"nullable": true
|
|
},
|
|
"eventAttributesExpression": {
|
|
"type": "string",
|
|
"nullable": true
|
|
},
|
|
"spanEventsValueExpression": {
|
|
"type": "string",
|
|
"description": "Expression to extract span events. Used to capture events associated with spans. Expected to be Nested ( Timestamp DateTime64(9), Name LowCardinality(String), Attributes Map(LowCardinality(String), String)",
|
|
"nullable": true
|
|
},
|
|
"implicitColumnExpression": {
|
|
"type": "string",
|
|
"description": "Column used for full text search if no property is specified in a Lucene-based search. Typically the message body of a log.",
|
|
"nullable": true
|
|
},
|
|
"highlightedTraceAttributeExpressions": {
|
|
"type": "array",
|
|
"description": "Expressions defining trace-level attributes which are displayed in the trace view for the selected trace.",
|
|
"items": {
|
|
"$ref": "#/components/schemas/HighlightedAttributeExpression"
|
|
},
|
|
"nullable": true
|
|
},
|
|
"highlightedRowAttributeExpressions": {
|
|
"type": "array",
|
|
"description": "Expressions defining row-level attributes which are displayed in the row side panel for the selected row",
|
|
"items": {
|
|
"$ref": "#/components/schemas/HighlightedAttributeExpression"
|
|
},
|
|
"nullable": true
|
|
},
|
|
"materializedViews": {
|
|
"type": "array",
|
|
"description": "Configure materialized views for query optimization. These pre-aggregated views can significantly improve query performance on aggregation queries.",
|
|
"items": {
|
|
"$ref": "#/components/schemas/MaterializedView"
|
|
},
|
|
"nullable": true
|
|
}
|
|
}
|
|
},
|
|
"MetricSource": {
|
|
"type": "object",
|
|
"required": [
|
|
"id",
|
|
"name",
|
|
"kind",
|
|
"connection",
|
|
"from",
|
|
"metricTables",
|
|
"timestampValueExpression",
|
|
"resourceAttributesExpression"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"kind": {
|
|
"type": "string",
|
|
"enum": [
|
|
"metric"
|
|
]
|
|
},
|
|
"connection": {
|
|
"type": "string"
|
|
},
|
|
"from": {
|
|
"$ref": "#/components/schemas/MetricSourceFrom"
|
|
},
|
|
"querySettings": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/QuerySetting"
|
|
},
|
|
"nullable": true
|
|
},
|
|
"metricTables": {
|
|
"$ref": "#/components/schemas/MetricTables"
|
|
},
|
|
"timestampValueExpression": {
|
|
"type": "string",
|
|
"description": "DateTime column or expression that is part of your table's primary key."
|
|
},
|
|
"resourceAttributesExpression": {
|
|
"type": "string",
|
|
"description": "Column containing resource attributes for metrics"
|
|
},
|
|
"logSourceId": {
|
|
"type": "string",
|
|
"description": "HyperDX Source for logs associated with metrics. Optional",
|
|
"nullable": true
|
|
}
|
|
}
|
|
},
|
|
"SessionSource": {
|
|
"type": "object",
|
|
"required": [
|
|
"id",
|
|
"name",
|
|
"kind",
|
|
"connection",
|
|
"from",
|
|
"traceSourceId"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"kind": {
|
|
"type": "string",
|
|
"enum": [
|
|
"session"
|
|
]
|
|
},
|
|
"connection": {
|
|
"type": "string"
|
|
},
|
|
"from": {
|
|
"$ref": "#/components/schemas/SourceFrom"
|
|
},
|
|
"querySettings": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/QuerySetting"
|
|
},
|
|
"nullable": true
|
|
},
|
|
"timestampValueExpression": {
|
|
"type": "string",
|
|
"description": "DateTime column or expression that is part of your table's primary key.",
|
|
"nullable": true
|
|
},
|
|
"traceSourceId": {
|
|
"type": "string",
|
|
"description": "HyperDX Source for traces associated with sessions."
|
|
}
|
|
}
|
|
},
|
|
"Source": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/components/schemas/LogSource"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/TraceSource"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/MetricSource"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/SessionSource"
|
|
}
|
|
],
|
|
"discriminator": {
|
|
"propertyName": "kind",
|
|
"mapping": {
|
|
"log": "#/components/schemas/LogSource",
|
|
"trace": "#/components/schemas/TraceSource",
|
|
"metric": "#/components/schemas/MetricSource",
|
|
"session": "#/components/schemas/SessionSource"
|
|
}
|
|
}
|
|
},
|
|
"SourcesListResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Source"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"SlackWebhook": {
|
|
"type": "object",
|
|
"required": [
|
|
"id",
|
|
"name",
|
|
"service",
|
|
"updatedAt",
|
|
"createdAt"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"description": "Webhook ID"
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"description": "Webhook name"
|
|
},
|
|
"service": {
|
|
"type": "string",
|
|
"enum": [
|
|
"slack"
|
|
],
|
|
"description": "Webhook service type"
|
|
},
|
|
"url": {
|
|
"type": "string",
|
|
"description": "Slack incoming webhook URL"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "Webhook description, shown in the UI"
|
|
},
|
|
"updatedAt": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "Last update timestamp"
|
|
},
|
|
"createdAt": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "Creation timestamp"
|
|
}
|
|
}
|
|
},
|
|
"IncidentIOWebhook": {
|
|
"type": "object",
|
|
"required": [
|
|
"id",
|
|
"name",
|
|
"service",
|
|
"updatedAt",
|
|
"createdAt"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"description": "Webhook ID"
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"description": "Webhook name"
|
|
},
|
|
"service": {
|
|
"type": "string",
|
|
"enum": [
|
|
"incidentio"
|
|
],
|
|
"description": "Webhook service type"
|
|
},
|
|
"url": {
|
|
"type": "string",
|
|
"description": "incident.io alert event HTTP source URL"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "Webhook description, shown in the UI"
|
|
},
|
|
"updatedAt": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "Last update timestamp"
|
|
},
|
|
"createdAt": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "Creation timestamp"
|
|
}
|
|
}
|
|
},
|
|
"GenericWebhook": {
|
|
"type": "object",
|
|
"required": [
|
|
"id",
|
|
"name",
|
|
"service",
|
|
"updatedAt",
|
|
"createdAt"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"description": "Webhook ID"
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"description": "Webhook name"
|
|
},
|
|
"service": {
|
|
"type": "string",
|
|
"enum": [
|
|
"generic"
|
|
],
|
|
"description": "Webhook service type"
|
|
},
|
|
"url": {
|
|
"type": "string",
|
|
"description": "Webhook destination URL"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "Webhook description, shown in the UI"
|
|
},
|
|
"headers": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
},
|
|
"description": "Optional headers to include in the webhook request"
|
|
},
|
|
"body": {
|
|
"type": "string",
|
|
"description": "Optional request body template"
|
|
},
|
|
"updatedAt": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "Last update timestamp"
|
|
},
|
|
"createdAt": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "Creation timestamp"
|
|
}
|
|
}
|
|
},
|
|
"Webhook": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/components/schemas/SlackWebhook"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/IncidentIOWebhook"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/GenericWebhook"
|
|
}
|
|
],
|
|
"discriminator": {
|
|
"propertyName": "service",
|
|
"mapping": {
|
|
"slack": "#/components/schemas/SlackWebhook",
|
|
"incidentio": "#/components/schemas/IncidentIOWebhook",
|
|
"generic": "#/components/schemas/GenericWebhook"
|
|
}
|
|
}
|
|
},
|
|
"WebhooksListResponse": {
|
|
"type": "object",
|
|
"required": [
|
|
"data"
|
|
],
|
|
"properties": {
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Webhook"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"paths": {
|
|
"/api/v2/alerts/{id}": {
|
|
"get": {
|
|
"summary": "Get Alert",
|
|
"description": "Retrieves a specific alert by ID",
|
|
"operationId": "getAlert",
|
|
"tags": [
|
|
"Alerts"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"description": "Alert ID",
|
|
"example": "65f5e4a3b9e77c001a123456"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successfully retrieved alert",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/AlertResponseEnvelope"
|
|
},
|
|
"examples": {
|
|
"alertResponse": {
|
|
"summary": "Single alert response",
|
|
"value": {
|
|
"data": {
|
|
"id": "65f5e4a3b9e77c001a123456",
|
|
"threshold": 80,
|
|
"interval": "5m",
|
|
"thresholdType": "above",
|
|
"source": "tile",
|
|
"state": "ALERT",
|
|
"channel": {
|
|
"type": "webhook",
|
|
"webhookId": "65f5e4a3b9e77c001a789012"
|
|
},
|
|
"teamId": "65f5e4a3b9e77c001a345678",
|
|
"tileId": "65f5e4a3b9e77c001a901234",
|
|
"dashboardId": "65f5e4a3b9e77c001a567890",
|
|
"createdAt": "2023-03-15T10:20:30.000Z",
|
|
"updatedAt": "2023-03-15T14:25:10.000Z"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Error"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Alert not found",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"summary": "Update Alert",
|
|
"description": "Updates an existing alert",
|
|
"operationId": "updateAlert",
|
|
"tags": [
|
|
"Alerts"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"description": "Alert ID",
|
|
"example": "65f5e4a3b9e77c001a123456"
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/UpdateAlertRequest"
|
|
},
|
|
"examples": {
|
|
"updateAlert": {
|
|
"summary": "Update alert properties",
|
|
"value": {
|
|
"threshold": 500,
|
|
"interval": "1h",
|
|
"thresholdType": "above",
|
|
"source": "tile",
|
|
"dashboardId": "65f5e4a3b9e77c001a567890",
|
|
"tileId": "65f5e4a3b9e77c001a901234",
|
|
"channel": {
|
|
"type": "webhook",
|
|
"webhookId": "65f5e4a3b9e77c001a789012"
|
|
},
|
|
"name": "Updated Alert Name",
|
|
"message": "Updated threshold and interval"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successfully updated alert",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/AlertResponseEnvelope"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Error"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Alert not found",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Error"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Server error or validation failure",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"summary": "Delete Alert",
|
|
"description": "Deletes an alert",
|
|
"operationId": "deleteAlert",
|
|
"tags": [
|
|
"Alerts"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"description": "Alert ID",
|
|
"example": "65f5e4a3b9e77c001a123456"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successfully deleted alert",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/EmptyResponse"
|
|
},
|
|
"example": {}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Error"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Alert not found",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v2/alerts": {
|
|
"get": {
|
|
"summary": "List Alerts",
|
|
"description": "Retrieves a list of all alerts for the authenticated team",
|
|
"operationId": "listAlerts",
|
|
"tags": [
|
|
"Alerts"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successfully retrieved alerts",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/AlertsListResponse"
|
|
},
|
|
"examples": {
|
|
"alertsList": {
|
|
"summary": "List of alerts",
|
|
"value": {
|
|
"data": [
|
|
{
|
|
"id": "65f5e4a3b9e77c001a123456",
|
|
"threshold": 100,
|
|
"interval": "15m",
|
|
"thresholdType": "above",
|
|
"source": "tile",
|
|
"state": "OK",
|
|
"channel": {
|
|
"type": "webhook",
|
|
"webhookId": "65f5e4a3b9e77c001a789012"
|
|
},
|
|
"teamId": "65f5e4a3b9e77c001a345678",
|
|
"tileId": "65f5e4a3b9e77c001a901234",
|
|
"dashboardId": "65f5e4a3b9e77c001a567890",
|
|
"createdAt": "2023-01-01T00:00:00.000Z",
|
|
"updatedAt": "2023-01-01T00:00:00.000Z"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Error"
|
|
},
|
|
"example": {
|
|
"message": "Unauthorized access. API key is missing or invalid."
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"summary": "Create Alert",
|
|
"description": "Creates a new alert",
|
|
"operationId": "createAlert",
|
|
"tags": [
|
|
"Alerts"
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/CreateAlertRequest"
|
|
},
|
|
"examples": {
|
|
"tileAlert": {
|
|
"summary": "Create a tile-based alert",
|
|
"value": {
|
|
"dashboardId": "65f5e4a3b9e77c001a567890",
|
|
"tileId": "65f5e4a3b9e77c001a901234",
|
|
"threshold": 100,
|
|
"interval": "1h",
|
|
"source": "tile",
|
|
"thresholdType": "above",
|
|
"channel": {
|
|
"type": "webhook",
|
|
"webhookId": "65f5e4a3b9e77c001a789012"
|
|
},
|
|
"name": "Error Spike Alert",
|
|
"message": "Error rate has exceeded 100 in the last hour"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successfully created alert",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/AlertResponseEnvelope"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Error"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Server error or validation failure",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v2/charts/series": {
|
|
"post": {
|
|
"summary": "Query Chart Series Data",
|
|
"description": "Retrieves time series data based on configured series parameters",
|
|
"operationId": "queryChartSeries",
|
|
"tags": [
|
|
"Charts"
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/SeriesQueryRequest"
|
|
},
|
|
"examples": {
|
|
"basicTimeSeries": {
|
|
"summary": "Basic time series query",
|
|
"value": {
|
|
"startTime": 1647014400000,
|
|
"endTime": 1647100800000,
|
|
"granularity": "1h",
|
|
"series": [
|
|
{
|
|
"sourceId": "65f5e4a3b9e77c001a123456",
|
|
"aggFn": "count",
|
|
"where": "SeverityText:error",
|
|
"groupBy": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"multiSeriesWithGroupBy": {
|
|
"summary": "Multiple series with group by",
|
|
"value": {
|
|
"startTime": 1647014400000,
|
|
"endTime": 1647100800000,
|
|
"granularity": "15m",
|
|
"series": [
|
|
{
|
|
"sourceId": "65f5e4a3b9e77c001a123456",
|
|
"aggFn": "count",
|
|
"where": "SeverityText:error",
|
|
"groupBy": [
|
|
"service"
|
|
]
|
|
},
|
|
{
|
|
"sourceId": "65f5e4a3b9e77c001a123456",
|
|
"aggFn": "avg",
|
|
"field": "duration",
|
|
"where": "SeverityText:error",
|
|
"groupBy": [
|
|
"service"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"multiSourceSeries": {
|
|
"summary": "Series from multiple sources",
|
|
"value": {
|
|
"startTime": 1647014400000,
|
|
"endTime": 1647100800000,
|
|
"granularity": "5m",
|
|
"series": [
|
|
{
|
|
"sourceId": "65f5e4a3b9e77c001a123456",
|
|
"aggFn": "count",
|
|
"where": "SeverityText:error",
|
|
"groupBy": []
|
|
},
|
|
{
|
|
"sourceId": "65f5e4a3b9e77c001a789012",
|
|
"aggFn": "avg",
|
|
"metricName": "http_requests_total",
|
|
"metricDataType": "gauge",
|
|
"where": "service:api",
|
|
"groupBy": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"metricSeries": {
|
|
"summary": "Metric data series",
|
|
"value": {
|
|
"startTime": 1647014400000,
|
|
"endTime": 1647100800000,
|
|
"granularity": "5m",
|
|
"series": [
|
|
{
|
|
"sourceId": "65f5e4a3b9e77c001a789012",
|
|
"aggFn": "avg",
|
|
"metricName": "http_requests_total",
|
|
"metricDataType": "gauge",
|
|
"where": "service:api",
|
|
"groupBy": []
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successfully retrieved time series data",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/SeriesResponse"
|
|
},
|
|
"examples": {
|
|
"timeSeriesData": {
|
|
"summary": "Time series data points",
|
|
"value": {
|
|
"data": [
|
|
{
|
|
"ts_bucket": 1647014400000,
|
|
"series_0.data": 42
|
|
},
|
|
{
|
|
"ts_bucket": 1647018000000,
|
|
"series_0.data": 37
|
|
},
|
|
{
|
|
"ts_bucket": 1647021600000,
|
|
"series_0.data": 53
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"groupedTimeSeriesData": {
|
|
"summary": "Grouped time series data",
|
|
"value": {
|
|
"data": [
|
|
{
|
|
"ts_bucket": 1647014400000,
|
|
"series_0.data": 15,
|
|
"group": [
|
|
"api"
|
|
]
|
|
},
|
|
{
|
|
"ts_bucket": 1647014400000,
|
|
"series_0.data": 8,
|
|
"group": [
|
|
"frontend"
|
|
]
|
|
},
|
|
{
|
|
"ts_bucket": 1647018000000,
|
|
"series_0.data": 22,
|
|
"group": [
|
|
"api"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid request parameters",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"error": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"examples": {
|
|
"invalidParams": {
|
|
"value": {
|
|
"error": "All series must have the same groupBy fields"
|
|
}
|
|
},
|
|
"invalidTimestamp": {
|
|
"value": {
|
|
"error": "Timestamp must be in milliseconds"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"error": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"example": {
|
|
"error": "Team context missing"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Source not found",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"error": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"example": {
|
|
"error": "Source not found"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Server error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"error": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"example": {
|
|
"error": "Internal server error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v2/dashboards": {
|
|
"get": {
|
|
"summary": "List Dashboards",
|
|
"description": "Retrieves a list of all dashboards for the authenticated team",
|
|
"operationId": "listDashboards",
|
|
"tags": [
|
|
"Dashboards"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successfully retrieved dashboards",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/DashboardsListResponse"
|
|
},
|
|
"examples": {
|
|
"dashboards": {
|
|
"summary": "Dashboards list response",
|
|
"value": {
|
|
"data": [
|
|
{
|
|
"id": "65f5e4a3b9e77c001a567890",
|
|
"name": "Infrastructure Monitoring",
|
|
"tiles": [
|
|
{
|
|
"id": "65f5e4a3b9e77c001a901234",
|
|
"name": "Server CPU",
|
|
"x": 0,
|
|
"y": 0,
|
|
"w": 6,
|
|
"h": 3,
|
|
"config": {
|
|
"displayType": "line",
|
|
"sourceId": "65f5e4a3b9e77c001a111111",
|
|
"select": [
|
|
{
|
|
"aggFn": "avg",
|
|
"valueExpression": "cpu.usage",
|
|
"where": "host:server-01"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"tags": [
|
|
"infrastructure",
|
|
"monitoring"
|
|
],
|
|
"filters": [
|
|
{
|
|
"id": "65f5e4a3b9e77c001a301001",
|
|
"type": "QUERY_EXPRESSION",
|
|
"name": "Environment",
|
|
"expression": "environment",
|
|
"sourceId": "65f5e4a3b9e77c001a111111"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "65f5e4a3b9e77c001a567891",
|
|
"name": "API Monitoring",
|
|
"tiles": [
|
|
{
|
|
"id": "65f5e4a3b9e77c001a901235",
|
|
"name": "API Errors",
|
|
"x": 0,
|
|
"y": 0,
|
|
"w": 6,
|
|
"h": 3,
|
|
"config": {
|
|
"displayType": "table",
|
|
"sourceId": "65f5e4a3b9e77c001a111112",
|
|
"select": [
|
|
{
|
|
"aggFn": "count",
|
|
"where": "level:error"
|
|
}
|
|
],
|
|
"groupBy": "service",
|
|
"orderBy": "count DESC"
|
|
}
|
|
}
|
|
],
|
|
"tags": [
|
|
"api",
|
|
"monitoring"
|
|
],
|
|
"filters": [
|
|
{
|
|
"id": "65f5e4a3b9e77c001a301002",
|
|
"type": "QUERY_EXPRESSION",
|
|
"name": "Service",
|
|
"expression": "service_name",
|
|
"sourceId": "65f5e4a3b9e77c001a111112"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized"
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"summary": "Create Dashboard",
|
|
"description": "Creates a new dashboard",
|
|
"operationId": "createDashboard",
|
|
"tags": [
|
|
"Dashboards"
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/CreateDashboardRequest"
|
|
},
|
|
"examples": {
|
|
"simpleTimeSeriesDashboard": {
|
|
"summary": "Dashboard with a line chart",
|
|
"value": {
|
|
"name": "API Monitoring Dashboard",
|
|
"tiles": [
|
|
{
|
|
"name": "API Request Volume",
|
|
"x": 0,
|
|
"y": 0,
|
|
"w": 6,
|
|
"h": 3,
|
|
"config": {
|
|
"displayType": "line",
|
|
"sourceId": "65f5e4a3b9e77c001a111111",
|
|
"select": [
|
|
{
|
|
"aggFn": "count",
|
|
"where": "service:api"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"tags": [
|
|
"api",
|
|
"monitoring"
|
|
],
|
|
"filters": [
|
|
{
|
|
"type": "QUERY_EXPRESSION",
|
|
"name": "Environment",
|
|
"expression": "environment",
|
|
"sourceId": "65f5e4a3b9e77c001a111111"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"complexDashboard": {
|
|
"summary": "Dashboard with multiple chart types",
|
|
"value": {
|
|
"name": "Service Health Overview",
|
|
"tiles": [
|
|
{
|
|
"name": "Request Count",
|
|
"x": 0,
|
|
"y": 0,
|
|
"w": 6,
|
|
"h": 3,
|
|
"config": {
|
|
"displayType": "line",
|
|
"sourceId": "65f5e4a3b9e77c001a111111",
|
|
"select": [
|
|
{
|
|
"aggFn": "count",
|
|
"where": "service:backend"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "Error Distribution",
|
|
"x": 6,
|
|
"y": 0,
|
|
"w": 6,
|
|
"h": 3,
|
|
"config": {
|
|
"displayType": "table",
|
|
"sourceId": "65f5e4a3b9e77c001a111111",
|
|
"select": [
|
|
{
|
|
"aggFn": "count",
|
|
"where": "level:error"
|
|
}
|
|
],
|
|
"groupBy": "errorType",
|
|
"orderBy": "count DESC"
|
|
}
|
|
}
|
|
],
|
|
"tags": [
|
|
"service-health",
|
|
"production"
|
|
],
|
|
"filters": [
|
|
{
|
|
"type": "QUERY_EXPRESSION",
|
|
"name": "Service",
|
|
"expression": "service_name",
|
|
"sourceId": "65f5e4a3b9e77c001a111111"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successfully created dashboard",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/DashboardResponseEnvelope"
|
|
},
|
|
"examples": {
|
|
"createdDashboard": {
|
|
"summary": "Created dashboard response",
|
|
"value": {
|
|
"data": {
|
|
"id": "65f5e4a3b9e77c001a567890",
|
|
"name": "API Monitoring Dashboard",
|
|
"tiles": [
|
|
{
|
|
"id": "65f5e4a3b9e77c001a901234",
|
|
"name": "API Request Volume",
|
|
"x": 0,
|
|
"y": 0,
|
|
"w": 6,
|
|
"h": 3,
|
|
"config": {
|
|
"displayType": "line",
|
|
"sourceId": "65f5e4a3b9e77c001a111111",
|
|
"select": [
|
|
{
|
|
"aggFn": "count",
|
|
"where": "service:api"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"tags": [
|
|
"api",
|
|
"monitoring"
|
|
],
|
|
"filters": [
|
|
{
|
|
"id": "65f5e4a3b9e77c001a301004",
|
|
"type": "QUERY_EXPRESSION",
|
|
"name": "Environment",
|
|
"expression": "environment",
|
|
"sourceId": "65f5e4a3b9e77c001a111111"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Error"
|
|
},
|
|
"example": {
|
|
"message": "Could not find the following source IDs: 68fa86308aa879b977aa6af6"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Error"
|
|
},
|
|
"example": {
|
|
"message": "Unauthorized access. API key is missing or invalid."
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Server error or validation failure",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Error"
|
|
},
|
|
"example": {
|
|
"message": "Dashboard validation failed: name is required"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v2/dashboards/{id}": {
|
|
"get": {
|
|
"summary": "Get Dashboard",
|
|
"description": "Retrieves a specific dashboard by ID",
|
|
"operationId": "getDashboard",
|
|
"tags": [
|
|
"Dashboards"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"description": "Dashboard ID",
|
|
"example": "65f5e4a3b9e77c001a567890"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successfully retrieved dashboard",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/DashboardResponseEnvelope"
|
|
},
|
|
"examples": {
|
|
"dashboard": {
|
|
"summary": "Single dashboard response",
|
|
"value": {
|
|
"data": {
|
|
"id": "65f5e4a3b9e77c001a567890",
|
|
"name": "Infrastructure Monitoring",
|
|
"tiles": [
|
|
{
|
|
"id": "65f5e4a3b9e77c001a901234",
|
|
"name": "Server CPU",
|
|
"x": 0,
|
|
"y": 0,
|
|
"w": 6,
|
|
"h": 3,
|
|
"config": {
|
|
"displayType": "line",
|
|
"sourceId": "65f5e4a3b9e77c001a111111",
|
|
"select": [
|
|
{
|
|
"aggFn": "avg",
|
|
"valueExpression": "cpu.usage",
|
|
"where": "host:server-01"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"id": "65f5e4a3b9e77c001a901235",
|
|
"name": "Memory Usage",
|
|
"x": 6,
|
|
"y": 0,
|
|
"w": 6,
|
|
"h": 3,
|
|
"config": {
|
|
"displayType": "line",
|
|
"sourceId": "65f5e4a3b9e77c001a111111",
|
|
"select": [
|
|
{
|
|
"aggFn": "avg",
|
|
"valueExpression": "memory.usage",
|
|
"where": "host:server-01"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"tags": [
|
|
"infrastructure",
|
|
"monitoring"
|
|
],
|
|
"filters": [
|
|
{
|
|
"id": "65f5e4a3b9e77c001a301003",
|
|
"type": "QUERY_EXPRESSION",
|
|
"name": "Environment",
|
|
"expression": "environment",
|
|
"sourceId": "65f5e4a3b9e77c001a111111"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Error"
|
|
},
|
|
"example": {
|
|
"message": "Unauthorized access. API key is missing or invalid."
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Dashboard not found",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Error"
|
|
},
|
|
"example": {
|
|
"message": "Dashboard not found"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"summary": "Update Dashboard",
|
|
"description": "Updates an existing dashboard",
|
|
"operationId": "updateDashboard",
|
|
"tags": [
|
|
"Dashboards"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"description": "Dashboard ID",
|
|
"example": "65f5e4a3b9e77c001a567890"
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/UpdateDashboardRequest"
|
|
},
|
|
"examples": {
|
|
"updateDashboard": {
|
|
"summary": "Update dashboard properties and tiles",
|
|
"value": {
|
|
"name": "Updated Dashboard Name",
|
|
"tiles": [
|
|
{
|
|
"id": "65f5e4a3b9e77c001a901234",
|
|
"name": "Updated Line Chart",
|
|
"x": 0,
|
|
"y": 0,
|
|
"w": 6,
|
|
"h": 3,
|
|
"config": {
|
|
"displayType": "line",
|
|
"sourceId": "65f5e4a3b9e77c001a111111",
|
|
"select": [
|
|
{
|
|
"aggFn": "count",
|
|
"where": "level:error"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"id": "new-tile-123",
|
|
"name": "New Number Chart",
|
|
"x": 6,
|
|
"y": 0,
|
|
"w": 6,
|
|
"h": 3,
|
|
"config": {
|
|
"displayType": "number",
|
|
"sourceId": "65f5e4a3b9e77c001a111111",
|
|
"select": [
|
|
{
|
|
"aggFn": "count",
|
|
"where": "level:info"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"tags": [
|
|
"production",
|
|
"updated"
|
|
],
|
|
"filters": [
|
|
{
|
|
"id": "65f5e4a3b9e77c001a301005",
|
|
"type": "QUERY_EXPRESSION",
|
|
"name": "Environment",
|
|
"expression": "environment",
|
|
"sourceId": "65f5e4a3b9e77c001a111111"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successfully updated dashboard",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/DashboardResponseEnvelope"
|
|
},
|
|
"examples": {
|
|
"updatedDashboard": {
|
|
"summary": "Updated dashboard response",
|
|
"value": {
|
|
"data": {
|
|
"id": "65f5e4a3b9e77c001a567890",
|
|
"name": "Updated Dashboard Name",
|
|
"tiles": [
|
|
{
|
|
"id": "65f5e4a3b9e77c001a901234",
|
|
"name": "Updated Line Chart",
|
|
"x": 0,
|
|
"y": 0,
|
|
"w": 6,
|
|
"h": 3,
|
|
"config": {
|
|
"displayType": "line",
|
|
"sourceId": "65f5e4a3b9e77c001a111111",
|
|
"select": [
|
|
{
|
|
"aggFn": "count",
|
|
"where": "level:error"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"id": "new-tile-123",
|
|
"name": "New Number Chart",
|
|
"x": 6,
|
|
"y": 0,
|
|
"w": 6,
|
|
"h": 3,
|
|
"config": {
|
|
"displayType": "number",
|
|
"sourceId": "65f5e4a3b9e77c001a111111",
|
|
"select": [
|
|
{
|
|
"aggFn": "count",
|
|
"where": "level:info"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"tags": [
|
|
"production",
|
|
"updated"
|
|
],
|
|
"filters": [
|
|
{
|
|
"id": "65f5e4a3b9e77c001a301005",
|
|
"type": "QUERY_EXPRESSION",
|
|
"name": "Environment",
|
|
"expression": "environment",
|
|
"sourceId": "65f5e4a3b9e77c001a111111"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Error"
|
|
},
|
|
"example": {
|
|
"message": "Could not find the following source IDs: 68fa86308aa879b977aa6af6"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Error"
|
|
},
|
|
"example": {
|
|
"message": "Unauthorized access. API key is missing or invalid."
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Dashboard not found",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Error"
|
|
},
|
|
"example": {
|
|
"message": "Dashboard not found"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Server error or validation failure",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Error"
|
|
},
|
|
"example": {
|
|
"message": "Invalid dashboard configuration"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"summary": "Delete Dashboard",
|
|
"description": "Deletes a dashboard",
|
|
"operationId": "deleteDashboard",
|
|
"tags": [
|
|
"Dashboards"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"description": "Dashboard ID",
|
|
"example": "65f5e4a3b9e77c001a567890"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successfully deleted dashboard",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/EmptyResponse"
|
|
},
|
|
"example": {}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Error"
|
|
},
|
|
"example": {
|
|
"message": "Unauthorized access. API key is missing or invalid."
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Dashboard not found",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Error"
|
|
},
|
|
"example": {
|
|
"message": "Dashboard not found"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v2/sources": {
|
|
"get": {
|
|
"summary": "List Sources",
|
|
"description": "Retrieves a list of all sources for the authenticated team",
|
|
"operationId": "listSources",
|
|
"tags": [
|
|
"Sources"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successfully retrieved sources",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/SourcesListResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Error"
|
|
},
|
|
"example": {
|
|
"message": "Unauthorized access. API key is missing or invalid."
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v2/webhooks": {
|
|
"get": {
|
|
"summary": "List Webhooks",
|
|
"description": "Retrieves a list of all webhooks for the authenticated team",
|
|
"operationId": "listWebhooks",
|
|
"tags": [
|
|
"Webhooks"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successfully retrieved webhooks",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/WebhooksListResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Error"
|
|
},
|
|
"example": {
|
|
"message": "Unauthorized access. API key is missing or invalid."
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |