Skip to content

Support for AWS CloudWatch Datasource in Grafana Variables #169

Answered by Duologic
isarns asked this question in Q&A
Discussion options

You must be logged in to vote

It looks like this is possible with the current grafonnet, example:

local g = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet';
local query = g.dashboard.variable.query;
local cloudwatch = g.query.cloudWatch.CloudWatchMetricsQuery;

query.new(
  'ALB',
  cloudwatch.withQueryType('dimensionValues')
  + cloudwatch.withNamespace('AWS/ApplicationELB')
  + cloudwatch.withRefId('CloudWatchVariableQueryEditor-VariableQuery')
  + cloudwatch.withMetricName('RequestCount')
  + { dimensionKey: 'LoadBalancer' }  // didn't find in `cloudwatch`
)
+ query.withDatasource('cloudwatch', 'cloudwatch-ds')
+ query.generalOptions.withLabel('alb_name')
+ query.generalOptions.withCurrent('…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dhanush-lokesh-ocl
Comment options

Answer selected by isarns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #168 on February 22, 2024 13:51.