datadog_dashboards
Advanced tools
Comparing version 2.5.0 to 2.5.1
34
index.js
@@ -9,2 +9,3 @@ #!/usr/bin/env node | ||
CloudwatchAlbGraphFactory = require("./factories/cloudwatch/alb"); | ||
CloudwatchApiGatewayGraphFactory = require("./factories/cloudwatch/api_gateway"); | ||
CloudwatchAsgGraphFactory = require("./factories/cloudwatch/asg"); | ||
@@ -202,2 +203,30 @@ CloudwatchDynamoPanelFactory = require("./factories/cloudwatch/dynamodb"); | ||
/** | ||
* Generates widgets for all API gateways. | ||
* | ||
* @param {object} gateways | ||
* @param {array} widgets | ||
* @param {object} state | ||
*/ | ||
function generateApiGatewayGraphs(gateways, region, widgets = [], state) { | ||
if (!gateways) return; | ||
const factory = new CloudwatchApiGatewayGraphFactory(region); | ||
Object.keys(gateways).forEach(key => { | ||
const title = gateways[key].title ? `API Gateway: ${gateways[key].title}` : `API Gateway: ${gateways[key].name}` | ||
widgets.push(titleWidget(title, state)); | ||
widgets.push(factory.render('calls', gateways[key], state)); | ||
widgets.push(factory.render('latency', gateways[key], state)); | ||
state.position += 16; | ||
widgets.push(factory.render('4xx', gateways[key], state)); | ||
widgets.push(factory.render('5xx', gateways[key], state)); | ||
state.position += 16; | ||
}); | ||
} | ||
/** | ||
* Generates widgets for instances in all auto scaling groups. | ||
@@ -426,2 +455,7 @@ * | ||
// API Gateway | ||
if (vars.api_gateways) { | ||
generateApiGatewayGraphs(vars.api_gateways, vars.region, dashboard.widgets, state); | ||
} | ||
// ASGS | ||
@@ -428,0 +462,0 @@ if (vars.asgs) { |
{ | ||
"name": "datadog_dashboards", | ||
"version": "2.5.0", | ||
"version": "2.5.1", | ||
"description": "A quick way to generate helpful, pre-canned datadog dashboards for Cloudwatch.", | ||
@@ -5,0 +5,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
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
128985
78
1335