datadog_dashboards
Advanced tools
Comparing version 2.1.1 to 2.2.0
@@ -8,3 +8,8 @@ 'use strict'; | ||
region: 'put AWS region here', | ||
rds_id: 'AWS rds id', | ||
rds_ids: [ | ||
{ | ||
id: 'RDS instance id here', | ||
name: 'Primary' //optional | ||
}, | ||
], | ||
alb: [ | ||
@@ -11,0 +16,0 @@ { |
41
index.js
@@ -342,21 +342,31 @@ #!/usr/bin/env node | ||
function generateRdsGraphs(rdsId, widgets = [], state) { | ||
if (!rdsId) return; | ||
function generateRdsGraphs(rdsIds, widgets = [], state) { | ||
if (!rdsIds) return; | ||
const rds = new CloudwatchRdsGraphFactory(); | ||
widgets.push(titleWidget(`RDS: ${rdsId}`, state)); | ||
rdsIds.forEach(function(rdsInstance) { | ||
let rdsId; | ||
let rdsName = null; | ||
if (typeof rdsInstance === 'string' || rdsInstance instanceof String) { | ||
rdsId = rdsInstance; | ||
} else { | ||
rdsId = rdsInstance.id; | ||
rdsName = rdsInstance.name; | ||
} | ||
widgets.push(titleWidget(`RDS: ${rdsName ? `${rdsName} (${rdsId})` : rdsId}`, state)); | ||
widgets.push(rds.render('rds_cpu', rdsId, state)); | ||
widgets.push(rds.render('rds_memory', rdsId, state)); | ||
widgets.push(rds.render('rds_connections', rdsId, state)); | ||
widgets.push(rds.render('rds_cpu', rdsId, state)); | ||
widgets.push(rds.render('rds_memory', rdsId, state)); | ||
widgets.push(rds.render('rds_connections', rdsId, state)); | ||
state.position += 16; | ||
state.position += 16; | ||
widgets.push(rds.render('rds_throughput', rdsId, state)); | ||
widgets.push(rds.render('rds_storage', rdsId, state)); | ||
widgets.push(rds.render('rds_iops', rdsId, state)); | ||
widgets.push(rds.render('rds_burstBalance', rdsId, state)); | ||
widgets.push(rds.render('rds_throughput', rdsId, state)); | ||
widgets.push(rds.render('rds_storage', rdsId, state)); | ||
widgets.push(rds.render('rds_iops', rdsId, state)); | ||
widgets.push(rds.render('rds_burstBalance', rdsId, state)); | ||
state.position += 16; | ||
state.position += 16; | ||
}) | ||
} | ||
@@ -434,6 +444,11 @@ | ||
// RDS | ||
// Support multiple RDS instances in an backwards compatible fashion | ||
if (vars.rds_id) { | ||
generateRdsGraphs(vars.rds_id, dashboard.widgets, state); | ||
generateRdsGraphs([vars.rds_id], dashboard.widgets, state); | ||
} | ||
if (vars.rds_ids) { | ||
generateRdsGraphs(vars.rds_ids, dashboard.widgets, state); | ||
} | ||
// Caches | ||
@@ -440,0 +455,0 @@ if (vars.caches) { |
{ | ||
"name": "datadog_dashboards", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"description": "A quick way to generate helpful, pre-canned datadog dashboards for Cloudwatch.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1279
80343
63