# Kloudfuse 3.5

## Build queries (Graph your data)

The **Graph your data** section defines which metrics are displayed and how they are processed before visualization. These steps apply to most panel types in Kloudfuse.

1. Click **Add Query** to create a new query. Repeat to add multiple queries.
2. Click **Select a metric** to choose the metric name you want to query.
3. Use **From** to select the metric source or namespace.
4. Click **Add Label** to filter results by label values (for example: `pod=web`, `env=prod`).
5. Select an **Aggregation** (for example: `min`, `max`, `sum`, `avg`) to reduce raw samples to one value per time interval.
6. Use the **Select** dropdown (if available) to set the aggregation interval (for example: `1m`, `5m`).
7. Click **Add Functions** to apply transformations to your data.

### Common examples:
- `rate()` — Convert counters to rates.
- `derivative()` — Show the rate of change.
- `moving_avg()` — Smooth short-term fluctuations.
- `scale()` — Multiply values by a constant.

|     |     |
| --- | --- |
|  | Query order determines formula identifiers: the first query = `a`, second = `b`, etc.<br>Assign aliases to queries for more readable formulas. |

## Add formulas

Use formulas to create new series from existing queries.

1. Click **Add Formula** in **Graph your data**.
2. Reference queries by their letter (`a`, `b`, …) or alias.
3. Enter your expression and click **Apply**.

### Example — double a series:
```
2*a
```

### Example — percentage change between two queries:
```
((a - b) / b) * 100
```

|     |     |
| --- | --- |
|  | - Use parentheses to control precedence: `2*(a + b)` vs. `2*a + b`.<br>- If queries return different intervals, the formula engine aligns or interpolates values.<br>- Add a **Label** so the formula appears meaningfully in the legend. |
