Skip to content
Open
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
2 changes: 1 addition & 1 deletion mission-control-chart
Submodule mission-control-chart updated 37 files
+8 −4 .github/workflows/agent-test.yml
+13 −3 .github/workflows/release.yml
+21 −8 .github/workflows/test.yml
+2 −2 .gitignore
+13 −1 Makefile
+12 −0 agent-chart/Chart.lock
+2 −2 agent-chart/Chart.yaml
+14 −1 agent-chart/values.schema.json
+21 −1 agent-chart/values.yaml
+21 −0 chart/Chart.lock
+4 −4 chart/Chart.yaml
+211 −211 chart/README.md
+47 −1 chart/crds/mission-control.flanksource.com_applications.yaml
+874 −0 chart/crds/mission-control.flanksource.com_notifications.yaml
+52 −0 chart/crds/mission-control.flanksource.com_playbooks.yaml
+553 −1 chart/crds/mission-control.flanksource.com_views.yaml
+18 −0 chart/templates/connection.yaml
+3 −0 chart/templates/deployment.yaml
+6 −0 chart/templates/service.yaml
+1 −1 chart/templates/servicemonitor.yaml
+80 −0 chart/templates/views/dashboard/dashboard.yaml
+66 −0 chart/templates/views/dashboard/failing-health-checks.yaml
+81 −0 chart/templates/views/dashboard/notification-send-history.yaml
+165 −0 chart/templates/views/dashboard/recent-changes.yaml
+73 −0 chart/templates/views/dashboard/unhealthy-configs.yaml
+60 −0 chart/templates/views/system/job_history.yaml
+104 −0 chart/templates/views/system/mission-control-pods-non-prometheus.yaml
+187 −0 chart/templates/views/system/mission-control-pods.yaml
+97 −0 chart/templates/views/system/system.yaml
+43 −2 chart/test/basic_test.go
+225 −39 chart/values.schema.json
+217 −2 chart/values.yaml
+302 −1 crd-chart/templates/configs.flanksource.com_scrapeconfigs.yaml
+47 −1 crd-chart/templates/mission-control.flanksource.com_applications.yaml
+874 −0 crd-chart/templates/mission-control.flanksource.com_notifications.yaml
+52 −0 crd-chart/templates/mission-control.flanksource.com_playbooks.yaml
+553 −1 crd-chart/templates/mission-control.flanksource.com_views.yaml
34 changes: 32 additions & 2 deletions mission-control/docs/guide/views/concepts/templating.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 28 additions & 0 deletions mission-control/docs/guide/views/panels/properties.md
Original file line number Diff line number Diff line change
@@ -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
```
29 changes: 29 additions & 0 deletions mission-control/docs/guide/views/panels/timeseries.md
Original file line number Diff line number Diff line change
@@ -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=<rootDir>/modules/mission-control/fixtures/views/panels/timeseries.yaml

```
146 changes: 146 additions & 0 deletions mission-control/docs/guide/views/queries/http.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
---
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 title="recipes-http.yaml" file=<rootDir>/modules/mission-control/fixtures/views/recipes-http.yaml

```

## Configuration

| 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

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
```

## 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=<rootDir>/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=<rootDir>/modules/mission-control/fixtures/views/http-post-body.yaml

```

Template variables available in the body:
- `$(var.<name>)` - 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
```


18 changes: 18 additions & 0 deletions mission-control/docs/guide/views/table/columns/decimal.md
Original file line number Diff line number Diff line change
@@ -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: '$'
```
11 changes: 11 additions & 0 deletions mission-control/docs/guide/views/table/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
Loading
Loading