Time picker: "Relative Time" (live tail) greys out every range above 1 hour, with no explanation
What happened?
With the "Relative Time" switch on, the picker greys out every preset above "Last 1 hour". That covers 3h, 6h, 12h, 1d, 2d, 7d, 14d and 30d. Nothing says why. So you can't pick an auto-updating 6-hour or 24-hour window from the UI.
The limit is in the picker only. If you set a longer live range in the URL (for example isLive=true&liveInterval=21600000 for 6 hours), search live-tails that window without trouble.
The switch label adds to the confusion. It says "Relative Time", and only its hover tooltip mentions Live Tail. It isn't clear that the switch turns on live tail, or why it hides most of the ranges.
What I expected:
- Longer live ranges (at least 3h, 6h, 12h and 24h) can be picked from the picker, like they can from the URL.
- If a limit is intended (for example, to keep query load down), the disabled options say so in a tooltip.
- The switch label makes clear that it controls live tail.
Steps to reproduce
- Open Search on any log source, for example the default
otel_logstable. - Open the time picker and turn on the "Relative Time" switch.
- Look at the presets. "Last 1 hour" and shorter can be clicked. "Last 3 hours" and longer are greyed out, with no tooltip.
- Now edit the URL by hand to
...&isLive=true&liveInterval=21600000and reload. Search live-tails a 6-hour window, so the range works when it's set outside the picker.
How are you running HyperDX?
ClickStack Cloud. The code below is from main at 6767349, where the behaviour is unchanged.
Where does it show up?
UI, on the Search page time picker, in any browser.
Root cause
- In
RELATIVE_TIME_OPTIONS, only the presets from 1 minute to 1 hour set the third tuple fieldrelativeSupporttotrue. "Last 3 hours" and longer leave it out. https://github.com/hyperdxio/hyperdx/blob/6767349849a8ffc9410a8a5764d7c94ac1169460/packages/app/src/components/TimePicker/utils.ts#L88-L111 - The picker disables any option where
isRelative && !item[2], and gives no reason: https://github.com/hyperdxio/hyperdx/blob/6767349849a8ffc9410a8a5764d7c94ac1169460/packages/app/src/components/TimePicker/TimePicker.tsx#L376-L380 - The switch is labelled "Relative Time", and only its tooltip mentions Live Tail: https://github.com/hyperdxio/hyperdx/blob/6767349849a8ffc9410a8a5764d7c94ac1169460/packages/app/src/components/TimePicker/TimePicker.tsx#L324-L338
- The search page reads
liveIntervalfrom the URL with no upper bound, so the cap only applies in the picker: https://github.com/hyperdxio/hyperdx/blob/6767349849a8ffc9410a8a5764d7c94ac1169460/packages/app/src/DBSearchPage.tsx#L1625-L1628
Suggested fix
- Set
relativeSupport: trueon the longer presets, at least 3h, 6h, 12h and 1d. If a hard limit is still wanted, make it a single constant (or a team setting) and apply it in the same way to both the picker and the URL. - If some ranges stay disabled, add a tooltip on them, for example "Not available for live tail".
- Rename the switch to something like "Live tail" or "Relative (live)", so users can see what it does without hovering.
Related issues that don't cover this: #1788 (override live tail config with env vars) and #1419 (live tail refresh interval).
Source: hyperdxio/hyperdx