mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Add state history polling interval (#84837)
This commit is contained in:
parent
2232fe033b
commit
c41b0a71cf
@ -19,6 +19,7 @@ interface Props {
|
|||||||
ruleUID: string;
|
ruleUID: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const STATE_HISTORY_POLLING_INTERVAL = 10 * 1000; // 10 seconds
|
||||||
const MAX_TIMELINE_SERIES = 12;
|
const MAX_TIMELINE_SERIES = 12;
|
||||||
|
|
||||||
const LokiStateHistory = ({ ruleUID }: Props) => {
|
const LokiStateHistory = ({ ruleUID }: Props) => {
|
||||||
@ -38,12 +39,19 @@ const LokiStateHistory = ({ ruleUID }: Props) => {
|
|||||||
isLoading,
|
isLoading,
|
||||||
isError,
|
isError,
|
||||||
error,
|
error,
|
||||||
} = useGetRuleHistoryQuery({
|
} = useGetRuleHistoryQuery(
|
||||||
ruleUid: ruleUID,
|
{
|
||||||
from: queryTimeRange.from.unix(),
|
ruleUid: ruleUID,
|
||||||
to: queryTimeRange.to.unix(),
|
from: queryTimeRange.from.unix(),
|
||||||
limit: 250,
|
to: queryTimeRange.to.unix(),
|
||||||
});
|
limit: 250,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
refetchOnFocus: true,
|
||||||
|
refetchOnReconnect: true,
|
||||||
|
pollingInterval: STATE_HISTORY_POLLING_INTERVAL,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
const { dataFrames, historyRecords, commonLabels, totalRecordsCount } = useRuleHistoryRecords(
|
const { dataFrames, historyRecords, commonLabels, totalRecordsCount } = useRuleHistoryRecords(
|
||||||
stateHistory,
|
stateHistory,
|
||||||
|
Loading…
Reference in New Issue
Block a user