Skip to content

CloudWatchMetricsQueryBuilder🔗

Constructor🔗

func NewCloudWatchMetricsQueryBuilder() *CloudWatchMetricsQueryBuilder

Methods🔗

Build🔗

Builds the object.

func (builder *CloudWatchMetricsQueryBuilder) Build() (variants.Dataquery, error)

AccountId🔗

The ID of the AWS account to query for the metric, specifying all will query all accounts that the monitoring account is permitted to query.

func (builder *CloudWatchMetricsQueryBuilder) AccountId(accountId string) *CloudWatchMetricsQueryBuilder

Alias🔗

Deprecated: use label

@deprecated use label

func (builder *CloudWatchMetricsQueryBuilder) Alias(alias string) *CloudWatchMetricsQueryBuilder

Datasource🔗

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

func (builder *CloudWatchMetricsQueryBuilder) Datasource(datasource dashboard.DataSourceRef) *CloudWatchMetricsQueryBuilder

Dimensions🔗

The dimensions of the metric

func (builder *CloudWatchMetricsQueryBuilder) Dimensions(dimensions cloudwatch.Dimensions) *CloudWatchMetricsQueryBuilder

Expression🔗

Math expression query

func (builder *CloudWatchMetricsQueryBuilder) Expression(expression string) *CloudWatchMetricsQueryBuilder

Hide🔗

If hide is set to true, Grafana will filter out the response(s) associated with this query before returning it to the panel.

func (builder *CloudWatchMetricsQueryBuilder) Hide(hide bool) *CloudWatchMetricsQueryBuilder

Id🔗

ID can be used to reference other queries in math expressions. The ID can include numbers, letters, and underscore, and must start with a lowercase letter.

func (builder *CloudWatchMetricsQueryBuilder) Id(id string) *CloudWatchMetricsQueryBuilder

Label🔗

Change the time series legend names using dynamic labels. See https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html for more details.

func (builder *CloudWatchMetricsQueryBuilder) Label(label string) *CloudWatchMetricsQueryBuilder

MatchExact🔗

Only show metrics that exactly match all defined dimension names.

func (builder *CloudWatchMetricsQueryBuilder) MatchExact(matchExact bool) *CloudWatchMetricsQueryBuilder

MetricEditorMode🔗

Whether to use the query builder or code editor to create the query

func (builder *CloudWatchMetricsQueryBuilder) MetricEditorMode(metricEditorMode cloudwatch.MetricEditorMode) *CloudWatchMetricsQueryBuilder

MetricName🔗

Name of the metric

func (builder *CloudWatchMetricsQueryBuilder) MetricName(metricName string) *CloudWatchMetricsQueryBuilder

MetricQueryType🔗

Whether to use a metric search or metric insights query

func (builder *CloudWatchMetricsQueryBuilder) MetricQueryType(metricQueryType cloudwatch.MetricQueryType) *CloudWatchMetricsQueryBuilder

Namespace🔗

A namespace is a container for CloudWatch metrics. Metrics in different namespaces are isolated from each other, so that metrics from different applications are not mistakenly aggregated into the same statistics. For example, Amazon EC2 uses the AWS/EC2 namespace.

func (builder *CloudWatchMetricsQueryBuilder) Namespace(namespace string) *CloudWatchMetricsQueryBuilder

Period🔗

The length of time associated with a specific Amazon CloudWatch statistic. Can be specified by a number of seconds, 'auto', or as a duration string e.g. '15m' being 15 minutes

func (builder *CloudWatchMetricsQueryBuilder) Period(period string) *CloudWatchMetricsQueryBuilder

QueryMode🔗

Whether a query is a Metrics, Logs, or Annotations query

func (builder *CloudWatchMetricsQueryBuilder) QueryMode(queryMode cloudwatch.CloudWatchQueryMode) *CloudWatchMetricsQueryBuilder

QueryType🔗

Specify the query flavor

TODO make this required and give it a default

func (builder *CloudWatchMetricsQueryBuilder) QueryType(queryType string) *CloudWatchMetricsQueryBuilder

RefId🔗

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.

func (builder *CloudWatchMetricsQueryBuilder) RefId(refId string) *CloudWatchMetricsQueryBuilder

Region🔗

AWS region to query for the metric

func (builder *CloudWatchMetricsQueryBuilder) Region(region string) *CloudWatchMetricsQueryBuilder

Sql🔗

When the metric query type is set to Insights and the metricEditorMode is set to Builder, this field is used to build up an object representation of a SQL query.

func (builder *CloudWatchMetricsQueryBuilder) Sql(sql cog.Builder[cloudwatch.SQLExpression]) *CloudWatchMetricsQueryBuilder

SqlExpression🔗

When the metric query type is set to Insights, this field is used to specify the query string.

func (builder *CloudWatchMetricsQueryBuilder) SqlExpression(sqlExpression string) *CloudWatchMetricsQueryBuilder

Statistic🔗

Metric data aggregations over specified periods of time. For detailed definitions of the statistics supported by CloudWatch, see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html.

func (builder *CloudWatchMetricsQueryBuilder) Statistic(statistic string) *CloudWatchMetricsQueryBuilder

Statistics🔗

@deprecated use statistic

func (builder *CloudWatchMetricsQueryBuilder) Statistics(statistics []string) *CloudWatchMetricsQueryBuilder

See also🔗