dataquery

package
v0.0.0-...-fb7f86c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2023 License: AGPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlignmentTypes

type AlignmentTypes string

AlignmentTypes defines model for AlignmentTypes.

const (
	AlignmentTypesALIGNCOUNT         AlignmentTypes = "ALIGN_COUNT"
	AlignmentTypesALIGNCOUNTFALSE    AlignmentTypes = "ALIGN_COUNT_FALSE"
	AlignmentTypesALIGNCOUNTTRUE     AlignmentTypes = "ALIGN_COUNT_TRUE"
	AlignmentTypesALIGNDELTA         AlignmentTypes = "ALIGN_DELTA"
	AlignmentTypesALIGNFRACTIONTRUE  AlignmentTypes = "ALIGN_FRACTION_TRUE"
	AlignmentTypesALIGNINTERPOLATE   AlignmentTypes = "ALIGN_INTERPOLATE"
	AlignmentTypesALIGNMAX           AlignmentTypes = "ALIGN_MAX"
	AlignmentTypesALIGNMEAN          AlignmentTypes = "ALIGN_MEAN"
	AlignmentTypesALIGNMIN           AlignmentTypes = "ALIGN_MIN"
	AlignmentTypesALIGNNEXTOLDER     AlignmentTypes = "ALIGN_NEXT_OLDER"
	AlignmentTypesALIGNNONE          AlignmentTypes = "ALIGN_NONE"
	AlignmentTypesALIGNPERCENTCHANGE AlignmentTypes = "ALIGN_PERCENT_CHANGE"
	AlignmentTypesALIGNPERCENTILE05  AlignmentTypes = "ALIGN_PERCENTILE_05"
	AlignmentTypesALIGNPERCENTILE50  AlignmentTypes = "ALIGN_PERCENTILE_50"
	AlignmentTypesALIGNPERCENTILE95  AlignmentTypes = "ALIGN_PERCENTILE_95"
	AlignmentTypesALIGNPERCENTILE99  AlignmentTypes = "ALIGN_PERCENTILE_99"
	AlignmentTypesALIGNRATE          AlignmentTypes = "ALIGN_RATE"
	AlignmentTypesALIGNSTDDEV        AlignmentTypes = "ALIGN_STDDEV"
	AlignmentTypesALIGNSUM           AlignmentTypes = "ALIGN_SUM"
)

Defines values for AlignmentTypes.

type CloudMonitoringQuery

type CloudMonitoringQuery 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

	// Aliases can be set to modify the legend labels. e.g. {{metric.label.xxx}}. See docs for more detail.
	AliasBy *string `json:"aliasBy,omitempty"`

	// Time interval in milliseconds.
	IntervalMs *float32 `json:"intervalMs,omitempty"`

	// SLO sub-query properties.
	SloQuery *SLOQuery `json:"sloQuery,omitempty"`

	// Time Series List sub-query properties.
	TimeSeriesList *TimeSeriesList `json:"timeSeriesList,omitempty"`

	// Time Series sub-query properties.
	TimeSeriesQuery *TimeSeriesQuery `json:"timeSeriesQuery,omitempty"`
}

CloudMonitoringQuery defines model for CloudMonitoringQuery.

type DataQuery

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

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 Filter

type Filter struct {
	// Filter condition.
	Condition *string `json:"condition,omitempty"`

	// Filter key.
	Key string `json:"key"`

	// Filter operator.
	Operator string `json:"operator"`

	// Filter value.
	Value string `json:"value"`
}

Query filter representation.

type GoogleCloudMonitoringDataQuery

type GoogleCloudMonitoringDataQuery = map[string]any

GoogleCloudMonitoringDataQuery defines model for GoogleCloudMonitoringDataQuery.

type LegacyCloudMonitoringAnnotationQuery

type LegacyCloudMonitoringAnnotationQuery struct {
	// Array of filters to query data by. Labels that can be filtered on are defined by the metric.
	Filters    []string   `json:"filters"`
	MetricKind MetricKind `json:"metricKind"`
	MetricType string     `json:"metricType"`

	// GCP project to execute the query against.
	ProjectName string `json:"projectName"`

	// Query refId.
	RefId string `json:"refId"`

	// Annotation text.
	Text string `json:"text"`

	// Annotation title.
	Title     string `json:"title"`
	ValueType string `json:"valueType"`
}

