Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/source-vars-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperdx/api': minor
---

feat: support data source and connection variables in the external API and MCP
212 changes: 195 additions & 17 deletions packages/api/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1883,7 +1883,7 @@
},
"sourceId": {
"type": "string",
"description": "ID of the data source to query.",
"description": "ID of the data source to query, or `$sourceVariable` of a DATA_SOURCE filter on the dashboard.",
"example": "65f5e4a3b9e77c001a111111"
},
"select": {
Expand Down Expand Up @@ -1980,7 +1980,7 @@
},
"sourceId": {
"type": "string",
"description": "ID of the data source to query.",
"description": "ID of the data source to query, or `$sourceVariable` of a DATA_SOURCE filter on the dashboard.",
"example": "65f5e4a3b9e77c001a111111"
},
"select": {
Expand Down Expand Up @@ -2057,7 +2057,7 @@
},
"sourceId": {
"type": "string",
"description": "ID of the data source to query.",
"description": "ID of the data source to query, or `$sourceVariable` of a DATA_SOURCE filter on the dashboard.",
"example": "65f5e4a3b9e77c001a111111"
},
"select": {
Expand Down Expand Up @@ -2144,7 +2144,7 @@
},
"sourceId": {
"type": "string",
"description": "ID of the data source to query.",
"description": "ID of the data source to query, or `$sourceVariable` of a DATA_SOURCE filter on the dashboard.",
"example": "65f5e4a3b9e77c001a111111"
},
"select": {
Expand Down Expand Up @@ -2227,7 +2227,7 @@
},
"sourceId": {
"type": "string",
"description": "ID of the data source to query.",
"description": "ID of the data source to query, or `$sourceVariable` of a DATA_SOURCE filter on the dashboard.",
"example": "65f5e4a3b9e77c001a111111"
},
"select": {
Expand Down Expand Up @@ -2288,7 +2288,7 @@
},
"sourceId": {
"type": "string",
"description": "ID of the data source to query.",
"description": "ID of the data source to query, or `$sourceVariable` of a DATA_SOURCE filter on the dashboard.",
"example": "65f5e4a3b9e77c001a111111"
},
"select": {
Expand Down Expand Up @@ -2343,7 +2343,7 @@
},
"sourceId": {
"type": "string",
"description": "ID of the data source to query.",
"description": "ID of the data source to query, or `$sourceVariable` of a DATA_SOURCE filter on the dashboard.",
"example": "65f5e4a3b9e77c001a111111"
},
"select": {
Expand Down Expand Up @@ -2437,7 +2437,7 @@
},
"sourceId": {
"type": "string",
"description": "ID of the data source to query.",
"description": "ID of the data source to query, or `$sourceVariable` of a DATA_SOURCE filter on the dashboard.",
"example": "65f5e4a3b9e77c001a111111"
},
"select": {
Expand Down Expand Up @@ -2495,7 +2495,7 @@
},
"sourceId": {
"type": "string",
"description": "ID of the data source to query.",
"description": "ID of the data source to query, or `$sourceVariable` of a DATA_SOURCE filter on the dashboard.",
"example": "65f5e4a3b9e77c001a111111"
},
"select": {
Expand Down Expand Up @@ -2559,7 +2559,7 @@
},
"sourceId": {
"type": "string",
"description": "ID of the data source to query.",
"description": "ID of the data source to query, or `$sourceVariable` of a DATA_SOURCE filter on the dashboard.",
"example": "65f5e4a3b9e77c001a111111"
},
"select": {
Expand Down Expand Up @@ -2599,7 +2599,7 @@
},
"sourceId": {
"type": "string",
"description": "ID of the data source to mine patterns from.",
"description": "ID of the data source to mine patterns from, or `$sourceVariable` of a DATA_SOURCE filter on the dashboard.",
"example": "65f5e4a3b9e77c001a111111"
},
"select": {
Expand Down Expand Up @@ -2664,7 +2664,7 @@
},
"connectionId": {
"type": "string",
"description": "ID of the ClickHouse connection to execute the query against.",
"description": "ID of the ClickHouse connection to execute the query against, or\n`$connectionVariable` of a CONNECTION filter on the dashboard.\n",
"example": "65f5e4a3b9e77c001a567890"
},
"sqlTemplate": {
Expand All @@ -2675,7 +2675,7 @@
},
"sourceId": {
"type": "string",
"description": "Optional ID of the data source associated with this Raw SQL chart. Used for applying dashboard filters.",
"description": "Optional ID of the data source associated with this Raw SQL chart, or `$sourceVariable` of a DATA_SOURCE filter on the dashboard. Used for applying dashboard filters.",
"example": "65f5e4a3b9e77c001a567890"
},
"numberFormat": {
Expand Down Expand Up @@ -4031,6 +4031,12 @@
},
{
"$ref": "#/components/schemas/AdhocFilterInput"
},
{
"$ref": "#/components/schemas/DataSourceFilterInput"
},
{
"$ref": "#/components/schemas/ConnectionFilterInput"
}
],
"discriminator": {
Expand All @@ -4040,7 +4046,179 @@
"STATIC_LIST": "#/components/schemas/StaticListFilterInput",
"PROMETHEUS_LABEL": "#/components/schemas/PrometheusLabelFilterInput",
"SQL_QUERY": "#/components/schemas/SqlQueryFilterInput",
"ADHOC": "#/components/schemas/AdhocFilterInput"
"ADHOC": "#/components/schemas/AdhocFilterInput",
"DATA_SOURCE": "#/components/schemas/DataSourceFilterInput",
"CONNECTION": "#/components/schemas/ConnectionFilterInput"
}
}
},
"DataSourceFilterInput": {
"type": "object",
"description": "A variable whose single, required value is a source. Tiles reference it\nas `$variableName` in their sourceId, and other filters in sourceId or\nappliesToSourceIds, so viewers can switch the source those read. Tiles\nthat use it do not load until a source is selected, and cannot have\nalerts.\n",
"required": [
"type",
"name",
"allowedSourceKinds"
],
"properties": {
"type": {
"type": "string",
"enum": [
"DATA_SOURCE"
],
"description": "Filter type discriminator. Must be \"DATA_SOURCE\".",
"example": "DATA_SOURCE"
},
"name": {
"type": "string",
"minLength": 1,
"description": "Display name of the variable's dropdown",
"example": "Logs source"
},
"variableName": {
"type": "string",
"maxLength": 64,
"pattern": "^[a-zA-Z][a-zA-Z0-9_]*$",
"description": "Token tiles and filters reference the selected source by, as `$variableName`.",
"example": "logs"
},
"isGlobalRequirement": {
"type": "boolean",
"default": false,
"description": "Blocks every tile on the dashboard until a value is selected. False\n(the default) blocks only the tiles that reference the variable.\n",
"example": true
},
"minSelections": {
"type": "integer",
"enum": [
1
],
"default": 1,
"description": "Must be 1 if provided. The variable always requires a selection.",
"example": 1
},
"maxSelections": {
"type": "integer",
"enum": [
1
],
"default": 1,
"description": "Must be 1 if provided. The variable is always single-select.",
"example": 1
},
"isBroadcastEnabled": {
"type": "boolean",
"enum": [
false
],
"default": false,
"description": "Must be false or omitted.",
"example": false
},
"isVariableEnabled": {
"type": "boolean",
"enum": [
true
],
"default": true,
"description": "Must be true if provided, and is true when omitted.",
"example": true
},
"allowedSourceKinds": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"enum": [
"log",
"trace",
"session",
"metric",
"promql"
]
},
"description": "Kinds of sources offered. A field can reference the variable if it\naccepts at least one listed kind. A tile whose selected source is a\nkind it cannot use shows an error instead of running.\n",
"example": [
"log"
]
},
"connectionId": {
"type": "string",
"description": "Optional connection the offered sources are limited to: a\nconnection ID, or `$name` of a CONNECTION filter on the dashboard.\n",
"example": "$conn"
}
}
},
"ConnectionFilterInput": {
"type": "object",
"description": "A variable whose single, required value is a connection. Raw SQL tiles\nreference it as `$variableName` in their connectionId, and data source\nvariables in theirs. Tiles that use it do not load until a connection is\nselected, and cannot have alerts.\n",
"required": [
"type",
"name"
],
"properties": {
"type": {
"type": "string",
"enum": [
"CONNECTION"
],
"description": "Filter type discriminator. Must be \"CONNECTION\".",
"example": "CONNECTION"
},
"name": {
"type": "string",
"minLength": 1,
"description": "Display name of the variable's dropdown",
"example": "Connection"
},
"variableName": {
"type": "string",
"maxLength": 64,
"pattern": "^[a-zA-Z][a-zA-Z0-9_]*$",
"description": "Token raw SQL tiles reference the selected connection by, as `$variableName`.",
"example": "conn"
},
"isGlobalRequirement": {
"type": "boolean",
"default": false,
"description": "Blocks every tile on the dashboard until a value is selected. False\n(the default) blocks only the tiles that reference the variable.\n",
"example": true
},
"minSelections": {
"type": "integer",
"enum": [
1
],
"default": 1,
"description": "Must be 1 if provided. The variable always requires a selection.",
"example": 1
},
"maxSelections": {
"type": "integer",
"enum": [
1
],
"default": 1,
"description": "Must be 1 if provided. The variable is always single-select.",
"example": 1
},
"isBroadcastEnabled": {
"type": "boolean",
"enum": [
false
],
"default": false,
"description": "Must be false or omitted.",
"example": false
},
"isVariableEnabled": {
"type": "boolean",
"enum": [
true
],
"default": true,
"description": "Must be true if provided, and is true when omitted.",
"example": true
}
}
},
Expand Down Expand Up @@ -4076,7 +4254,7 @@
},
"sourceId": {
"type": "string",
"description": "Source ID this dashboard filter key applies to",
"description": "Source ID this dashboard filter key applies to, or `$name` of a DATA_SOURCE filter on the dashboard",
"example": "65f5e4a3b9e77c001a111111"
},
"sourceMetricType": {
Expand Down Expand Up @@ -4469,7 +4647,7 @@
"items": {
"type": "string"
},
"description": "IDs of the sources whose keys and values the filter suggests, all of sourceType.",
"description": "IDs of the sources whose keys and values the filter suggests, all of sourceType, or `$name` of data source variables.",
"example": [
"65f5e4a3b9e77c001a111111"
]
Expand All @@ -4493,7 +4671,7 @@
"items": {
"type": "string"
},
"description": "IDs of the sources whose tiles the conditions apply to, all of\nsourceType. Omit or send an empty array to apply to the tiles of\nthe filter's sources.\n",
"description": "IDs of the sources whose tiles the conditions apply to, all of\nsourceType, or `$name` of data source variables. Omit or send an\nempty array to apply to the tiles of the filter's sources.\n",
"example": [
"65f5e4a3b9e77c001a111111"
]
Expand Down
Loading
Loading