mirror of https://github.com/grafana/grafana
Prometheus: remove cue definition (#83808)
Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>pull/83862/head
parent
2e8c514cfd
commit
5aa965b9e9
@ -1,58 +0,0 @@ |
||||
// Copyright 2023 Grafana Labs |
||||
// |
||||
// Licensed under the Apache License, Version 2.0 (the "License"); |
||||
// you may not use this file except in compliance with the License. |
||||
// You may obtain a copy of the License at |
||||
// |
||||
// http://www.apache.org/licenses/LICENSE-2.0 |
||||
// |
||||
// Unless required by applicable law or agreed to in writing, software |
||||
// distributed under the License is distributed on an "AS IS" BASIS, |
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
// See the License for the specific language governing permissions and |
||||
// limitations under the License. |
||||
|
||||
package grafanaplugin |
||||
|
||||
import ( |
||||
common "github.com/grafana/grafana/packages/grafana-schema/src/common" |
||||
) |
||||
|
||||
composableKinds: DataQuery: { |
||||
maturity: "experimental" |
||||
|
||||
lineage: { |
||||
schemas: [{ |
||||
version: [0, 0] |
||||
schema: { |
||||
common.DataQuery |
||||
|
||||
// The actual expression/query that will be evaluated by Prometheus |
||||
expr: string |
||||
// Returns only the latest value that Prometheus has scraped for the requested time series |
||||
instant?: bool |
||||
// Returns a Range vector, comprised of a set of time series containing a range of data points over time for each time series |
||||
range?: bool |
||||
// Execute an additional query to identify interesting raw samples relevant for the given expr |
||||
exemplar?: bool |
||||
// Specifies which editor is being used to prepare the query. It can be "code" or "builder" |
||||
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 |
||||
|
||||
scope?: { |
||||
matchers: string |
||||
} |
||||
|
||||
#QueryEditorMode: "code" | "builder" @cuetsy(kind="enum") |
||||
#PromQueryFormat: "time_series" | "table" | "heatmap" @cuetsy(kind="type") |
||||
} |
||||
}] |
||||
lenses: [] |
||||
} |
||||
} |
||||
@ -1,60 +0,0 @@ |
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
//
|
||||
// Generated by:
|
||||
// public/app/plugins/gen.go
|
||||
// Using jennies:
|
||||
// TSTypesJenny
|
||||
// LatestMajorsOrXJenny
|
||||
// PluginEachMajorJenny
|
||||
//
|
||||
// Run 'make gen-cue' from repository root to regenerate.
|
||||
|
||||
import * as common from '@grafana/schema'; |
||||
|
||||
export const pluginVersion = "11.0.0-pre"; |
||||
|
||||
export enum QueryEditorMode { |
||||
Builder = 'builder', |
||||
Code = 'code', |
||||
} |
||||
|
||||
export type PromQueryFormat = ('time_series' | 'table' | 'heatmap'); |
||||
|
||||
export interface PrometheusDataQuery extends common.DataQuery { |
||||
/** |
||||
* Specifies which editor is being used to prepare the query. It can be "code" or "builder" |
||||
*/ |
||||
editorMode?: QueryEditorMode; |
||||
/** |
||||
* Execute an additional query to identify interesting raw samples relevant for the given expr |
||||
*/ |
||||
exemplar?: boolean; |
||||
/** |
||||
* The actual expression/query that will be evaluated by Prometheus |
||||
*/ |
||||
expr: string; |
||||
/** |
||||
* Query format to determine how to display data points in panel. It can be "time_series", "table", "heatmap" |
||||
*/ |
||||
format?: PromQueryFormat; |
||||
/** |
||||
* 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 |
||||
*/ |
||||
range?: boolean; |
||||
scope?: { |
||||
matchers: string; |
||||
}; |
||||
} |
||||
@ -1,106 +0,0 @@ |
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
//
|
||||
// Generated by:
|
||||
// public/app/plugins/gen.go
|
||||
// Using jennies:
|
||||
// PluginGoTypesJenny
|
||||
//
|
||||
// Run 'make gen-cue' from repository root to regenerate.
|
||||
|
||||
package dataquery |
||||
|
||||
// Defines values for PromQueryFormat.
|
||||
const ( |
||||
PromQueryFormatHeatmap PromQueryFormat = "heatmap" |
||||
PromQueryFormatTable PromQueryFormat = "table" |
||||
PromQueryFormatTimeSeries PromQueryFormat = "time_series" |
||||
) |
||||
|
||||
// Defines values for QueryEditorMode.
|
||||
const ( |
||||
QueryEditorModeBuilder QueryEditorMode = "builder" |
||||
QueryEditorModeCode QueryEditorMode = "code" |
||||
) |
||||
|
||||
// These are the common properties available to all queries in all datasources.
|
||||
// Specific implementations will *extend* this interface, adding the required
|
||||
// properties for the given context.
|
||||
type DataQuery struct { |
||||
// For mixed data sources the selected datasource is on the query level.
|
||||
// For non mixed scenarios this is undefined.
|
||||
// TODO find a better way to do this ^ that's friendly to schema
|
||||
// TODO this shouldn't be unknown but DataSourceRef | null
|
||||
Datasource *any `json:"datasource,omitempty"` |
||||
|
||||
// Hide true if query is disabled (ie should not be returned to the dashboard)
|
||||
// Note this does not always imply that the query should not be executed since
|
||||
// the results from a hidden query may be used as the input to other queries (SSE etc)
|
||||
Hide *bool `json:"hide,omitempty"` |
||||
|
||||
// Specify the query flavor
|
||||
// TODO make this required and give it a default
|
||||
QueryType *string `json:"queryType,omitempty"` |
||||
|
||||
// A unique identifier for the query within the list of targets.
|
||||
// In server side expressions, the refId is used as a variable name to identify results.
|
||||
// By default, the UI will assign A->Z; however setting meaningful names may be useful.
|
||||
RefId string `json:"refId"` |
||||
} |
||||
|
||||
// PromQueryFormat defines model for PromQueryFormat.
|
||||
type PromQueryFormat string |
||||
|
||||
// PrometheusDataQuery defines model for PrometheusDataQuery.
|
||||
type PrometheusDataQuery struct { |
||||
// DataQuery These are the common properties available to all queries in all datasources.
|
||||
// Specific implementations will *extend* this interface, adding the required
|
||||
// properties for the given context.
|
||||
DataQuery |
||||
|
||||
// For mixed data sources the selected datasource is on the query level.
|
||||
// For non mixed scenarios this is undefined.
|
||||
// TODO find a better way to do this ^ that's friendly to schema
|
||||
// TODO this shouldn't be unknown but DataSourceRef | null
|
||||
Datasource *any `json:"datasource,omitempty"` |
||||
EditorMode *QueryEditorMode `json:"editorMode,omitempty"` |
||||
|
||||
// Execute an additional query to identify interesting raw samples relevant for the given expr
|
||||
Exemplar *bool `json:"exemplar,omitempty"` |
||||
|
||||
// The actual expression/query that will be evaluated by Prometheus
|
||||
Expr string `json:"expr"` |
||||
Format *PromQueryFormat `json:"format,omitempty"` |
||||
|
||||
// Hide true if query is disabled (ie should not be returned to the dashboard)
|
||||
// Note this does not always imply that the query should not be executed since
|
||||
// the results from a hidden query may be used as the input to other queries (SSE etc)
|
||||
Hide *bool `json:"hide,omitempty"` |
||||
|
||||
// Returns only the latest value that Prometheus has scraped for the requested time series
|
||||
Instant *bool `json:"instant,omitempty"` |
||||
|
||||
// @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 *float32 `json:"intervalFactor,omitempty"` |
||||
|
||||
// Series name override or template. Ex. {{hostname}} will be replaced with label value for hostname
|
||||
LegendFormat *string `json:"legendFormat,omitempty"` |
||||
|
||||
// Specify the query flavor
|
||||
// TODO make this required and give it a default
|
||||
QueryType *string `json:"queryType,omitempty"` |
||||
|
||||
// Returns a Range vector, comprised of a set of time series containing a range of data points over time for each time series
|
||||
Range *bool `json:"range,omitempty"` |
||||
|
||||
// A unique identifier for the query within the list of targets.
|
||||
// In server side expressions, the refId is used as a variable name to identify results.
|
||||
// By default, the UI will assign A->Z; however setting meaningful names may be useful.
|
||||
RefId string `json:"refId"` |
||||
Scope *struct { |
||||
Matchers string `json:"matchers"` |
||||
} `json:"scope,omitempty"` |
||||
} |
||||
|
||||
// QueryEditorMode defines model for QueryEditorMode.
|
||||
type QueryEditorMode string |
||||
@ -1,58 +0,0 @@ |
||||
// Copyright 2023 Grafana Labs |
||||
// |
||||
// Licensed under the Apache License, Version 2.0 (the "License"); |
||||
// you may not use this file except in compliance with the License. |
||||
// You may obtain a copy of the License at |
||||
// |
||||
// http://www.apache.org/licenses/LICENSE-2.0 |
||||
// |
||||
// Unless required by applicable law or agreed to in writing, software |
||||
// distributed under the License is distributed on an "AS IS" BASIS, |
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
// See the License for the specific language governing permissions and |
||||
// limitations under the License. |
||||
|
||||
package grafanaplugin |
||||
|
||||
import ( |
||||
common "github.com/grafana/grafana/packages/grafana-schema/src/common" |
||||
) |
||||
|
||||
composableKinds: DataQuery: { |
||||
maturity: "experimental" |
||||
|
||||
lineage: { |
||||
schemas: [{ |
||||
version: [0, 0] |
||||
schema: { |
||||
common.DataQuery |
||||
|
||||
// The actual expression/query that will be evaluated by Prometheus |
||||
expr: string |
||||
// Returns only the latest value that Prometheus has scraped for the requested time series |
||||
instant?: bool |
||||
// Returns a Range vector, comprised of a set of time series containing a range of data points over time for each time series |
||||
range?: bool |
||||
// Execute an additional query to identify interesting raw samples relevant for the given expr |
||||
exemplar?: bool |
||||
// Specifies which editor is being used to prepare the query. It can be "code" or "builder" |
||||
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 |
||||
|
||||
scope?: { |
||||
matchers: string |
||||
} |
||||
|
||||
#QueryEditorMode: "code" | "builder" @cuetsy(kind="enum") |
||||
#PromQueryFormat: "time_series" | "table" | "heatmap" @cuetsy(kind="type") |
||||
} |
||||
}] |
||||
lenses: [] |
||||
} |
||||
} |
||||
Loading…
Reference in new issue