@deprecated Use TimeSeriesList instead. Legacy annotation query properties for migration purposes.

type MetricFindQueryTypes

type MetricFindQueryTypes string

MetricFindQueryTypes defines model for MetricFindQueryTypes.

const (
	MetricFindQueryTypesAggregations     MetricFindQueryTypes = "aggregations"
	MetricFindQueryTypesAligners         MetricFindQueryTypes = "aligners"
	MetricFindQueryTypesAlignmentPeriods MetricFindQueryTypes = "alignmentPeriods"
	MetricFindQueryTypesDefaultProject   MetricFindQueryTypes = "defaultProject"
	MetricFindQueryTypesLabelKeys        MetricFindQueryTypes = "labelKeys"
	MetricFindQueryTypesLabelValues      MetricFindQueryTypes = "labelValues"
	MetricFindQueryTypesMetricTypes      MetricFindQueryTypes = "metricTypes"
	MetricFindQueryTypesProjects         MetricFindQueryTypes = "projects"
	MetricFindQueryTypesResourceTypes    MetricFindQueryTypes = "resourceTypes"
	MetricFindQueryTypesSelectors        MetricFindQueryTypes = "selectors"
	MetricFindQueryTypesServices         MetricFindQueryTypes = "services"
	MetricFindQueryTypesSlo              MetricFindQueryTypes = "slo"
	MetricFindQueryTypesSloServices      MetricFindQueryTypes = "sloServices"
)

Defines values for MetricFindQueryTypes.

type MetricKind

type MetricKind string

MetricKind defines model for MetricKind.

const (
	MetricKindCUMULATIVE            MetricKind = "CUMULATIVE"
	MetricKindDELTA                 MetricKind = "DELTA"
	MetricKindGAUGE                 MetricKind = "GAUGE"
	MetricKindMETRICKINDUNSPECIFIED MetricKind = "METRIC_KIND_UNSPECIFIED"
)

Defines values for MetricKind.

type MetricQuery

type MetricQuery struct {
	// Aliases can be set to modify the legend labels. e.g. {{metric.label.xxx}}. See docs for more detail.
	AliasBy *string `json:"aliasBy,omitempty"`

	// Alignment period to use when regularizing data. Defaults to cloud-monitoring-auto.
	AlignmentPeriod *string `json:"alignmentPeriod,omitempty"`

	// Reducer applied across a set of time-series values. Defaults to REDUCE_NONE.
	CrossSeriesReducer string `json:"crossSeriesReducer"`
	EditorMode         string `json:"editorMode"`

	// Array of filters to query data by. Labels that can be filtered on are defined by the metric.
	Filters []string `json:"filters,omitempty"`

	// To disable the graphPeriod, it should explictly be set to 'disabled'.
	GraphPeriod *string `json:"graphPeriod,omitempty"`

	// Array of labels to group data by.
	GroupBys   []string    `json:"groupBys,omitempty"`
	MetricKind *MetricKind `json:"metricKind,omitempty"`
	MetricType string      `json:"metricType"`

	// Alignment function to be used. Defaults to ALIGN_MEAN.
	PerSeriesAligner *string `json:"perSeriesAligner,omitempty"`

	// Types of pre-processor available. Defined by the metric.
	Preprocessor *PreprocessorType `json:"preprocessor,omitempty"`

	// GCP project to execute the query against.
	ProjectName string `json:"projectName"`

	// MQL query to be executed.
	Query     string  `json:"query"`
	ValueType *string `json:"valueType,omitempty"`
	View      *string `json:"view,omitempty"`
}

@deprecated This type is for migration purposes only. Replaced by TimeSeriesList Metric sub-query properties.

type PreprocessorType

type PreprocessorType string

Types of pre-processor available. Defined by the metric.

const (
	PreprocessorTypeDelta PreprocessorType = "delta"
	PreprocessorTypeNone  PreprocessorType = "none"
	PreprocessorTypeRate  PreprocessorType = "rate"
)

Defines values for PreprocessorType.

type QueryType

type QueryType string

Defines the supported queryTypes.

const (
	QueryTypeAnnotation      QueryType = "annotation"
	QueryTypeSlo             QueryType = "slo"
	QueryTypeTimeSeriesList  QueryType = "timeSeriesList"
	QueryTypeTimeSeriesQuery QueryType = "timeSeriesQuery"
)

