Skip to content
Closed
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: 2 additions & 0 deletions fern/config-as-code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ See the [PR checks guide](https://github.com/VapiAI/gitops/blob/main/docs/guides

You can keep using the dashboard alongside the repository. `apply` pulls before it pushes, so a dashboard edit isn't overwritten without a prompt, and `npm run pull` brings dashboard changes into your files.

`npm run pull -- my-org --force` overwrites local files without direction labels or three-way conflict reporting. Run a plain pull first to review drift. Outside CI, a forced pull prints a warning and waits two seconds so you can abort. Setting `VAPI_GITOPS_FORCE_PAUSE=off` skips both that warning and the pause; it does not make the overwrite safer. Setup skips them automatically for its own pulls, and `CI=true` also skips them.

Vapi's built-in [versioning](/assistants/versioning) also works alongside it. Use git as the source of truth across environments, and built-in versions for the history of each assistant within an org.

## Learn more
Expand Down
25 changes: 21 additions & 4 deletions fern/observability/boards-quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ Filter data to focus on specific segments or conditions.

## Step 5: Create calculated metrics

Build custom metrics using formulas to calculate rates, averages, and more. Formulas use [Math.js](https://mathjs.org/) syntax for calculations.
Build custom metrics using formulas to calculate rates, averages, and more. Formulas use a restricted subset of [Math.js](https://mathjs.org/) syntax that produces a single numeric result. Line, bar, and pie insights support up to **20 formulas** each.

<Steps>
<Step title="Create a conversion rate metric">
Expand Down Expand Up @@ -250,11 +250,28 @@ Common calculated metrics you can create using Math.js syntax:
```

<Note>
**Formula editor features:** - Syntax highlighting - Variable autocomplete -
Validation on preview - Supports all [Math.js](https://mathjs.org/)
operations: `+`, `-`, `*`, `/`, `%`, parentheses, and more
The formula editor supports syntax highlighting, variable autocomplete, and validation on preview. Not all Math.js operations are supported.
</Note>

### Formula syntax and validation

Every formula must reference at least one configured query using `{{query_name}}`, `{{['query name']}}`, or `{{["query name"]}}`. Names must match exactly, including case. Whitespace around a bare name is trimmed; whitespace inside a quoted name is preserved. These are query placeholders, not general Liquid templates.

Supported syntax:

- Numbers, parentheses, arithmetic (`+`, `-`, `*`, `/`, `^`, `%`), comparisons (`<`, `>`, `<=`, `>=`, `==`, `!=`), and conditional expressions (`condition ? value : value`).
- Constants: `pi`, `e`, `NaN`, `null`, and `Infinity`.
- Functions: `abs`, `acos`, `asin`, `atan`, `atan2`, `cbrt`, `ceil`, `cos`, `cosh`, `exp`, `floor`, `log`, `log10`, `log2`, `max`, `mean`, `median`, `min`, `mod`, `pow`, `round`, `sign`, `sin`, `sinh`, `sqrt`, `sum`, `tan`, and `tanh`.
- Literal lists only as direct arguments to `max`, `min`, `sum`, `mean`, or `median`, such as `max([{{bookings}}, 1])`. Standalone lists, matrices, ranges, property access, assignments, and function definitions are not supported. Expressions may contain at most two `%` characters; use `mod` for additional modulo operations.

Invalid syntax, unsupported operations, missing placeholders, or unknown query names reject the save. Formulas are checked again when run. If a formula fails evaluation or produces an invalid result (such as `NaN` or a complex number), the insight run returns an error rather than substituting the raw query result. Division by zero returns `0`; null, empty, or non-finite query values are substituted as `0`. Boolean results become `1` or `0`, and null or infinite results become `0`.

Query names must be unique. Names inherited from JavaScript's `Object.prototype`, such as `constructor`, `toString`, `valueOf`, and `hasOwnProperty`, and the name `__proto__` are reserved and rejected.

### Chart result limits

Chart-ready results (`format: "recharts"`) are limited to **400,000 cells** across the run's query and formula results. For time-series charts, cells are time buckets multiplied by series, summed across results. The time-bucket upper bound must also not exceed **10,000**. Oversized results return an error instead of being silently truncated. Use a shorter time range, a larger time step, or fewer group-by values. Run-time time-range overrides must also satisfy the limits for the effective time step.

## Step 6: Organize your dashboard

Arrange insights for optimal visual hierarchy and readability.
Expand Down
Loading