This repository has been archived on 2023-04-02. You can view files and clone it, but cannot push or open issues or pull requests.
gitops-tbrnt/monitoring/vendor/github.com/grafana/grafonnet-lib/grafonnet/cloudwatch.libsonnet

52 lines
1.2 KiB
Plaintext

{
/**
* Creates a [CloudWatch target](https://grafana.com/docs/grafana/latest/features/datasources/cloudwatch/)
*
* @name cloudwatch.target
*
* @param region
* @param namespace
* @param metric
* @param datasource (optional)
* @param statistic (default: `'Average'`)
* @param alias (optional)
* @param highResolution (default: `false`)
* @param period (default: `'1m'`)
* @param dimensions (optional)
* @param id (optional)
* @param expression (optional)
* @param hide (optional)
* @return Panel target
*/
target(
region,
namespace,
metric,
datasource=null,
statistic='Average',
alias=null,
highResolution=false,
period='1m',
dimensions={},
id=null,
expression=null,
hide=null
):: {
region: region,
namespace: namespace,
metricName: metric,
[if datasource != null then 'datasource']: datasource,
statistics: [statistic],
[if alias != null then 'alias']: alias,
highResolution: highResolution,
period: period,
dimensions: dimensions,
[if id != null then 'id']: id,
[if expression != null then 'expression']: expression,
[if hide != null then 'hide']: hide,
},
}