-
Notifications
You must be signed in to change notification settings - Fork 21
Description
What happened:
Timepoint explorer on the check overview page does not respect custom log retention policies(>31 days), resulting in an error being rendered instead of the data.
What you expected to happen:
Timepoint explorer to render data that is returned from Loki's datasource. Interestingly enough, if you view the network requests, Loki returns the data. The app makes the decision to not render anything, even if some data is returned.
How to reproduce it (as minimally and precisely as possible):
This came from an internal escalation, so please reach out and I can share the details from there. But generally speaking:
- Have an org with retention policy >31 days
- Have data >31 days old
- View a check with a timeframe that is between 31 days and the retention period
This code here(
synthetic-monitoring-app/src/data/useLogsRetention.ts
Lines 5 to 22 in f9142d3
| const FREE_TRIAL_RETENTION_DAYS = 14; | |
| const STANDARD_RETENTION_DAYS = 31; | |
| // todo: this is a temporary solution to get the logs retention period. | |
| // really we should get this from gcom or another endpoint | |
| // some clients will have custom retention periods which makes this unreliable | |
| export function useLogsRetentionPeriod(from: UnixTimestamp) { | |
| // @ts-expect-error - Cloud Free is not defined in the config but it is what is present for Free trial accounts and free tier accounts | |
| const isFree = config.buildInfo.edition === `Cloud Free`; | |
| const days = isFree ? FREE_TRIAL_RETENTION_DAYS : STANDARD_RETENTION_DAYS; | |
| const HOURS_IN_DAY = 24; | |
| const MINUTES_IN_HOUR = 60; | |
| const SECONDS_IN_MINUTE = 60; | |
| const MILLISECONDS_IN_SECOND = 1000; | |
| return days * HOURS_IN_DAY * MINUTES_IN_HOUR * SECONDS_IN_MINUTE * MILLISECONDS_IN_SECOND; | |
| } |
Anything else we need to know?:
Environment:
- Grafana version (if running on prem):
- SM plugin version:
- OS Grafana is installed on:
- User OS & Browser:
- Others: