Open source Enterprise Grafana Cloud

Mock series

The Mock series feature generates simulated time series data without making external API calls. Use this feature for testing dashboards, demonstrating visualizations, or developing queries before connecting to real data sources.

Before you begin

  • Ensure you have the Infinity data source installed and configured

Create a mock series query

  1. In the query editor, select Series as the Type.
  2. Select Random Walk or Expression as the Source.
  3. Configure the series options.

Series options

FieldDescription
AliasName for the series. Supports the ${__series.index} variable.
Series CountNumber of series to generate. Default is 1.
ExpressionMathematical expression to generate values (only for Expression source).

Random walk

When you select Random Walk as the source, the plugin generates a time series that simulates random fluctuations. Each data point randomly increases, decreases, or stays the same compared to the previous point.

The step interval adjusts automatically based on your dashboard’s time range:

Time rangeStep interval
Less than 2 days1 minute
2–40 days1 hour
40 days–13 months1 day
More than 13 months1 week

Expression

When you select Expression as the source, you can use mathematical expressions to generate precise data patterns. The plugin uses the mathjs library for expression evaluation.

Available variables

VariableDescription
$iIndex of the current data point (0-based). Same as ${__value.index}.
${__value.index}Index of the current data point (0-based).
${__series.index}Index of the current series (0-based in expressions, 1-based in alias).

Expression examples

ExpressionDescription
$iLinear growth (0, 1, 2, 3, …)
$i * 2Double the index
sin($i / 10) * 100Sine wave
$i ^ 2Quadratic growth
100 + sin($i) * 20Sine wave centered at 100
${__series.index} * 10 + $iDifferent baseline per series

Series alias

The alias field sets the display name for each series. When generating multiple series, you can use the ${__series.index} variable to create unique names.

AliasSeries CountResult
(empty)1Random Walk
(empty)2lorem, ipsum (random words)
Server1Server
Server2Server 1, Server 2
Server ${__series.index} - CPU2Server 1 - CPU, Server 2 - CPU

Data overrides

Use data overrides to conditionally modify values in the generated series. Access this feature through the Advanced Options button.

Override configuration

Each override consists of:

FieldDescription
Value 1Left side of the comparison expression
OperatorComparison operator (=, <, <=, >, >=, !=)
Value 2Right side of the comparison expression
OverrideValue to use when the condition is true

Override variables

VariableDescription
${__value.index}Index of the current data point
${__value.value}Current value of the data point

Override examples

Value 1OperatorValue 2OverrideEffect
${__value.index}>=10nullSet values to null after index 10
${__value.value}>100100Cap values at 100
${__value.index}=50Set the 6th point to 0

Use cases

  • Dashboard development: Test panel layouts and visualizations before connecting real data
  • Demonstrations: Show dashboard capabilities without exposing production data
  • Learning: Experiment with Grafana features using predictable data patterns
  • Alerting tests: Generate specific patterns to test alert conditions