Google Cloud Monitor: Prom query editor (#73503)

* revert

* works but needs clean up and tests

* clean up

* remove any

* change confusing query var to expr

* oops

* add test

* lint

* cleanup

* update docs

* Update public/app/plugins/datasource/cloud-monitoring/components/PromQLEditor.tsx

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>

* nit

* lint fix?

* remove comment from cue

* go linter

* removing parsing stuff parseresponse func

---------

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
This commit is contained in:
Andrew Hackmann
2023-08-18 11:14:43 -05:00
committed by GitHub
co-authored by Andreas Christou
parent 23ae1127a7
commit 42f4306251
23 changed files with 512 additions and 17 deletions
@@ -22,6 +22,10 @@ export interface CloudMonitoringQuery extends common.DataQuery {
* Time interval in milliseconds.
*/
intervalMs?: number;
/**
* PromQL sub-query properties.
*/
promQLQuery?: PromQLQuery;
/**
* SLO sub-query properties.
*/
@@ -43,6 +47,7 @@ export interface CloudMonitoringQuery extends common.DataQuery {
*/
export enum QueryType {
ANNOTATION = 'annotation',
PROMQL = 'promQL',
SLO = 'slo',
TIME_SERIES_LIST = 'timeSeriesList',
TIME_SERIES_QUERY = 'timeSeriesQuery',
@@ -189,6 +194,24 @@ export interface SLOQuery {
sloName: string;
}
/**
* PromQL sub-query properties.
*/
export interface PromQLQuery {
/**
* PromQL expression/query to be executed.
*/
expr: string;
/**
* GCP project to execute the query against.
*/
projectName: string;
/**
* PromQL min step
*/
step: string;
}
/**
* @deprecated This type is for migration purposes only. Replaced by TimeSeriesList Metric sub-query properties.
*/