Defines values for QueryType.

type SLOQuery

type SLOQuery struct {
	// Alignment period to use when regularizing data. Defaults to cloud-monitoring-auto.
	AlignmentPeriod *string `json:"alignmentPeriod,omitempty"`

	// SLO goal value.
	Goal *float32 `json:"goal,omitempty"`

	// Specific lookback period for the SLO.
	LookbackPeriod *string `json:"lookbackPeriod,omitempty"`

	// Alignment function to be used. Defaults to ALIGN_MEAN.
	PerSeriesAligner *string `json:"perSeriesAligner,omitempty"`

	// GCP project to execute the query against.
	ProjectName string `json:"projectName"`

	// SLO selector.
	SelectorName string `json:"selectorName"`

	// ID for the service the SLO is in.
	ServiceId string `json:"serviceId"`

	// Name for the service the SLO is in.
	ServiceName string `json:"serviceName"`

	// ID for the SLO.
	SloId string `json:"sloId"`

	// Name of the SLO.
	SloName string `json:"sloName"`
}

SLO sub-query properties.

type TimeSeriesList

type TimeSeriesList struct {
	// Alignment period to use when regularizing data. Defaults to cloud-monitoring-auto.
	AlignmentPeriod *string `json:"alignmentPeriod,omitempty"`

	// Reducer applied across a set of time-series values. Defaults to REDUCE_NONE.
	CrossSeriesReducer string `json:"crossSeriesReducer"`

	// Array of filters to query data by. Labels that can be filtered on are defined by the metric.
	Filters []string `json:"filters,omitempty"`

	// Array of labels to group data by.
	GroupBys []string `json:"groupBys,omitempty"`

	// Alignment function to be used. Defaults to ALIGN_MEAN.
	PerSeriesAligner *string `json:"perSeriesAligner,omitempty"`

	// Types of pre-processor available. Defined by the metric.
	Preprocessor *PreprocessorType `json:"preprocessor,omitempty"`

	// GCP project to execute the query against.
	ProjectName string `json:"projectName"`

	// Only present if a preprocessor is selected. Alignment period to use when regularizing data. Defaults to cloud-monitoring-auto.
	SecondaryAlignmentPeriod *string `json:"secondaryAlignmentPeriod,omitempty"`

	// Only present if a preprocessor is selected. Reducer applied across a set of time-series values. Defaults to REDUCE_NONE.
	SecondaryCrossSeriesReducer *string `json:"secondaryCrossSeriesReducer,omitempty"`

	// Only present if a preprocessor is selected. Array of labels to group data by.
	SecondaryGroupBys []string `json:"secondaryGroupBys,omitempty"`

	// Only present if a preprocessor is selected. Alignment function to be used. Defaults to ALIGN_MEAN.
	SecondaryPerSeriesAligner *string `json:"secondaryPerSeriesAligner,omitempty"`

	// Annotation text.
	Text *string `json:"text,omitempty"`

	// Annotation title.
	Title *string `json:"title,omitempty"`

	// Data view, defaults to FULL.
	View *string `json:"view,omitempty"`
}

Time Series List sub-query properties.

type TimeSeriesQuery

type TimeSeriesQuery struct {
	// To disable the graphPeriod, it should explictly be set to 'disabled'.
	GraphPeriod *string `json:"graphPeriod,omitempty"`

	// GCP project to execute the query against.
	ProjectName string `json:"projectName"`

	// MQL query to be executed.
	Query string `json:"query"`
}

Time Series sub-query properties.

type ValueTypes

type ValueTypes string

ValueTypes defines model for ValueTypes.

const (
	ValueTypesBOOL                 ValueTypes = "BOOL"
	ValueTypesDISTRIBUTION         ValueTypes = "DISTRIBUTION"
	ValueTypesDOUBLE               ValueTypes = "DOUBLE"
	ValueTypesINT64                ValueTypes = "INT64"
	ValueTypesMONEY                ValueTypes = "MONEY"
	ValueTypesSTRING               ValueTypes = "STRING"
	ValueTypesVALUETYPEUNSPECIFIED ValueTypes = "VALUE_TYPE_UNSPECIFIED"
)

Defines values for ValueTypes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL