Best Practice for comparing experiments with dynamic time alignment on timeseries

Hello Grafana community,

I’m working on a motor control calibration system and need help with visualizing experiment comparisons. Looking for best practices or plugin recommendations.

My Setup:

  • Grafana (v10.2.2) with InfluxDB v2.7.12 (Flux)

  • Data: Position measurements from motor calibration runs

  • Each “experiment” is a self-contained test run stored with tags: exp_id, direction (forward/reverse), speed_pct

  • Each experiment has a rel_ms field (relative time from experiment start, always starts at 0)

The Challenge:

I need to overlay 2-4 experiments on the same graph, time-aligned so they all appear to start at t=0, or the start time of the earliest one in the selected set, making it easy to compare deviation patterns between forward/reverse runs or different speeds.

Current Data Structure:

Measurement: motor_position
Tags: exp_id, direction, speed_pct, host
Fields: deviation, mot_pos, enc_pos, rel_ms
Timestamp: actual clock time when recorded

What I’ve Tried:

  1. Using rel_ms as time axis - Can’t figure out how to make Grafana treat a field as time for visualization

  2. Dynamic timeShift() - Attempted to calculate time differences between experiment start times and shift dynamically, but Flux doesn’t seem to support this easily:

flux

// Doesn't work as expected
ref_start = from(bucket: "motor-data") |> first() |> findColumn(...)
time_diff = int(v: ref_start[0]) - int(v: exp_start[0])
|> timeShift(duration: duration(v: time_diff))
  1. Manual time shift - Works but requires calculating offsets manually for each experiment

Questions:

  1. Is there a Grafana-native way to align multiple time-series by a relative time field rather than absolute timestamps?

  2. Can transformations help here? (Prepare time series, custom calculations?)

  3. Are there plugins designed for experiment/test comparison use cases?

  4. Should I be using a different visualization type (XY, scatter, etc.) instead of time series?

  5. Is this better solved outside Grafana (preprocessing, different tool)?

Ideal Workflow:

  • Browser panel showing available experiments

  • Multi-select dropdown to pick 2-4 experiments (or click to pick in the table of experiments)

  • Main graph shows them overlaid, all starting at relative time 0

  • Forward runs in one color, reverse in another

Experiment Structure:

  • Sample rate: 20Hz (50ms intervals)

  • Typical experiment duration: 2-60 seconds

Any guidance on best practices for this type of experiment-based analysis in Grafana would be greatly appreciated!

Thanks in advance!

|\\/|ark.