Prometheus: Update schema with legendFormat and intervalFactor (#68687)

add legendFormat and intervalFactor to the schema
This commit is contained in:
ismail simsek
2023-05-22 17:20:15 +03:00
committed by GitHub
parent 26c59ddc70
commit 670c987409
5 changed files with 36 additions and 14 deletions

View File

@@ -44,6 +44,11 @@ composableKinds: DataQuery: {
editorMode?: #QueryEditorMode
// Query format to determine how to display data points in panel. It can be "time_series", "table", "heatmap"
format?: #PromQueryFormat
// Series name override or template. Ex. {{hostname}} will be replaced with label value for hostname
legendFormat?: string
// @deprecated Used to specify how many times to divide max data points by. We use max data points under query options
// See https://github.com/grafana/grafana/issues/48081
intervalFactor?: number
#QueryEditorMode: "code" | "builder" @cuetsy(kind="enum")
#PromQueryFormat: "time_series" | "table" | "heatmap" @cuetsy(kind="type")

View File

@@ -40,6 +40,15 @@ export interface Prometheus extends common.DataQuery {
* Returns only the latest value that Prometheus has scraped for the requested time series
*/
instant?: boolean;
/**
* @deprecated Used to specify how many times to divide max data points by. We use max data points under query options
* See https://github.com/grafana/grafana/issues/48081
*/
intervalFactor?: number;
/**
* Series name override or template. Ex. {{hostname}} will be replaced with label value for hostname
*/
legendFormat?: string;
/**
* Returns a Range vector, comprised of a set of time series containing a range of data points over time for each time series
*/

View File

@@ -11,13 +11,11 @@ export interface PromQuery extends GenPromQuery, DataQuery {
* Timezone offset to align start & end time on backend
*/
utcOffsetSec?: number;
legendFormat?: string;
valueWithRefId?: boolean;
showingGraph?: boolean;
showingTable?: boolean;
hinting?: boolean;
interval?: string;
intervalFactor?: number;
// store the metrics modal additional settings
useBackend?: boolean;
disableTextWrap?: boolean;
@@ -31,6 +29,7 @@ export enum PrometheusCacheLevel {
High = 'High',
None = 'None',
}
export interface PromOptions extends DataSourceJsonData {
timeInterval?: string;
queryTimeout?: string;