Query Caching: Add per-panel query caching TTL (#61968)

* *Create Caching Config interface and OSS impl
*Create front-end facing DS Cache config
*Populate Caching Config on Datasource DTO
*Update OSS wire deps

* fix unit test

* handle query caching TTL override on the frontend

* Make sure the override works with pubdash

* move caching config to the right place in the ds info

* move caching config logic to enterprise index hook

* move queryCachingTTL to pubdash query payload

* Remove  from metadata (not needed)

* rename struct and add comment

* remove invalid wire dependency

* manual revert of 395c74b

* fix frontend test

* fix backend test

* fix tests for real this time

* truly fix frontend test

* fix back end unit test for real
This commit is contained in:
Michael Mandrus
2023-02-02 23:39:54 -05:00
committed by GitHub
parent 9eeea8f5ea
commit 7391793504
17 changed files with 101 additions and 12 deletions

View File

@@ -58,6 +58,7 @@ export interface QueryRunnerOptions<
minInterval: string | undefined | null;
scopedVars?: ScopedVars;
cacheTimeout?: string | null;
queryCachingTTL?: number | null;
transformations?: DataTransformerConfig[];
app?: CoreApp;
}
@@ -209,6 +210,7 @@ export class PanelQueryRunner {
timeRange,
timeInfo,
cacheTimeout,
queryCachingTTL,
maxDataPoints,
scopedVars,
minInterval,
@@ -236,6 +238,7 @@ export class PanelQueryRunner {
maxDataPoints: maxDataPoints,
scopedVars: scopedVars || {},
cacheTimeout,
queryCachingTTL,
startTime: Date.now(),
rangeRaw: timeRange.raw,
};

View File

@@ -45,6 +45,7 @@ export class QueryRunner implements QueryRunnerSrv {
timeRange,
timeInfo,
cacheTimeout,
queryCachingTTL,
maxDataPoints,
scopedVars,
minInterval,
@@ -68,6 +69,7 @@ export class QueryRunner implements QueryRunnerSrv {
maxDataPoints: maxDataPoints,
scopedVars: scopedVars || {},
cacheTimeout,
queryCachingTTL,
startTime: Date.now(),
};