diff --git a/docs/sources/developers/kinds/composable/elasticsearchdataquery/schema-reference.md b/docs/sources/developers/kinds/composable/elasticsearchdataquery/schema-reference.md index 5bebae059db..dda50523b93 100644 --- a/docs/sources/developers/kinds/composable/elasticsearchdataquery/schema-reference.md +++ b/docs/sources/developers/kinds/composable/elasticsearchdataquery/schema-reference.md @@ -17,12 +17,11 @@ It extends [DataQuery](#dataquery). | Property | Type | Required | Description | |--------------|-------------------------------------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `refId` | string | **Yes** | *(Inherited from [DataQuery](#dataquery))*
A - Z | +| `refId` | string | **Yes** | *(Inherited from [DataQuery](#dataquery))*
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. | | `alias` | string | No | Alias pattern | | `bucketAggs` | [BucketAggregation](#bucketaggregation)[] | No | List of bucket aggregations | | `datasource` | | No | *(Inherited from [DataQuery](#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 | -| `hide` | boolean | No | *(Inherited from [DataQuery](#dataquery))*
true if query is disabled (ie should not be returned to the dashboard) | -| `key` | string | No | *(Inherited from [DataQuery](#dataquery))*
Unique, guid like, string used in explore mode | +| `hide` | boolean | No | *(Inherited from [DataQuery](#dataquery))*
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) | | `metrics` | [MetricAggregation](#metricaggregation)[] | No | List of metric aggregations | | `queryType` | string | No | *(Inherited from [DataQuery](#dataquery))*
Specify the query flavor
TODO make this required and give it a default | | `query` | string | No | Lucene query | @@ -126,10 +125,9 @@ properties for the given context. | Property | Type | Required | Description | |--------------|---------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `refId` | string | **Yes** | A - Z | +| `refId` | string | **Yes** | 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. | | `datasource` | | No | 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 | -| `hide` | boolean | No | true if query is disabled (ie should not be returned to the dashboard) | -| `key` | string | No | Unique, guid like, string used in explore mode | +| `hide` | boolean | No | 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) | | `queryType` | string | No | Specify the query flavor
TODO make this required and give it a default | ### MetricAggregation diff --git a/docs/sources/developers/kinds/composable/lokidataquery/schema-reference.md b/docs/sources/developers/kinds/composable/lokidataquery/schema-reference.md index b57bbd97795..6b022166568 100644 --- a/docs/sources/developers/kinds/composable/lokidataquery/schema-reference.md +++ b/docs/sources/developers/kinds/composable/lokidataquery/schema-reference.md @@ -18,12 +18,11 @@ It extends [DataQuery](#dataquery). | Property | Type | Required | Description | |----------------|---------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `expr` | string | **Yes** | The LogQL query. | -| `refId` | string | **Yes** | *(Inherited from [DataQuery](#dataquery))*
A - Z | +| `refId` | string | **Yes** | *(Inherited from [DataQuery](#dataquery))*
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. | | `datasource` | | No | *(Inherited from [DataQuery](#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 | | `editorMode` | string | No | Possible values are: `code`, `builder`. | -| `hide` | boolean | No | *(Inherited from [DataQuery](#dataquery))*
true if query is disabled (ie should not be returned to the dashboard) | +| `hide` | boolean | No | *(Inherited from [DataQuery](#dataquery))*
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) | | `instant` | boolean | No | @deprecated, now use queryType. | -| `key` | string | No | *(Inherited from [DataQuery](#dataquery))*
Unique, guid like, string used in explore mode | | `legendFormat` | string | No | Used to override the name of the series. | | `maxLines` | integer | No | Used to limit the number of log rows returned. | | `queryType` | string | No | *(Inherited from [DataQuery](#dataquery))*
Specify the query flavor
TODO make this required and give it a default | @@ -38,10 +37,9 @@ properties for the given context. | Property | Type | Required | Description | |--------------|---------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `refId` | string | **Yes** | A - Z | +| `refId` | string | **Yes** | 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. | | `datasource` | | No | 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 | -| `hide` | boolean | No | true if query is disabled (ie should not be returned to the dashboard) | -| `key` | string | No | Unique, guid like, string used in explore mode | +| `hide` | boolean | No | 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) | | `queryType` | string | No | Specify the query flavor
TODO make this required and give it a default | diff --git a/docs/sources/developers/kinds/composable/parcadataquery/schema-reference.md b/docs/sources/developers/kinds/composable/parcadataquery/schema-reference.md index 486fb6ef4cb..3bc24556ada 100644 --- a/docs/sources/developers/kinds/composable/parcadataquery/schema-reference.md +++ b/docs/sources/developers/kinds/composable/parcadataquery/schema-reference.md @@ -19,10 +19,9 @@ It extends [DataQuery](#dataquery). |-----------------|---------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `labelSelector` | string | **Yes** | Specifies the query label selectors. Default: `{}`. | | `profileTypeId` | string | **Yes** | Specifies the type of profile to query. | -| `refId` | string | **Yes** | *(Inherited from [DataQuery](#dataquery))*
A - Z | +| `refId` | string | **Yes** | *(Inherited from [DataQuery](#dataquery))*
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. | | `datasource` | | No | *(Inherited from [DataQuery](#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 | -| `hide` | boolean | No | *(Inherited from [DataQuery](#dataquery))*
true if query is disabled (ie should not be returned to the dashboard) | -| `key` | string | No | *(Inherited from [DataQuery](#dataquery))*
Unique, guid like, string used in explore mode | +| `hide` | boolean | No | *(Inherited from [DataQuery](#dataquery))*
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) | | `queryType` | string | No | *(Inherited from [DataQuery](#dataquery))*
Specify the query flavor
TODO make this required and give it a default | ### DataQuery @@ -33,10 +32,9 @@ properties for the given context. | Property | Type | Required | Description | |--------------|---------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `refId` | string | **Yes** | A - Z | +| `refId` | string | **Yes** | 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. | | `datasource` | | No | 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 | -| `hide` | boolean | No | true if query is disabled (ie should not be returned to the dashboard) | -| `key` | string | No | Unique, guid like, string used in explore mode | +| `hide` | boolean | No | 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) | | `queryType` | string | No | Specify the query flavor
TODO make this required and give it a default | diff --git a/docs/sources/developers/kinds/composable/phlaredataquery/schema-reference.md b/docs/sources/developers/kinds/composable/phlaredataquery/schema-reference.md index e8779c916e4..bafb2005be1 100644 --- a/docs/sources/developers/kinds/composable/phlaredataquery/schema-reference.md +++ b/docs/sources/developers/kinds/composable/phlaredataquery/schema-reference.md @@ -20,10 +20,9 @@ It extends [DataQuery](#dataquery). | `groupBy` | string[] | **Yes** | Allows to group the results. | | `labelSelector` | string | **Yes** | Specifies the query label selectors. Default: `{}`. | | `profileTypeId` | string | **Yes** | Specifies the type of profile to query. | -| `refId` | string | **Yes** | *(Inherited from [DataQuery](#dataquery))*
A - Z | +| `refId` | string | **Yes** | *(Inherited from [DataQuery](#dataquery))*
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. | | `datasource` | | No | *(Inherited from [DataQuery](#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 | -| `hide` | boolean | No | *(Inherited from [DataQuery](#dataquery))*
true if query is disabled (ie should not be returned to the dashboard) | -| `key` | string | No | *(Inherited from [DataQuery](#dataquery))*
Unique, guid like, string used in explore mode | +| `hide` | boolean | No | *(Inherited from [DataQuery](#dataquery))*
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) | | `queryType` | string | No | *(Inherited from [DataQuery](#dataquery))*
Specify the query flavor
TODO make this required and give it a default | ### DataQuery @@ -34,10 +33,9 @@ properties for the given context. | Property | Type | Required | Description | |--------------|---------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `refId` | string | **Yes** | A - Z | +| `refId` | string | **Yes** | 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. | | `datasource` | | No | 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 | -| `hide` | boolean | No | true if query is disabled (ie should not be returned to the dashboard) | -| `key` | string | No | Unique, guid like, string used in explore mode | +| `hide` | boolean | No | 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) | | `queryType` | string | No | Specify the query flavor
TODO make this required and give it a default | diff --git a/docs/sources/developers/kinds/composable/testdatadataquery/schema-reference.md b/docs/sources/developers/kinds/composable/testdatadataquery/schema-reference.md index 0d576fbdd84..f571a4274b5 100644 --- a/docs/sources/developers/kinds/composable/testdatadataquery/schema-reference.md +++ b/docs/sources/developers/kinds/composable/testdatadataquery/schema-reference.md @@ -17,7 +17,7 @@ It extends [DataQuery](#dataquery). | Property | Type | Required | Description | |-------------------|-------------------------------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `refId` | string | **Yes** | *(Inherited from [DataQuery](#dataquery))*
A - Z | +| `refId` | string | **Yes** | *(Inherited from [DataQuery](#dataquery))*
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. | | `alias` | string | No | | | `channel` | string | No | | | `csvContent` | string | No | | @@ -25,8 +25,7 @@ It extends [DataQuery](#dataquery). | `csvWave` | [CSVWave](#csvwave)[] | No | | | `datasource` | | No | *(Inherited from [DataQuery](#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 | | `errorType` | string | No | Possible values are: `server_panic`, `frontend_exception`, `frontend_observable`. | -| `hide` | boolean | No | *(Inherited from [DataQuery](#dataquery))*
true if query is disabled (ie should not be returned to the dashboard) | -| `key` | string | No | *(Inherited from [DataQuery](#dataquery))*
Unique, guid like, string used in explore mode | +| `hide` | boolean | No | *(Inherited from [DataQuery](#dataquery))*
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) | | `labels` | string | No | | | `levelColumn` | boolean | No | | | `lines` | integer | No | | @@ -60,10 +59,9 @@ properties for the given context. | Property | Type | Required | Description | |--------------|---------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `refId` | string | **Yes** | A - Z | +| `refId` | string | **Yes** | 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. | | `datasource` | | No | 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 | -| `hide` | boolean | No | true if query is disabled (ie should not be returned to the dashboard) | -| `key` | string | No | Unique, guid like, string used in explore mode | +| `hide` | boolean | No | 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) | | `queryType` | string | No | Specify the query flavor
TODO make this required and give it a default | ### NodesQuery diff --git a/packages/grafana-schema/src/common/common.gen.ts b/packages/grafana-schema/src/common/common.gen.ts index 4282f9d3c27..b256ed8941c 100644 --- a/packages/grafana-schema/src/common/common.gen.ts +++ b/packages/grafana-schema/src/common/common.gen.ts @@ -34,19 +34,19 @@ export interface DataQuery { datasource?: unknown; /** * 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?: boolean; - /** - * Unique, guid like, string used in explore mode - */ - key?: string; /** * Specify the query flavor * TODO make this required and give it a default */ queryType?: string; /** - * A - Z + * 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; } diff --git a/packages/grafana-schema/src/common/dataquery_gen.cue b/packages/grafana-schema/src/common/dataquery_gen.cue index 25b5556961b..3d6c8f721da 100644 --- a/packages/grafana-schema/src/common/dataquery_gen.cue +++ b/packages/grafana-schema/src/common/dataquery_gen.cue @@ -18,15 +18,16 @@ package common // Specific implementations will *extend* this interface, adding the required // properties for the given context. DataQuery: { - // A - Z + // 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 // 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 - // Unique, guid like, string used in explore mode - key?: string - // Specify the query flavor // TODO make this required and give it a default queryType?: string diff --git a/packages/grafana-schema/src/veneer/common.types.ts b/packages/grafana-schema/src/veneer/common.types.ts index 704e37ecef4..f5a38ac2502 100644 --- a/packages/grafana-schema/src/veneer/common.types.ts +++ b/packages/grafana-schema/src/veneer/common.types.ts @@ -9,6 +9,11 @@ export interface MapLayerOptions extends raw.MapLayerOptions { } export interface DataQuery extends raw.DataQuery { + /** + * Unique, guid like, string (used only in explore mode) + */ + key?: string; + // TODO remove explicit nulls datasource?: raw.DataSourceRef | null; } diff --git a/pkg/kindsys/common_dataquery.cue b/pkg/kindsys/common_dataquery.cue index 4d56c22f497..bb11488efc8 100644 --- a/pkg/kindsys/common_dataquery.cue +++ b/pkg/kindsys/common_dataquery.cue @@ -9,15 +9,16 @@ package kindsys // Specific implementations will *extend* this interface, adding the required // properties for the given context. DataQuery: { - // A - Z + // 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 // 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 - // Unique, guid like, string used in explore mode - key?: string - // Specify the query flavor // TODO make this required and give it a default queryType?: string diff --git a/pkg/tsdb/azuremonitor/kinds/dataquery/types_dataquery_gen.go b/pkg/tsdb/azuremonitor/kinds/dataquery/types_dataquery_gen.go index 7eb0ab4ca2f..96600703b7d 100644 --- a/pkg/tsdb/azuremonitor/kinds/dataquery/types_dataquery_gen.go +++ b/pkg/tsdb/azuremonitor/kinds/dataquery/types_dataquery_gen.go @@ -362,17 +362,18 @@ type AzureMonitorQuery struct { GrafanaTemplateVariableFn *AzureMonitorQueryGrafanaTemplateVariableFn `json:"grafanaTemplateVariableFn,omitempty"` // Hide true if query is disabled (ie should not be returned to the dashboard) - Hide *bool `json:"hide,omitempty"` - - // Unique, guid like, string used in explore mode - Key *string `json:"key,omitempty"` + // 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"` Namespace *string `json:"namespace,omitempty"` // Specify the query flavor // TODO make this required and give it a default QueryType *string `json:"queryType,omitempty"` - // A - Z + // 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"` // Azure Monitor query type. diff --git a/pkg/tsdb/cloudwatch/kinds/dataquery/types_dataquery_gen.go b/pkg/tsdb/cloudwatch/kinds/dataquery/types_dataquery_gen.go index cdb05267f2d..0fb508c16ec 100644 --- a/pkg/tsdb/cloudwatch/kinds/dataquery/types_dataquery_gen.go +++ b/pkg/tsdb/cloudwatch/kinds/dataquery/types_dataquery_gen.go @@ -240,10 +240,9 @@ type CloudWatchAnnotationQuery struct { Dimensions map[string]interface{} `json:"dimensions,omitempty"` // Hide true if query is disabled (ie should not be returned to the dashboard) - Hide *bool `json:"hide,omitempty"` - - // Unique, guid like, string used in explore mode - Key *string `json:"key,omitempty"` + // 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"` MatchExact *bool `json:"matchExact,omitempty"` MetricName *string `json:"metricName,omitempty"` Namespace string `json:"namespace"` @@ -255,7 +254,9 @@ type CloudWatchAnnotationQuery struct { // TODO make this required and give it a default QueryType *string `json:"queryType,omitempty"` - // A - Z + // 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"` Region string `json:"region"` Statistic *string `json:"statistic,omitempty"` @@ -280,12 +281,11 @@ type CloudWatchLogsQuery struct { Expression *string `json:"expression,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"` Id string `json:"id"` - // Unique, guid like, string used in explore mode - Key *string `json:"key,omitempty"` - // LogGroupNames deprecated, use logGroups instead LogGroupNames []string `json:"logGroupNames,omitempty"` LogGroups []struct { @@ -300,7 +300,9 @@ type CloudWatchLogsQuery struct { // TODO make this required and give it a default QueryType *string `json:"queryType,omitempty"` - // A - Z + // 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"` Region string `json:"region"` StatsGroups []string `json:"statsGroups,omitempty"` @@ -325,13 +327,12 @@ type CloudWatchMetricsQuery struct { Expression *string `json:"expression,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"` // Id common props - Id string `json:"id"` - - // Unique, guid like, string used in explore mode - Key *string `json:"key,omitempty"` + Id string `json:"id"` Label *string `json:"label,omitempty"` MatchExact *bool `json:"matchExact,omitempty"` MetricEditorMode *CloudWatchMetricsQueryMetricEditorMode `json:"metricEditorMode,omitempty"` @@ -345,7 +346,9 @@ type CloudWatchMetricsQuery struct { // TODO make this required and give it a default QueryType *string `json:"queryType,omitempty"` - // A - Z + // 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"` Region string `json:"region"` Sql *struct { diff --git a/pkg/tsdb/elasticsearch/kinds/dataquery/types_dataquery_gen.go b/pkg/tsdb/elasticsearch/kinds/dataquery/types_dataquery_gen.go index 84bf27931d0..ee8ce6a6ff0 100644 --- a/pkg/tsdb/elasticsearch/kinds/dataquery/types_dataquery_gen.go +++ b/pkg/tsdb/elasticsearch/kinds/dataquery/types_dataquery_gen.go @@ -622,11 +622,10 @@ type ElasticsearchDataQuery struct { Datasource *interface{} `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"` - // Unique, guid like, string used in explore mode - Key *string `json:"key,omitempty"` - // List of metric aggregations Metrics []MetricsItem `json:"metrics,omitempty"` @@ -637,7 +636,9 @@ type ElasticsearchDataQuery struct { // TODO make this required and give it a default QueryType *string `json:"queryType,omitempty"` - // A - Z + // 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"` // Name of time field diff --git a/pkg/tsdb/loki/kinds/dataquery/types_dataquery_gen.go b/pkg/tsdb/loki/kinds/dataquery/types_dataquery_gen.go index f8f4ec30948..9dadf73ad60 100644 --- a/pkg/tsdb/loki/kinds/dataquery/types_dataquery_gen.go +++ b/pkg/tsdb/loki/kinds/dataquery/types_dataquery_gen.go @@ -54,14 +54,13 @@ type LokiDataQuery struct { Expr string `json:"expr"` // 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"` // @deprecated, now use queryType. Instant *bool `json:"instant,omitempty"` - // Unique, guid like, string used in explore mode - Key *string `json:"key,omitempty"` - // Used to override the name of the series. LegendFormat *string `json:"legendFormat,omitempty"` @@ -75,7 +74,9 @@ type LokiDataQuery struct { // @deprecated, now use queryType. Range *bool `json:"range,omitempty"` - // A - Z + // 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"` // Used to scale the interval value. diff --git a/pkg/tsdb/parca/kinds/dataquery/types_dataquery_gen.go b/pkg/tsdb/parca/kinds/dataquery/types_dataquery_gen.go index 20936bf2a1c..72cb7ff1492 100644 --- a/pkg/tsdb/parca/kinds/dataquery/types_dataquery_gen.go +++ b/pkg/tsdb/parca/kinds/dataquery/types_dataquery_gen.go @@ -25,11 +25,10 @@ type ParcaDataQuery struct { Datasource *interface{} `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"` - // Unique, guid like, string used in explore mode - Key *string `json:"key,omitempty"` - // Specifies the query label selectors. LabelSelector string `json:"labelSelector"` @@ -40,7 +39,9 @@ type ParcaDataQuery struct { // TODO make this required and give it a default QueryType *string `json:"queryType,omitempty"` - // A - Z + // 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"` } diff --git a/pkg/tsdb/phlare/kinds/dataquery/types_dataquery_gen.go b/pkg/tsdb/phlare/kinds/dataquery/types_dataquery_gen.go index a4e30e565d8..9f84d4839ee 100644 --- a/pkg/tsdb/phlare/kinds/dataquery/types_dataquery_gen.go +++ b/pkg/tsdb/phlare/kinds/dataquery/types_dataquery_gen.go @@ -28,11 +28,10 @@ type PhlareDataQuery struct { GroupBy []string `json:"groupBy"` // 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"` - // Unique, guid like, string used in explore mode - Key *string `json:"key,omitempty"` - // Specifies the query label selectors. LabelSelector string `json:"labelSelector"` @@ -43,7 +42,9 @@ type PhlareDataQuery struct { // TODO make this required and give it a default QueryType *string `json:"queryType,omitempty"` - // A - Z + // 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"` } diff --git a/pkg/tsdb/tempo/kinds/dataquery/types_dataquery_gen.go b/pkg/tsdb/tempo/kinds/dataquery/types_dataquery_gen.go index 06fb1fb74e2..eba542a487c 100644 --- a/pkg/tsdb/tempo/kinds/dataquery/types_dataquery_gen.go +++ b/pkg/tsdb/tempo/kinds/dataquery/types_dataquery_gen.go @@ -69,11 +69,10 @@ type TempoQuery struct { } `json:"filters"` // 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"` - // Unique, guid like, string used in explore mode - Key *string `json:"key,omitempty"` - // Defines the maximum number of traces that are returned from Tempo Limit *int64 `json:"limit,omitempty"` @@ -90,7 +89,9 @@ type TempoQuery struct { // TODO make this required and give it a default QueryType *string `json:"queryType,omitempty"` - // A - Z + // 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"` // Logfmt query to filter traces by their tags. Example: http.status_code=200 error=true diff --git a/pkg/tsdb/testdatasource/kinds/dataquery/types_dataquery_gen.go b/pkg/tsdb/testdatasource/kinds/dataquery/types_dataquery_gen.go index e772bf88582..b5525e6267e 100644 --- a/pkg/tsdb/testdatasource/kinds/dataquery/types_dataquery_gen.go +++ b/pkg/tsdb/testdatasource/kinds/dataquery/types_dataquery_gen.go @@ -191,10 +191,9 @@ type TestDataDataQuery struct { ErrorType *ErrorType `json:"errorType,omitempty"` // Hide true if query is disabled (ie should not be returned to the dashboard) - Hide *bool `json:"hide,omitempty"` - - // Unique, guid like, string used in explore mode - Key *string `json:"key,omitempty"` + // 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"` Labels *string `json:"labels,omitempty"` LevelColumn *bool `json:"levelColumn,omitempty"` Lines *int64 `json:"lines,omitempty"` @@ -216,7 +215,9 @@ type TestDataDataQuery struct { QueryType *string `json:"queryType,omitempty"` RawFrameContent *string `json:"rawFrameContent,omitempty"` - // A - Z + // 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"` ScenarioId *ScenarioId `json:"scenarioId,omitempty"` SeriesCount *int32 `json:"seriesCount,omitempty"`