From 8abe04662b44d581549cb962ad943c210efc931e Mon Sep 17 00:00:00 2001 From: "grafana-delivery-bot[bot]" <132647405+grafana-delivery-bot[bot]@users.noreply.github.com> Date: Thu, 25 Jan 2024 09:11:00 +0100 Subject: [PATCH] [v10.3.x] Explore: Set default time range to now-1h (#81227) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Explore: Set default time range to now-1h (#81135) Update default time range in Explore back to now-1h (cherry picked from commit ebe8c005cec6e4a4716ae6fadbc3ba180cf40341) Co-authored-by: Piotr Jamróz --- .../app/features/explore/hooks/useStateSync/migrators/v0.ts | 4 ++-- public/app/features/explore/state/utils.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/app/features/explore/hooks/useStateSync/migrators/v0.ts b/public/app/features/explore/hooks/useStateSync/migrators/v0.ts index d1dceeccc46..a2948163f00 100644 --- a/public/app/features/explore/hooks/useStateSync/migrators/v0.ts +++ b/public/app/features/explore/hooks/useStateSync/migrators/v0.ts @@ -20,8 +20,8 @@ export const v0Migrator: MigrationHandler = { datasource: null, queries: [], range: { - from: 'now-6h', - to: 'now', + from: DEFAULT_RANGE.from, + to: DEFAULT_RANGE.to, }, }, schemaVersion: 0, diff --git a/public/app/features/explore/state/utils.ts b/public/app/features/explore/state/utils.ts index db1d0d28f48..7be6247e725 100644 --- a/public/app/features/explore/state/utils.ts +++ b/public/app/features/explore/state/utils.ts @@ -30,7 +30,7 @@ import { getDatasourceSrv } from '../../plugins/datasource_srv'; import { loadSupplementaryQueries } from '../utils/supplementaryQueries'; export const DEFAULT_RANGE = { - from: 'now-6h', + from: 'now-1h', to: 'now', };