From b46bb6e45cef6d1a0e8e92127df1f03f9accb5f9 Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Wed, 4 Feb 2026 16:41:10 +0545 Subject: [PATCH 1/8] docs: add HTTP query documentation for views - Added mission-control/docs/guide/views/queries/http.md with usage guide and configuration details. - Updated mission-control/docs/reference/views/_view.mdx to include http in the Query schema and reference section. --- .../docs/guide/views/queries/http.md | 96 +++++++++++++++++++ .../docs/reference/views/_view.mdx | 63 ++++++++++++ 2 files changed, 159 insertions(+) create mode 100644 mission-control/docs/guide/views/queries/http.md diff --git a/mission-control/docs/guide/views/queries/http.md b/mission-control/docs/guide/views/queries/http.md new file mode 100644 index 00000000..b7e960a5 --- /dev/null +++ b/mission-control/docs/guide/views/queries/http.md @@ -0,0 +1,96 @@ +--- +title: HTTP +sidebar_custom_props: + icon: mdi:web +--- + +The `http` query allows you to fetch data from external APIs and use it within your view. It supports RESTful APIs and can extract data using JSONPath. + +## Example + +```yaml +apiVersion: mission-control.flanksource.com/v1 +kind: View +metadata: + name: github-stars +spec: + queries: + repos: + http: + url: https://api.github.com/users/flanksource/repos + headers: + - name: User-Agent + value: Mission-Control + columns: + name: string + stargazers_count: number + html_url: url + + columns: + - name: name + type: string + - name: stars + type: number + - name: link + type: url + + mapping: + name: row.name + stars: row.stargazers_count + link: row.html_url +``` + +## Configuration + +| Field | Type | Description | +|Str|Str|Str| +| `url` | string | The URL to send the request to. | +| `method` | string | HTTP method (GET, POST, PUT, DELETE, PATCH). Default: `GET`. | +| `body` | string | Request body for POST/PUT/PATCH requests. Supports templating. | +| `jsonpath` | string | JSONPath expression to extract specific data from the response. | +| `headers` | list | List of headers to include in the request. | +| `connection` | string | Reference to a connection for authentication. | +| `username` | [EnvVar](/docs/reference/env-var) | Basic auth username. | +| `password` | [EnvVar](/docs/reference/env-var) | Basic auth password. | +| `bearer` | [EnvVar](/docs/reference/env-var) | Bearer token. | + +### JSONPath Extraction + +If the API returns a nested structure, you can use `jsonpath` to extract the list of items you want to treat as rows. + +For example, if the API returns: + +```json +{ + "status": "success", + "data": { + "items": [ + {"id": 1, "name": "A"}, + {"id": 2, "name": "B"} + ] + } +} +``` + +Use `jsonpath: "$.data.items"` to extract the array. + +### Authentication + +You can provide authentication details inline or reference a stored connection. + +**Inline Basic Auth:** +```yaml +http: + url: https://api.example.com/data + username: + value: myuser + password: + value: mypass +``` + +**Using a Connection:** +```yaml +http: + url: https://api.example.com/data + connection: connection://my-api-creds +``` diff --git a/mission-control/docs/reference/views/_view.mdx b/mission-control/docs/reference/views/_view.mdx index 55509d87..d11167d4 100644 --- a/mission-control/docs/reference/views/_view.mdx +++ b/mission-control/docs/reference/views/_view.mdx @@ -113,6 +113,11 @@ Query definition for data sources. description: "Run a SQL query against a configured connection (PostgreSQL, MySQL, SQL Server)", scheme: "[SQL query](/mission-control/guide/views/queries/sql)" }, + { + field: "http", + description: "Query external APIs via HTTP", + scheme: "[HTTP Query](#http-query)" + }, { field: "prometheus", description: "Query time-series data from Prometheus", @@ -122,6 +127,64 @@ Query definition for data sources. field: "viewTableSelector", description: "Read cached rows from another view table", scheme: "[View Table Selector](#view-table-selector)" + }, + { + field: "columns", + description: "Define column types for the query results (useful for HTTP/Prometheus)", + scheme: "map[string]ColumnType" + } +]}/> + +#### HTTP Query + +Query configuration for HTTP requests. + + From abdf509994948b74cc3f7fd7719d66710d2037b2 Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Wed, 4 Feb 2026 16:44:49 +0545 Subject: [PATCH 2/8] submodules update --- mission-control-chart | 2 +- modules/canary-checker | 2 +- modules/config-db | 2 +- modules/duty | 2 +- modules/mission-control | 2 +- modules/mission-control-chart | 2 +- modules/mission-control-registry | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mission-control-chart b/mission-control-chart index 95e64d81..f1041d21 160000 --- a/mission-control-chart +++ b/mission-control-chart @@ -1 +1 @@ -Subproject commit 95e64d81bd9522d98cd389f36400c7d0b6499b2a +Subproject commit f1041d21c96ce85ebe1e5b72e5b9b85e049ea61f diff --git a/modules/canary-checker b/modules/canary-checker index 989c9d6c..9597e54d 160000 --- a/modules/canary-checker +++ b/modules/canary-checker @@ -1 +1 @@ -Subproject commit 989c9d6cb1f395f97010de874eab8c706096a94b +Subproject commit 9597e54d23f361bd9ba60a3f8fc9511482e96c7c diff --git a/modules/config-db b/modules/config-db index bdc31c21..241712bd 160000 --- a/modules/config-db +++ b/modules/config-db @@ -1 +1 @@ -Subproject commit bdc31c213cb2936337a9e88bdddef8e058e5f4b2 +Subproject commit 241712bdc6a46ac544e52cc86f7ea382699a448d diff --git a/modules/duty b/modules/duty index 36ae9072..328f338f 160000 --- a/modules/duty +++ b/modules/duty @@ -1 +1 @@ -Subproject commit 36ae907273a73e42204d5ac0057028d38c230478 +Subproject commit 328f338fd43d4dd888b36a74bebbfebf7a222fa1 diff --git a/modules/mission-control b/modules/mission-control index b4cf1bfe..f1ea4396 160000 --- a/modules/mission-control +++ b/modules/mission-control @@ -1 +1 @@ -Subproject commit b4cf1bfe9c1f2197f98497977c72c933b2192365 +Subproject commit f1ea43969b5139e7e976fda900caf01817c7bd51 diff --git a/modules/mission-control-chart b/modules/mission-control-chart index ce11edea..f1041d21 160000 --- a/modules/mission-control-chart +++ b/modules/mission-control-chart @@ -1 +1 @@ -Subproject commit ce11edeaf72c85033bd9ec6ce7bf3905f94b14ad +Subproject commit f1041d21c96ce85ebe1e5b72e5b9b85e049ea61f diff --git a/modules/mission-control-registry b/modules/mission-control-registry index bd2475fc..c0d9678f 160000 --- a/modules/mission-control-registry +++ b/modules/mission-control-registry @@ -1 +1 @@ -Subproject commit bd2475fce1114b60108590cd4776d73b5bf9a943 +Subproject commit c0d9678f764ae3fc7b252a0ce347b8190d1e7315 From 904546f9cc3616867a9b49b2ee1d87be265a1151 Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Wed, 4 Feb 2026 16:54:05 +0545 Subject: [PATCH 3/8] docs: add missing view documentation - Document display.table configuration in _view.mdx - Add properties to panel types list in _view.mdx - Create guide for properties panel - Create guide for timeseries panel - Create guide for decimal column type - Format http.md (via make fmt) --- .../docs/guide/views/panels/properties.md | 28 ++++++++++++++++++ .../docs/guide/views/panels/timeseries.md | 29 +++++++++++++++++++ .../docs/guide/views/queries/http.md | 28 +++++++++--------- .../docs/guide/views/table/columns/decimal.md | 18 ++++++++++++ .../docs/reference/views/_view.mdx | 29 ++++++++++++++++++- 5 files changed, 118 insertions(+), 14 deletions(-) create mode 100644 mission-control/docs/guide/views/panels/properties.md create mode 100644 mission-control/docs/guide/views/panels/timeseries.md create mode 100644 mission-control/docs/guide/views/table/columns/decimal.md diff --git a/mission-control/docs/guide/views/panels/properties.md b/mission-control/docs/guide/views/panels/properties.md new file mode 100644 index 00000000..9156b6a0 --- /dev/null +++ b/mission-control/docs/guide/views/panels/properties.md @@ -0,0 +1,28 @@ +--- +title: Properties +sidebar_custom_props: + icon: mdi:form-textbox +--- + +The `properties` panel displays a single row of data as a vertical list of key-value pairs. This is useful for showing details of a specific entity. + +## Configuration + +This panel type does not require any specific configuration. It uses the standard panel definition. + +## Behavior + +- Displays column names as labels and their values from the first row of the query result. +- Useful when the query returns a single record. + +## Example + +```yaml +panels: + - name: Deployment Details + type: properties + query: | + SELECT name, status, created_at, version + FROM deployments + LIMIT 1 +``` diff --git a/mission-control/docs/guide/views/panels/timeseries.md b/mission-control/docs/guide/views/panels/timeseries.md new file mode 100644 index 00000000..0af74214 --- /dev/null +++ b/mission-control/docs/guide/views/panels/timeseries.md @@ -0,0 +1,29 @@ +--- +title: Time Series +sidebar_custom_props: + icon: mdi:chart-timeline-variant +--- + +The `timeseries` panel visualizes data over time using line, area, or point charts. + +## Properties + +| Property | Type | Description | +| ---------- | ------ | ---------------------------------------------------------------------- | +| `timeKey` | string | Field name containing the timestamp (default: infers timestamp column) | +| `valueKey` | string | Field name containing the numeric value (for single-series charts) | +| `style` | string | Visualization style: `lines` (default), `area`, `points` | +| `legend` | object | Legend configuration (see below) | + +## Legend Configuration + +| Property | Type | Description | +| -------- | ------- | -------------------------------------------------------- | +| `enable` | boolean | Show or hide legend (default: `true`) | +| `layout` | string | Legend orientation: `horizontal` (default) or `vertical` | + +## Example + +```yaml title="timeseries.yaml" file=/modules/mission-control/fixtures/views/panels/timeseries.yaml + +``` diff --git a/mission-control/docs/guide/views/queries/http.md b/mission-control/docs/guide/views/queries/http.md index b7e960a5..4d478e13 100644 --- a/mission-control/docs/guide/views/queries/http.md +++ b/mission-control/docs/guide/views/queries/http.md @@ -42,17 +42,17 @@ spec: ## Configuration -| Field | Type | Description | -|Str|Str|Str| -| `url` | string | The URL to send the request to. | -| `method` | string | HTTP method (GET, POST, PUT, DELETE, PATCH). Default: `GET`. | -| `body` | string | Request body for POST/PUT/PATCH requests. Supports templating. | -| `jsonpath` | string | JSONPath expression to extract specific data from the response. | -| `headers` | list | List of headers to include in the request. | -| `connection` | string | Reference to a connection for authentication. | -| `username` | [EnvVar](/docs/reference/env-var) | Basic auth username. | -| `password` | [EnvVar](/docs/reference/env-var) | Basic auth password. | -| `bearer` | [EnvVar](/docs/reference/env-var) | Bearer token. | +| Field | Type | Description | +| ------------ | --------------------------------- | --------------------------------------------------------------- | +| `url` | string | The URL to send the request to. | +| `method` | string | HTTP method (GET, POST, PUT, DELETE, PATCH). Default: `GET`. | +| `body` | string | Request body for POST/PUT/PATCH requests. Supports templating. | +| `jsonpath` | string | JSONPath expression to extract specific data from the response. | +| `headers` | list | List of headers to include in the request. | +| `connection` | string | Reference to a connection for authentication. | +| `username` | [EnvVar](/docs/reference/env-var) | Basic auth username. | +| `password` | [EnvVar](/docs/reference/env-var) | Basic auth password. | +| `bearer` | [EnvVar](/docs/reference/env-var) | Bearer token. | ### JSONPath Extraction @@ -65,8 +65,8 @@ For example, if the API returns: "status": "success", "data": { "items": [ - {"id": 1, "name": "A"}, - {"id": 2, "name": "B"} + { "id": 1, "name": "A" }, + { "id": 2, "name": "B" } ] } } @@ -79,6 +79,7 @@ Use `jsonpath: "$.data.items"` to extract the array. You can provide authentication details inline or reference a stored connection. **Inline Basic Auth:** + ```yaml http: url: https://api.example.com/data @@ -89,6 +90,7 @@ http: ``` **Using a Connection:** + ```yaml http: url: https://api.example.com/data diff --git a/mission-control/docs/guide/views/table/columns/decimal.md b/mission-control/docs/guide/views/table/columns/decimal.md new file mode 100644 index 00000000..c9202d46 --- /dev/null +++ b/mission-control/docs/guide/views/table/columns/decimal.md @@ -0,0 +1,18 @@ +--- +title: Decimal +sidebar_custom_props: + icon: mdi:decimal +--- + +The `decimal` column type displays numeric values with support for high precision. It is similar to `number` but explicitly intended for decimal values. + +## Example + +```yaml +columns: + - name: error_rate + type: decimal + - name: cost + type: decimal + unit: '$' +``` diff --git a/mission-control/docs/reference/views/_view.mdx b/mission-control/docs/reference/views/_view.mdx index d11167d4..3a376e45 100644 --- a/mission-control/docs/reference/views/_view.mdx +++ b/mission-control/docs/reference/views/_view.mdx @@ -29,6 +29,11 @@ description: "Default card layout for the view (body column count and whether cards are the default mode)", scheme: "[DisplayCard](#view-card-layout)" }, + { + field: "display.table", + description: "Default table layout for the view (sort order and page size)", + scheme: "[DisplayTable](#view-table-layout)" + }, { field: "display.plugins[]", description: "Attach the view as a tab on matching config items with templated variables extracted from the config", @@ -324,7 +329,7 @@ Panel definition for interactive visualizations. field: "type", required: true, description: "Type of panel visualization", - scheme: "`piechart`, `table`, `text`, `number`, `duration`, `gauge`, `bargauge`, `timeseries`" + scheme: "`piechart`, `table`, `text`, `number`, `duration`, `gauge`, `bargauge`, `timeseries`, `properties`" }, { field: "query", @@ -356,6 +361,11 @@ Panel definition for interactive visualizations. field: "timeseries", description: "Configuration for timeseries panels", scheme: "[Timeseries Configuration](#timeseries-configuration)" + }, + { + field: "properties", + description: "Properties panel renders query results as key-value pairs (no specific configuration)", + scheme: "object" } ]}/> @@ -489,6 +499,23 @@ Configuration for timeseries panels (API-level; UI rendering in progress). } ]}/> +### View Table Layout + +`display.table` controls the default table layout for the view. + + + ### View Card Layout `display.card` controls the default card layout for tables with card positioning. Cards become the default view when `default: true` and at least one column defines `card.position` (or legacy `cardPosition`). Use `columns[].card.useForAccent` to color the card accent based on a column's value (status/health heuristics in the UI): From 927be4c6aba95c59fb88c2ceac2980aedd22bdb2 Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Wed, 4 Feb 2026 16:59:12 +0545 Subject: [PATCH 4/8] docs: improve table layout and query column types documentation - Guide: Add section on Default Sort and Page Size (display.table) - Reference: Add validation requirement note for in Prometheus/HTTP queries --- mission-control/docs/guide/views/table/index.md | 11 +++++++++++ mission-control/docs/reference/views/_view.mdx | 1 + 2 files changed, 12 insertions(+) diff --git a/mission-control/docs/guide/views/table/index.md b/mission-control/docs/guide/views/table/index.md index 4632ddd4..bf206224 100644 --- a/mission-control/docs/guide/views/table/index.md +++ b/mission-control/docs/guide/views/table/index.md @@ -38,6 +38,17 @@ Use `merge` to combine configs with Prometheus metrics into one table: ``` +## Default Sort and Page Size + +Use `display.table` to control the initial sort order and page size: + +```yaml +display: + table: + sort: -cpu_usage # Sort by cpu_usage descending + size: 50 # Show 50 rows per page +``` + ## Best Practices - Always set `primaryKey` on at least one column (composite keys allowed). diff --git a/mission-control/docs/reference/views/_view.mdx b/mission-control/docs/reference/views/_view.mdx index 3a376e45..101b1808 100644 --- a/mission-control/docs/reference/views/_view.mdx +++ b/mission-control/docs/reference/views/_view.mdx @@ -96,6 +96,7 @@ - **At least one query**: Views must define at least one named query (unless the view only renders `sections`) - **Output definition**: Views must have either `panels` or `columns` (or both) - **Merge requirement**: When using multiple queries with table output (columns only), you must provide a `merge` SQL query +- **Column definition**: When using Prometheus or HTTP queries, `columns` map must be defined to generate the table schema ::: ### Query From 866a60f773b01a0f764f656e00f1733a5614d52f Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Wed, 4 Feb 2026 17:03:43 +0545 Subject: [PATCH 5/8] docs: update view reference with missing schemas - Add `ViewSection`, `ChangesUIFilters`, and `ConfigsUIFilters` schema tables - Correct `ViewColumnDef` type enum by removing `url` and `badge` (they are properties) - Add `badge` property to column definition - Document `display.table` layout options - Add `properties` panel type to panel definition - Add `http` query and `columns` map to query definition --- .../docs/reference/views/_view.mdx | 103 +++++++++++++++++- 1 file changed, 101 insertions(+), 2 deletions(-) diff --git a/mission-control/docs/reference/views/_view.mdx b/mission-control/docs/reference/views/_view.mdx index 101b1808..65e01d46 100644 --- a/mission-control/docs/reference/views/_view.mdx +++ b/mission-control/docs/reference/views/_view.mdx @@ -247,7 +247,7 @@ Column definition for view tables with data types and visualization properties. field: "type", required: true, description: "Data type that determines formatting and visualization", - scheme: "`string`, `number`, `boolean`, `datetime`, `duration`, `health`, `status`, `gauge`, `bytes`, `decimal`, `millicore`, `url`, `badge`, `config_item`, `labels`" + scheme: "`string`, `number`, `boolean`, `datetime`, `duration`, `health`, `status`, `gauge`, `bytes`, `decimal`, `millicore`, `config_item`, `labels`" }, { field: "primaryKey", @@ -279,6 +279,11 @@ Column definition for view tables with data types and visualization properties. description: "Link to configs, other views, or custom URLs using CEL/Go templates", scheme: "[ColumnURL](#column-urls)" }, + { + field: "badge", + description: "Badge configuration for the column", + scheme: "BadgeConfig" + }, { field: "unit", description: "Unit string appended to values (e.g., %, bytes, millicore)", @@ -519,7 +524,7 @@ Configuration for timeseries panels (API-level; UI rendering in progress). ### View Card Layout -`display.card` controls the default card layout for tables with card positioning. Cards become the default view when `default: true` and at least one column defines `card.position` (or legacy `cardPosition`). Use `columns[].card.useForAccent` to color the card accent based on a column's value (status/health heuristics in the UI): +`display.card` controls the default card layout for the view (when `default: true`, cards are shown instead of the table). + +#### Changes UI Filters + + + +#### Configs UI Filters + + + ```yaml title="workload-overview.yaml" file=/modules/mission-control/fixtures/views/workload-overview.yaml {6-24} ``` From 4950f63a6a8f8390da4c8d8b59acbc3b7182b5e5 Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Wed, 4 Feb 2026 18:29:25 +0545 Subject: [PATCH 6/8] docs: improve HTTP query documentation with fixtures - Add Connection field section explaining hydration process - Add Templating support section with body examples - Add Response size limits section with property configuration - Fix templating docs: values/valueFrom is required, not optional - Import examples from fixtures using file= syntax --- .../docs/guide/views/concepts/templating.md | 34 +++++- .../docs/guide/views/queries/http.md | 108 +++++++++++++----- 2 files changed, 110 insertions(+), 32 deletions(-) diff --git a/mission-control/docs/guide/views/concepts/templating.md b/mission-control/docs/guide/views/concepts/templating.md index 016c168b..4a8e7f74 100644 --- a/mission-control/docs/guide/views/concepts/templating.md +++ b/mission-control/docs/guide/views/concepts/templating.md @@ -96,16 +96,46 @@ templating: | -------- | ------ | ----------------------------------------------------------------- | | `key` | string | Unique identifier for the variable (used in template expressions) | | `label` | string | Display name shown to users | +| `values` | array | Static list of options for the dropdown | +| `valueFrom` | object | Dynamic options from config items (alternative to `values`) | + +:::note One of values or valueFrom is required +Every variable must have exactly one of `values` (static list) or `valueFrom` (dynamic from configs) to populate the dropdown options. These fields are mutually exclusive. +::: ### Optional Properties | Property | Type | Description | | ----------- | ------ | -------------------------------------------------------------------- | | `default` | string | Default value when view loads | -| `values` | array | Static list of options (mutually exclusive with `valueFrom`) | -| `valueFrom` | object | Dynamic options from config items (mutually exclusive with `values`) | | `dependsOn` | array | List of variable keys this depends on | +## valueFrom Structure + +When using dynamic values from config items, `valueFrom` has the following structure: + +| Property | Type | Description | +|----------|------|-------------| +| `config` | object | Config selector to find matching config items | +| `config.types` | array | List of config types to match (e.g., `['Kubernetes::Cluster']`) | +| `config.tagSelector` | string | Tag selector for filtering configs (optional) | +| `config.search` | string | Free text search for configs (optional) | +| `config.limit` | int | Maximum number of configs to return (optional, default: no limit) | +| `label` | string | CEL expression for dropdown display labels (optional, defaults to config name) | +| `value` | string | CEL expression for dropdown values (optional, defaults to config name) | + +**Example:** + +```yaml +valueFrom: + config: + types: ['Kubernetes::Pod'] + tagSelector: 'cluster=production' + limit: 50 + label: 'row.name + " (" + row.tags.namespace + ")"' # Display: "nginx (default)" + value: 'row.name' # Value used in queries: "nginx" +``` + ## Variable Types ### Static Values Variable diff --git a/mission-control/docs/guide/views/queries/http.md b/mission-control/docs/guide/views/queries/http.md index 4d478e13..490a0153 100644 --- a/mission-control/docs/guide/views/queries/http.md +++ b/mission-control/docs/guide/views/queries/http.md @@ -8,36 +8,8 @@ The `http` query allows you to fetch data from external APIs and use it within y ## Example -```yaml -apiVersion: mission-control.flanksource.com/v1 -kind: View -metadata: - name: github-stars -spec: - queries: - repos: - http: - url: https://api.github.com/users/flanksource/repos - headers: - - name: User-Agent - value: Mission-Control - columns: - name: string - stargazers_count: number - html_url: url - - columns: - - name: name - type: string - - name: stars - type: number - - name: link - type: url - - mapping: - name: row.name - stars: row.stargazers_count - link: row.html_url +```yaml title="recipes-http.yaml" file=/modules/mission-control/fixtures/views/recipes-http.yaml + ``` ## Configuration @@ -96,3 +68,79 @@ http: url: https://api.example.com/data connection: connection://my-api-creds ``` + +## Connection Field + +The `connection` field references a stored [Connection](/mission-control/guide/configurations/connections) resource. When specified, Mission Control hydrates the connection by: + +1. Looking up the connection by name in the view's namespace +2. Extracting authentication details (username, password, bearer token, OAuth credentials) +3. Applying TLS configuration (CA, cert, key, insecure skip verify) +4. Merging custom headers defined in the connection +5. Resolving any environment variable references in connection properties + +Connection properties that can be inherited: +- `url` - Base URL for the API +- `username` / `password` - HTTP Basic Authentication +- `bearer` - Bearer token for token-based auth +- `oauth` - OAuth2 credentials (clientID, clientSecret, tokenURL, scopes, params) +- `tls` - TLS configuration (ca, cert, key, insecureSkipVerify) +- `headers` - Additional HTTP headers + +**Example with connection:** + +```yaml title="http-connection.yaml" file=/modules/mission-control/fixtures/views/http-connection.yaml + +``` + +## Templating Support + +The `body` field supports Go templating, allowing dynamic request payloads: + +```yaml title="http-post-body.yaml" file=/modules/mission-control/fixtures/views/http-post-body.yaml + +``` + +Template variables available in the body: +- `$(var.)` - View template variables +- Environment variables via `$(ENV_VAR_NAME)` + +## Response Size Limits + +By default, HTTP responses are limited to **25 MB** to prevent memory issues with large payloads. You can configure this limit using the `view.http.body.max_size_bytes` property. + +### Configuring the Limit + +Set the property via environment variable or configuration: + +```yaml +# Increase limit to 50 MB +properties: + view.http.body.max_size_bytes: "52428800" +``` + +### Size Limit Error Handling + +When a response exceeds the configured limit, the view returns an error with details: + +``` +http response body size (32 MB) exceeds maximum allowed (25 MB); increase limit via property "view.http.body.max_size_bytes" +``` + +To resolve: +1. Increase the limit via the property (if you have sufficient memory) +2. Use pagination in the API request to fetch smaller chunks +3. Apply filters in the API request to reduce response size +4. Use `jsonpath` to extract only the needed subset of data + +**Example with pagination:** + +```yaml +queries: + paged-data: + http: + url: https://api.example.com/items?page=1&per_page=100 + connection: connection://my-api +``` + + From 2b4516e3cf9cd9a4320c2e8650c440727dd11058 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Feb 2026 06:50:05 +0000 Subject: [PATCH 7/8] Initial plan From 3b45ad86c5f7be6b4cdb4c007b1df33533bee903 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Feb 2026 06:58:28 +0000 Subject: [PATCH 8/8] fix: resolve lint errors and build issues Co-authored-by: moshloop <1489660+moshloop@users.noreply.github.com> --- .../docs/guide/views/concepts/templating.md | 43 ++++++++++--------- .../docs/guide/views/queries/http.md | 28 +++++++++--- 2 files changed, 43 insertions(+), 28 deletions(-) diff --git a/mission-control/docs/guide/views/concepts/templating.md b/mission-control/docs/guide/views/concepts/templating.md index 4a8e7f74..cf79e8b5 100644 --- a/mission-control/docs/guide/views/concepts/templating.md +++ b/mission-control/docs/guide/views/concepts/templating.md @@ -92,12 +92,12 @@ templating: ### Required Properties -| Property | Type | Description | -| -------- | ------ | ----------------------------------------------------------------- | -| `key` | string | Unique identifier for the variable (used in template expressions) | -| `label` | string | Display name shown to users | -| `values` | array | Static list of options for the dropdown | -| `valueFrom` | object | Dynamic options from config items (alternative to `values`) | +| Property | Type | Description | +| ----------- | ------ | ----------------------------------------------------------------- | +| `key` | string | Unique identifier for the variable (used in template expressions) | +| `label` | string | Display name shown to users | +| `values` | array | Static list of options for the dropdown | +| `valueFrom` | object | Dynamic options from config items (alternative to `values`) | :::note One of values or valueFrom is required Every variable must have exactly one of `values` (static list) or `valueFrom` (dynamic from configs) to populate the dropdown options. These fields are mutually exclusive. @@ -105,24 +105,24 @@ Every variable must have exactly one of `values` (static list) or `valueFrom` (d ### Optional Properties -| Property | Type | Description | -| ----------- | ------ | -------------------------------------------------------------------- | -| `default` | string | Default value when view loads | -| `dependsOn` | array | List of variable keys this depends on | +| Property | Type | Description | +| ----------- | ------ | ------------------------------------- | +| `default` | string | Default value when view loads | +| `dependsOn` | array | List of variable keys this depends on | ## valueFrom Structure When using dynamic values from config items, `valueFrom` has the following structure: -| Property | Type | Description | -|----------|------|-------------| -| `config` | object | Config selector to find matching config items | -| `config.types` | array | List of config types to match (e.g., `['Kubernetes::Cluster']`) | -| `config.tagSelector` | string | Tag selector for filtering configs (optional) | -| `config.search` | string | Free text search for configs (optional) | -| `config.limit` | int | Maximum number of configs to return (optional, default: no limit) | -| `label` | string | CEL expression for dropdown display labels (optional, defaults to config name) | -| `value` | string | CEL expression for dropdown values (optional, defaults to config name) | +| Property | Type | Description | +| -------------------- | ------ | ------------------------------------------------------------------------------ | +| `config` | object | Config selector to find matching config items | +| `config.types` | array | List of config types to match (e.g., `['Kubernetes::Cluster']`) | +| `config.tagSelector` | string | Tag selector for filtering configs (optional) | +| `config.search` | string | Free text search for configs (optional) | +| `config.limit` | int | Maximum number of configs to return (optional, default: no limit) | +| `label` | string | CEL expression for dropdown display labels (optional, defaults to config name) | +| `value` | string | CEL expression for dropdown values (optional, defaults to config name) | **Example:** @@ -132,8 +132,8 @@ valueFrom: types: ['Kubernetes::Pod'] tagSelector: 'cluster=production' limit: 50 - label: 'row.name + " (" + row.tags.namespace + ")"' # Display: "nginx (default)" - value: 'row.name' # Value used in queries: "nginx" + label: 'row.name + " (" + row.tags.namespace + ")"' # Display: "nginx (default)" + value: 'row.name' # Value used in queries: "nginx" ``` ## Variable Types @@ -468,6 +468,7 @@ spec: ``` 5. **Limit dynamic variable options** - Add reasonable limits to prevent huge lists + ```yaml valueFrom: config: diff --git a/mission-control/docs/guide/views/queries/http.md b/mission-control/docs/guide/views/queries/http.md index 490a0153..6dd7f1a1 100644 --- a/mission-control/docs/guide/views/queries/http.md +++ b/mission-control/docs/guide/views/queries/http.md @@ -80,6 +80,7 @@ The `connection` field references a stored [Connection](/mission-control/guide/c 5. Resolving any environment variable references in connection properties Connection properties that can be inherited: + - `url` - Base URL for the API - `username` / `password` - HTTP Basic Authentication - `bearer` - Bearer token for token-based auth @@ -89,19 +90,33 @@ Connection properties that can be inherited: **Example with connection:** -```yaml title="http-connection.yaml" file=/modules/mission-control/fixtures/views/http-connection.yaml - +```yaml +queries: + users: + http: + url: /api/users + connection: connection://my-api ``` ## Templating Support The `body` field supports Go templating, allowing dynamic request payloads: -```yaml title="http-post-body.yaml" file=/modules/mission-control/fixtures/views/http-post-body.yaml - +```yaml +queries: + search: + http: + url: https://api.example.com/search + method: POST + body: | + { + "query": "$(var.searchTerm)", + "limit": 100 + } ``` Template variables available in the body: + - `$(var.)` - View template variables - Environment variables via `$(ENV_VAR_NAME)` @@ -116,7 +131,7 @@ Set the property via environment variable or configuration: ```yaml # Increase limit to 50 MB properties: - view.http.body.max_size_bytes: "52428800" + view.http.body.max_size_bytes: '52428800' ``` ### Size Limit Error Handling @@ -128,6 +143,7 @@ http response body size (32 MB) exceeds maximum allowed (25 MB); increase limit ``` To resolve: + 1. Increase the limit via the property (if you have sufficient memory) 2. Use pagination in the API request to fetch smaller chunks 3. Apply filters in the API request to reduce response size @@ -142,5 +158,3 @@ queries: url: https://api.example.com/items?page=1&per_page=100 connection: connection://my-api ``` - -