Schema: Remove key from root DataQuery type (#64467)

This commit is contained in:
Ryan McKinley
2023-03-08 13:52:31 -08:00
committed by GitHub
parent 1a5a280c86
commit 4b94c7e5d2
17 changed files with 94 additions and 87 deletions

View File

@@ -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.

View File

@@ -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 {

View File

@@ -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

View File

@@ -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.

View File

@@ -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"`
}

View File

@@ -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"`
}

View File

@@ -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

View File

@@ -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"`