Skip to content
Draft
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
6 changes: 6 additions & 0 deletions .changeset/slow-bananas-lay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@hyperdx/common-utils": patch
"@hyperdx/api": patch
---

feat: Add custom onClick field to external dashboards API
186 changes: 186 additions & 0 deletions packages/api/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1354,6 +1354,10 @@
"description": "When true, render Group By columns to the left of series columns in the table. Defaults to false (Group By columns on the right).\n",
"default": false,
"example": false
},
"onClick": {
"$ref": "#/components/schemas/OnClick",
"description": "Optional link-out configuration applied when a user clicks a row."
}
}
},
Expand Down Expand Up @@ -1633,6 +1637,10 @@
],
"description": "Display as a table chart.",
"example": "table"
},
"onClick": {
"$ref": "#/components/schemas/OnClick",
"description": "Optional link-out configuration applied when a user clicks a row."
}
}
}
Expand Down Expand Up @@ -1720,6 +1728,184 @@
}
}
},
"OnClickFilterTemplate": {
"type": "object",
"description": "A templated filter applied to the link-out destination. The rendered template value is combined with the expression as `expression IN (...)` on the destination search or dashboard. Multiple templates sharing the same expression are merged into a single IN clause.\n",
"required": [
"kind",
"expression",
"template"
],
"properties": {
"kind": {
"type": "string",
"enum": [
"expressionTemplate"
],
"description": "Filter template kind. Currently only \"expressionTemplate\" is supported.",
"example": "expressionTemplate"
},
"expression": {
"type": "string",
"minLength": 1,
"description": "The column/expression to filter the destination by (e.g. \"ServiceName\").",
"example": "ServiceName"
},
"template": {
"type": "string",
"minLength": 1,
"description": "Value template rendered against the clicked row; supports row column variables in `{{column}}` form (e.g. `{{ServiceName}}`).\n",
"example": "{{ServiceName}}"
}
}
},
"OnClickTarget": {
"description": "Identifies the source (for type=search) or dashboard (for type=dashboard) to link out to. Set mode to \"id\" to resolve a concrete ID, or \"template\" to resolve by rendered name at click time.\n",
"oneOf": [
{
"type": "object",
"required": [
"mode",
"id"
],
"properties": {
"mode": {
"type": "string",
"enum": [
"id"
],
"description": "Target is a single dashboard or log/trace source",
"example": "id"
},
"id": {
"type": "string",
"description": "ID of the target source (for search) or dashboard (for dashboard).",
"example": "65f5e4a3b9e77c001a567890"
}
}
},
{
"type": "object",
"required": [
"mode",
"template"
],
"properties": {
"mode": {
"type": "string",
"enum": [
"template"
],
"description": "Target is matched by name against the template.",
"example": "template"
},
"template": {
"type": "string",
"minLength": 1,
"description": "Name template rendered against the clicked row; supports `{{column}}` variables.\n",
"example": "{{ServiceName}}"
}
}
}
],
"discriminator": {
"propertyName": "mode"
}
},
"OnClickSearch": {
"type": "object",
"required": [
"type",
"target"
],
"description": "Link-out that navigates to the HyperDX search view.",
"properties": {
"type": {
"type": "string",
"enum": [
"search"
],
"description": "OnClick variant discriminator. Must be \"search\" for search link-outs.",
"example": "search"
},
"target": {
"$ref": "#/components/schemas/OnClickTarget",
"description": "The source to navigate to."
},
"whereTemplate": {
"type": "string",
"description": "Optional WHERE clause template applied to the destination search.",
"example": "ServiceName = '{{ServiceName}}'"
},
"whereLanguage": {
"$ref": "#/components/schemas/QueryLanguage",
"description": "Language of the rendered whereTemplate."
},
"filters": {
"type": "array",
"description": "Optional dashboard filter templates rendered against the clicked row.",
"items": {
"$ref": "#/components/schemas/OnClickFilterTemplate"
}
}
}
},
"OnClickDashboard": {
"type": "object",
"required": [
"type",
"target"
],
"description": "Link-out that navigates to a HyperDX dashboard.",
"properties": {
"type": {
"type": "string",
"enum": [
"dashboard"
],
"description": "OnClick variant discriminator. Must be \"dashboard\" for dashboard link-outs.",
"example": "dashboard"
},
"target": {
"$ref": "#/components/schemas/OnClickTarget",
"description": "The dashboard to navigate to."
},
"whereTemplate": {
"type": "string",
"description": "Optional WHERE clause template applied to the destination dashboard.",
"example": "ServiceName = '{{ServiceName}}'"
},
"whereLanguage": {
"$ref": "#/components/schemas/QueryLanguage",
"description": "Language of the rendered whereTemplate."
},
"filters": {
"type": "array",
"description": "Optional dashboard filter templates rendered against the clicked row.",
"items": {
"$ref": "#/components/schemas/OnClickFilterTemplate"
}
}
}
},
"OnClick": {
"description": "Link-out configuration applied when a user clicks a row of a table tile. Only table tiles (builder or raw SQL) currently support onClick. When target.mode is \"id\", the referenced source (type=search) or dashboard (type=dashboard) must already exist for the team.\n",
"oneOf": [
{
"$ref": "#/components/schemas/OnClickSearch"
},
{
"$ref": "#/components/schemas/OnClickDashboard"
}
],
"discriminator": {
"propertyName": "type",
"mapping": {
"search": "#/components/schemas/OnClickSearch",
"dashboard": "#/components/schemas/OnClickDashboard"
}
}
},
"TableChartConfig": {
"description": "Table chart. Omit configType for the builder variant (requires sourceId and select). Set configType to \"sql\" for the Raw SQL variant (requires connectionId and sqlTemplate).\n",
"oneOf": [
Expand Down
Loading