Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

serverless-plugin-datadog

Package Overview
Dependencies
Maintainers
1
Versions
185
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-plugin-datadog - npm Package Compare versions

Comparing version 2.10.1 to 2.11.0

4

dist/env.js

@@ -15,3 +15,2 @@ "use strict";

const logForwardingEnvVar = "DD_FLUSH_TO_LOG";
const ddTracingEnabledEnvVar = "DD_TRACE_ENABLED";
exports.defaultConfiguration = {

@@ -47,5 +46,2 @@ addLayers: true,

}
if (config.enableDDTracing !== undefined && environment[ddTracingEnabledEnvVar] === undefined) {
environment[ddTracingEnabledEnvVar] = config.enableDDTracing;
}
}

@@ -52,0 +48,0 @@ exports.setEnvConfiguration = setEnvConfiguration;

@@ -18,8 +18,4 @@ "use strict";

function addCloudWatchForwarderSubscriptions(service, aws, functionArn) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
const resources = (_a = service.provider.compiledCloudFormationTemplate) === null || _a === void 0 ? void 0 : _a.Resources;
if (resources === undefined) {
return ["No cloudformation stack available. Skipping subscribing Datadog forwarder."];
}
const resources = service.provider.compiledCloudFormationTemplate.Resources;
const errors = [];

@@ -32,7 +28,3 @@ for (const [name, resource] of Object.entries(resources)) {

const scopedSubName = `${name}Subscription`;
let expectedSubName = `${service.getServiceName()}-${aws.getStage()}-${scopedSubName}-`;
const stackName = aws.naming.getStackName();
if (stackName) {
expectedSubName = `${stackName}-${scopedSubName}-`;
}
const expectedSubName = `${service.getServiceName()}-${aws.getStage()}-${scopedSubName}-`;
const canSub = yield canSubscribeLogGroup(aws, logGroupName, expectedSubName);

@@ -39,0 +31,0 @@ if (!canSub) {

2

dist/index.js

@@ -44,5 +44,7 @@ "use strict";

"after:deploy:function:packageFunction": this.afterPackageFunction.bind(this),
"after:invoke:local:invoke": this.afterPackageFunction.bind(this),
"after:package:createDeploymentArtifacts": this.afterPackageFunction.bind(this),
"after:package:initialize": this.beforePackageFunction.bind(this),
"before:deploy:function:packageFunction": this.beforePackageFunction.bind(this),
"before:invoke:local:invoke": this.beforePackageFunction.bind(this),
"before:offline:start:init": this.beforePackageFunction.bind(this),

@@ -49,0 +51,0 @@ "before:step-functions-offline:start": this.beforePackageFunction.bind(this),

@@ -5,142 +5,142 @@ {

"nodejs8.10": "arn:aws:lambda:us-east-2:464622532012:layer:Datadog-Node8-10:18",
"nodejs10.x": "arn:aws:lambda:us-east-2:464622532012:layer:Datadog-Node10-x:29",
"nodejs12.x": "arn:aws:lambda:us-east-2:464622532012:layer:Datadog-Node12-x:29",
"python2.7": "arn:aws:lambda:us-east-2:464622532012:layer:Datadog-Python27:21",
"python3.6": "arn:aws:lambda:us-east-2:464622532012:layer:Datadog-Python36:21",
"python3.7": "arn:aws:lambda:us-east-2:464622532012:layer:Datadog-Python37:21",
"python3.8": "arn:aws:lambda:us-east-2:464622532012:layer:Datadog-Python38:21"
"nodejs10.x": "arn:aws:lambda:us-east-2:464622532012:layer:Datadog-Node10-x:27",
"nodejs12.x": "arn:aws:lambda:us-east-2:464622532012:layer:Datadog-Node12-x:27",
"python2.7": "arn:aws:lambda:us-east-2:464622532012:layer:Datadog-Python27:19",
"python3.6": "arn:aws:lambda:us-east-2:464622532012:layer:Datadog-Python36:19",
"python3.7": "arn:aws:lambda:us-east-2:464622532012:layer:Datadog-Python37:19",
"python3.8": "arn:aws:lambda:us-east-2:464622532012:layer:Datadog-Python38:19"
},
"us-east-1": {
"nodejs8.10": "arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Node8-10:18",
"nodejs10.x": "arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Node10-x:29",
"nodejs12.x": "arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Node12-x:29",
"python2.7": "arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Python27:21",
"python3.6": "arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Python36:21",
"python3.7": "arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Python37:21",
"python3.8": "arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Python38:21"
"nodejs10.x": "arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Node10-x:27",
"nodejs12.x": "arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Node12-x:27",
"python2.7": "arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Python27:19",
"python3.6": "arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Python36:19",
"python3.7": "arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Python37:19",
"python3.8": "arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Python38:19"
},
"us-west-1": {
"nodejs8.10": "arn:aws:lambda:us-west-1:464622532012:layer:Datadog-Node8-10:18",
"nodejs10.x": "arn:aws:lambda:us-west-1:464622532012:layer:Datadog-Node10-x:29",
"nodejs12.x": "arn:aws:lambda:us-west-1:464622532012:layer:Datadog-Node12-x:29",
"python2.7": "arn:aws:lambda:us-west-1:464622532012:layer:Datadog-Python27:21",
"python3.6": "arn:aws:lambda:us-west-1:464622532012:layer:Datadog-Python36:21",
"python3.7": "arn:aws:lambda:us-west-1:464622532012:layer:Datadog-Python37:21",
"python3.8": "arn:aws:lambda:us-west-1:464622532012:layer:Datadog-Python38:21"
"nodejs10.x": "arn:aws:lambda:us-west-1:464622532012:layer:Datadog-Node10-x:27",
"nodejs12.x": "arn:aws:lambda:us-west-1:464622532012:layer:Datadog-Node12-x:27",
"python2.7": "arn:aws:lambda:us-west-1:464622532012:layer:Datadog-Python27:19",
"python3.6": "arn:aws:lambda:us-west-1:464622532012:layer:Datadog-Python36:19",
"python3.7": "arn:aws:lambda:us-west-1:464622532012:layer:Datadog-Python37:19",
"python3.8": "arn:aws:lambda:us-west-1:464622532012:layer:Datadog-Python38:19"
},
"us-west-2": {
"nodejs8.10": "arn:aws:lambda:us-west-2:464622532012:layer:Datadog-Node8-10:18",
"nodejs10.x": "arn:aws:lambda:us-west-2:464622532012:layer:Datadog-Node10-x:29",
"nodejs12.x": "arn:aws:lambda:us-west-2:464622532012:layer:Datadog-Node12-x:29",
"python2.7": "arn:aws:lambda:us-west-2:464622532012:layer:Datadog-Python27:21",
"python3.6": "arn:aws:lambda:us-west-2:464622532012:layer:Datadog-Python36:21",
"python3.7": "arn:aws:lambda:us-west-2:464622532012:layer:Datadog-Python37:21",
"python3.8": "arn:aws:lambda:us-west-2:464622532012:layer:Datadog-Python38:21"
"nodejs10.x": "arn:aws:lambda:us-west-2:464622532012:layer:Datadog-Node10-x:27",
"nodejs12.x": "arn:aws:lambda:us-west-2:464622532012:layer:Datadog-Node12-x:27",
"python2.7": "arn:aws:lambda:us-west-2:464622532012:layer:Datadog-Python27:19",
"python3.6": "arn:aws:lambda:us-west-2:464622532012:layer:Datadog-Python36:19",
"python3.7": "arn:aws:lambda:us-west-2:464622532012:layer:Datadog-Python37:19",
"python3.8": "arn:aws:lambda:us-west-2:464622532012:layer:Datadog-Python38:19"
},
"ap-east-1": {
"nodejs10.x": "arn:aws:lambda:ap-east-1:464622532012:layer:Datadog-Node10-x:29",
"nodejs12.x": "arn:aws:lambda:ap-east-1:464622532012:layer:Datadog-Node12-x:29",
"python2.7": "arn:aws:lambda:ap-east-1:464622532012:layer:Datadog-Python27:21",
"python3.6": "arn:aws:lambda:ap-east-1:464622532012:layer:Datadog-Python36:21",
"python3.7": "arn:aws:lambda:ap-east-1:464622532012:layer:Datadog-Python37:21",
"python3.8": "arn:aws:lambda:ap-east-1:464622532012:layer:Datadog-Python38:21"
"nodejs10.x": "arn:aws:lambda:ap-east-1:464622532012:layer:Datadog-Node10-x:27",
"nodejs12.x": "arn:aws:lambda:ap-east-1:464622532012:layer:Datadog-Node12-x:27",
"python2.7": "arn:aws:lambda:ap-east-1:464622532012:layer:Datadog-Python27:19",
"python3.6": "arn:aws:lambda:ap-east-1:464622532012:layer:Datadog-Python36:19",
"python3.7": "arn:aws:lambda:ap-east-1:464622532012:layer:Datadog-Python37:19",
"python3.8": "arn:aws:lambda:ap-east-1:464622532012:layer:Datadog-Python38:19"
},
"ap-south-1": {
"nodejs8.10": "arn:aws:lambda:ap-south-1:464622532012:layer:Datadog-Node8-10:18",
"nodejs10.x": "arn:aws:lambda:ap-south-1:464622532012:layer:Datadog-Node10-x:29",
"nodejs12.x": "arn:aws:lambda:ap-south-1:464622532012:layer:Datadog-Node12-x:29",
"python2.7": "arn:aws:lambda:ap-south-1:464622532012:layer:Datadog-Python27:21",
"python3.6": "arn:aws:lambda:ap-south-1:464622532012:layer:Datadog-Python36:21",
"python3.7": "arn:aws:lambda:ap-south-1:464622532012:layer:Datadog-Python37:21",
"python3.8": "arn:aws:lambda:ap-south-1:464622532012:layer:Datadog-Python38:21"
"nodejs10.x": "arn:aws:lambda:ap-south-1:464622532012:layer:Datadog-Node10-x:27",
"nodejs12.x": "arn:aws:lambda:ap-south-1:464622532012:layer:Datadog-Node12-x:27",
"python2.7": "arn:aws:lambda:ap-south-1:464622532012:layer:Datadog-Python27:19",
"python3.6": "arn:aws:lambda:ap-south-1:464622532012:layer:Datadog-Python36:19",
"python3.7": "arn:aws:lambda:ap-south-1:464622532012:layer:Datadog-Python37:19",
"python3.8": "arn:aws:lambda:ap-south-1:464622532012:layer:Datadog-Python38:19"
},
"ap-northeast-2": {
"nodejs8.10": "arn:aws:lambda:ap-northeast-2:464622532012:layer:Datadog-Node8-10:18",
"nodejs10.x": "arn:aws:lambda:ap-northeast-2:464622532012:layer:Datadog-Node10-x:29",
"nodejs12.x": "arn:aws:lambda:ap-northeast-2:464622532012:layer:Datadog-Node12-x:29",
"python2.7": "arn:aws:lambda:ap-northeast-2:464622532012:layer:Datadog-Python27:21",
"python3.6": "arn:aws:lambda:ap-northeast-2:464622532012:layer:Datadog-Python36:21",
"python3.7": "arn:aws:lambda:ap-northeast-2:464622532012:layer:Datadog-Python37:21",
"python3.8": "arn:aws:lambda:ap-northeast-2:464622532012:layer:Datadog-Python38:21"
"nodejs10.x": "arn:aws:lambda:ap-northeast-2:464622532012:layer:Datadog-Node10-x:27",
"nodejs12.x": "arn:aws:lambda:ap-northeast-2:464622532012:layer:Datadog-Node12-x:27",
"python2.7": "arn:aws:lambda:ap-northeast-2:464622532012:layer:Datadog-Python27:19",
"python3.6": "arn:aws:lambda:ap-northeast-2:464622532012:layer:Datadog-Python36:19",
"python3.7": "arn:aws:lambda:ap-northeast-2:464622532012:layer:Datadog-Python37:19",
"python3.8": "arn:aws:lambda:ap-northeast-2:464622532012:layer:Datadog-Python38:19"
},
"ap-southeast-1": {
"nodejs8.10": "arn:aws:lambda:ap-southeast-1:464622532012:layer:Datadog-Node8-10:18",
"nodejs10.x": "arn:aws:lambda:ap-southeast-1:464622532012:layer:Datadog-Node10-x:29",
"nodejs12.x": "arn:aws:lambda:ap-southeast-1:464622532012:layer:Datadog-Node12-x:29",
"python2.7": "arn:aws:lambda:ap-southeast-1:464622532012:layer:Datadog-Python27:21",
"python3.6": "arn:aws:lambda:ap-southeast-1:464622532012:layer:Datadog-Python36:21",
"python3.7": "arn:aws:lambda:ap-southeast-1:464622532012:layer:Datadog-Python37:21",
"python3.8": "arn:aws:lambda:ap-southeast-1:464622532012:layer:Datadog-Python38:21"
"nodejs10.x": "arn:aws:lambda:ap-southeast-1:464622532012:layer:Datadog-Node10-x:27",
"nodejs12.x": "arn:aws:lambda:ap-southeast-1:464622532012:layer:Datadog-Node12-x:27",
"python2.7": "arn:aws:lambda:ap-southeast-1:464622532012:layer:Datadog-Python27:19",
"python3.6": "arn:aws:lambda:ap-southeast-1:464622532012:layer:Datadog-Python36:19",
"python3.7": "arn:aws:lambda:ap-southeast-1:464622532012:layer:Datadog-Python37:19",
"python3.8": "arn:aws:lambda:ap-southeast-1:464622532012:layer:Datadog-Python38:19"
},
"ap-southeast-2": {
"nodejs8.10": "arn:aws:lambda:ap-southeast-2:464622532012:layer:Datadog-Node8-10:18",
"nodejs10.x": "arn:aws:lambda:ap-southeast-2:464622532012:layer:Datadog-Node10-x:29",
"nodejs12.x": "arn:aws:lambda:ap-southeast-2:464622532012:layer:Datadog-Node12-x:29",
"python2.7": "arn:aws:lambda:ap-southeast-2:464622532012:layer:Datadog-Python27:21",
"python3.6": "arn:aws:lambda:ap-southeast-2:464622532012:layer:Datadog-Python36:21",
"python3.7": "arn:aws:lambda:ap-southeast-2:464622532012:layer:Datadog-Python37:21",
"python3.8": "arn:aws:lambda:ap-southeast-2:464622532012:layer:Datadog-Python38:21"
"nodejs10.x": "arn:aws:lambda:ap-southeast-2:464622532012:layer:Datadog-Node10-x:27",
"nodejs12.x": "arn:aws:lambda:ap-southeast-2:464622532012:layer:Datadog-Node12-x:27",
"python2.7": "arn:aws:lambda:ap-southeast-2:464622532012:layer:Datadog-Python27:19",
"python3.6": "arn:aws:lambda:ap-southeast-2:464622532012:layer:Datadog-Python36:19",
"python3.7": "arn:aws:lambda:ap-southeast-2:464622532012:layer:Datadog-Python37:19",
"python3.8": "arn:aws:lambda:ap-southeast-2:464622532012:layer:Datadog-Python38:19"
},
"ap-northeast-1": {
"nodejs8.10": "arn:aws:lambda:ap-northeast-1:464622532012:layer:Datadog-Node8-10:18",
"nodejs10.x": "arn:aws:lambda:ap-northeast-1:464622532012:layer:Datadog-Node10-x:29",
"nodejs12.x": "arn:aws:lambda:ap-northeast-1:464622532012:layer:Datadog-Node12-x:29",
"python2.7": "arn:aws:lambda:ap-northeast-1:464622532012:layer:Datadog-Python27:21",
"python3.6": "arn:aws:lambda:ap-northeast-1:464622532012:layer:Datadog-Python36:21",
"python3.7": "arn:aws:lambda:ap-northeast-1:464622532012:layer:Datadog-Python37:21",
"python3.8": "arn:aws:lambda:ap-northeast-1:464622532012:layer:Datadog-Python38:21"
"nodejs10.x": "arn:aws:lambda:ap-northeast-1:464622532012:layer:Datadog-Node10-x:27",
"nodejs12.x": "arn:aws:lambda:ap-northeast-1:464622532012:layer:Datadog-Node12-x:27",
"python2.7": "arn:aws:lambda:ap-northeast-1:464622532012:layer:Datadog-Python27:19",
"python3.6": "arn:aws:lambda:ap-northeast-1:464622532012:layer:Datadog-Python36:19",
"python3.7": "arn:aws:lambda:ap-northeast-1:464622532012:layer:Datadog-Python37:19",
"python3.8": "arn:aws:lambda:ap-northeast-1:464622532012:layer:Datadog-Python38:19"
},
"ca-central-1": {
"nodejs8.10": "arn:aws:lambda:ca-central-1:464622532012:layer:Datadog-Node8-10:18",
"nodejs10.x": "arn:aws:lambda:ca-central-1:464622532012:layer:Datadog-Node10-x:29",
"nodejs12.x": "arn:aws:lambda:ca-central-1:464622532012:layer:Datadog-Node12-x:29",
"python2.7": "arn:aws:lambda:ca-central-1:464622532012:layer:Datadog-Python27:21",
"python3.6": "arn:aws:lambda:ca-central-1:464622532012:layer:Datadog-Python36:21",
"python3.7": "arn:aws:lambda:ca-central-1:464622532012:layer:Datadog-Python37:21",
"python3.8": "arn:aws:lambda:ca-central-1:464622532012:layer:Datadog-Python38:21"
"nodejs10.x": "arn:aws:lambda:ca-central-1:464622532012:layer:Datadog-Node10-x:27",
"nodejs12.x": "arn:aws:lambda:ca-central-1:464622532012:layer:Datadog-Node12-x:27",
"python2.7": "arn:aws:lambda:ca-central-1:464622532012:layer:Datadog-Python27:19",
"python3.6": "arn:aws:lambda:ca-central-1:464622532012:layer:Datadog-Python36:19",
"python3.7": "arn:aws:lambda:ca-central-1:464622532012:layer:Datadog-Python37:19",
"python3.8": "arn:aws:lambda:ca-central-1:464622532012:layer:Datadog-Python38:19"
},
"eu-north-1": {
"nodejs8.10": "arn:aws:lambda:eu-north-1:464622532012:layer:Datadog-Node8-10:18",
"nodejs10.x": "arn:aws:lambda:eu-north-1:464622532012:layer:Datadog-Node10-x:29",
"nodejs12.x": "arn:aws:lambda:eu-north-1:464622532012:layer:Datadog-Node12-x:29",
"python2.7": "arn:aws:lambda:eu-north-1:464622532012:layer:Datadog-Python27:21",
"python3.6": "arn:aws:lambda:eu-north-1:464622532012:layer:Datadog-Python36:21",
"python3.7": "arn:aws:lambda:eu-north-1:464622532012:layer:Datadog-Python37:21",
"python3.8": "arn:aws:lambda:eu-north-1:464622532012:layer:Datadog-Python38:21"
"nodejs10.x": "arn:aws:lambda:eu-north-1:464622532012:layer:Datadog-Node10-x:27",
"nodejs12.x": "arn:aws:lambda:eu-north-1:464622532012:layer:Datadog-Node12-x:27",
"python2.7": "arn:aws:lambda:eu-north-1:464622532012:layer:Datadog-Python27:19",
"python3.6": "arn:aws:lambda:eu-north-1:464622532012:layer:Datadog-Python36:19",
"python3.7": "arn:aws:lambda:eu-north-1:464622532012:layer:Datadog-Python37:19",
"python3.8": "arn:aws:lambda:eu-north-1:464622532012:layer:Datadog-Python38:19"
},
"eu-central-1": {
"nodejs8.10": "arn:aws:lambda:eu-central-1:464622532012:layer:Datadog-Node8-10:18",
"nodejs10.x": "arn:aws:lambda:eu-central-1:464622532012:layer:Datadog-Node10-x:29",
"nodejs12.x": "arn:aws:lambda:eu-central-1:464622532012:layer:Datadog-Node12-x:29",
"python2.7": "arn:aws:lambda:eu-central-1:464622532012:layer:Datadog-Python27:21",
"python3.6": "arn:aws:lambda:eu-central-1:464622532012:layer:Datadog-Python36:21",
"python3.7": "arn:aws:lambda:eu-central-1:464622532012:layer:Datadog-Python37:21",
"python3.8": "arn:aws:lambda:eu-central-1:464622532012:layer:Datadog-Python38:21"
"nodejs10.x": "arn:aws:lambda:eu-central-1:464622532012:layer:Datadog-Node10-x:27",
"nodejs12.x": "arn:aws:lambda:eu-central-1:464622532012:layer:Datadog-Node12-x:27",
"python2.7": "arn:aws:lambda:eu-central-1:464622532012:layer:Datadog-Python27:19",
"python3.6": "arn:aws:lambda:eu-central-1:464622532012:layer:Datadog-Python36:19",
"python3.7": "arn:aws:lambda:eu-central-1:464622532012:layer:Datadog-Python37:19",
"python3.8": "arn:aws:lambda:eu-central-1:464622532012:layer:Datadog-Python38:19"
},
"eu-west-1": {
"nodejs8.10": "arn:aws:lambda:eu-west-1:464622532012:layer:Datadog-Node8-10:18",
"nodejs10.x": "arn:aws:lambda:eu-west-1:464622532012:layer:Datadog-Node10-x:29",
"nodejs12.x": "arn:aws:lambda:eu-west-1:464622532012:layer:Datadog-Node12-x:29",
"python2.7": "arn:aws:lambda:eu-west-1:464622532012:layer:Datadog-Python27:21",
"python3.6": "arn:aws:lambda:eu-west-1:464622532012:layer:Datadog-Python36:21",
"python3.7": "arn:aws:lambda:eu-west-1:464622532012:layer:Datadog-Python37:21",
"python3.8": "arn:aws:lambda:eu-west-1:464622532012:layer:Datadog-Python38:21"
"nodejs10.x": "arn:aws:lambda:eu-west-1:464622532012:layer:Datadog-Node10-x:27",
"nodejs12.x": "arn:aws:lambda:eu-west-1:464622532012:layer:Datadog-Node12-x:27",
"python2.7": "arn:aws:lambda:eu-west-1:464622532012:layer:Datadog-Python27:19",
"python3.6": "arn:aws:lambda:eu-west-1:464622532012:layer:Datadog-Python36:19",
"python3.7": "arn:aws:lambda:eu-west-1:464622532012:layer:Datadog-Python37:19",
"python3.8": "arn:aws:lambda:eu-west-1:464622532012:layer:Datadog-Python38:19"
},
"eu-west-2": {
"nodejs8.10": "arn:aws:lambda:eu-west-2:464622532012:layer:Datadog-Node8-10:18",
"nodejs10.x": "arn:aws:lambda:eu-west-2:464622532012:layer:Datadog-Node10-x:29",
"nodejs12.x": "arn:aws:lambda:eu-west-2:464622532012:layer:Datadog-Node12-x:29",
"python2.7": "arn:aws:lambda:eu-west-2:464622532012:layer:Datadog-Python27:21",
"python3.6": "arn:aws:lambda:eu-west-2:464622532012:layer:Datadog-Python36:21",
"python3.7": "arn:aws:lambda:eu-west-2:464622532012:layer:Datadog-Python37:21",
"python3.8": "arn:aws:lambda:eu-west-2:464622532012:layer:Datadog-Python38:21"
"nodejs10.x": "arn:aws:lambda:eu-west-2:464622532012:layer:Datadog-Node10-x:27",
"nodejs12.x": "arn:aws:lambda:eu-west-2:464622532012:layer:Datadog-Node12-x:27",
"python2.7": "arn:aws:lambda:eu-west-2:464622532012:layer:Datadog-Python27:19",
"python3.6": "arn:aws:lambda:eu-west-2:464622532012:layer:Datadog-Python36:19",
"python3.7": "arn:aws:lambda:eu-west-2:464622532012:layer:Datadog-Python37:19",
"python3.8": "arn:aws:lambda:eu-west-2:464622532012:layer:Datadog-Python38:19"
},
"eu-west-3": {
"nodejs8.10": "arn:aws:lambda:eu-west-3:464622532012:layer:Datadog-Node8-10:18",
"nodejs10.x": "arn:aws:lambda:eu-west-3:464622532012:layer:Datadog-Node10-x:29",
"nodejs12.x": "arn:aws:lambda:eu-west-3:464622532012:layer:Datadog-Node12-x:29",
"python2.7": "arn:aws:lambda:eu-west-3:464622532012:layer:Datadog-Python27:21",
"python3.6": "arn:aws:lambda:eu-west-3:464622532012:layer:Datadog-Python36:21",
"python3.7": "arn:aws:lambda:eu-west-3:464622532012:layer:Datadog-Python37:21",
"python3.8": "arn:aws:lambda:eu-west-3:464622532012:layer:Datadog-Python38:21"
"nodejs10.x": "arn:aws:lambda:eu-west-3:464622532012:layer:Datadog-Node10-x:27",
"nodejs12.x": "arn:aws:lambda:eu-west-3:464622532012:layer:Datadog-Node12-x:27",
"python2.7": "arn:aws:lambda:eu-west-3:464622532012:layer:Datadog-Python27:19",
"python3.6": "arn:aws:lambda:eu-west-3:464622532012:layer:Datadog-Python36:19",
"python3.7": "arn:aws:lambda:eu-west-3:464622532012:layer:Datadog-Python37:19",
"python3.8": "arn:aws:lambda:eu-west-3:464622532012:layer:Datadog-Python38:19"
},

@@ -151,8 +151,8 @@ "sa-east-1": {

"nodejs12.x": "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Node12-x:27",
"python2.7": "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Python27:21",
"python3.6": "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Python36:21",
"python3.7": "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Python37:21",
"python3.8": "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Python38:21"
"python2.7": "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Python27:19",
"python3.6": "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Python36:19",
"python3.7": "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Python37:19",
"python3.8": "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Python38:19"
}
}
}
{
"name": "serverless-plugin-datadog",
"version": "2.10.1",
"version": "2.11.0",
"description": "Serverless plugin to automatically instrument python and node functions with datadog tracing",

@@ -5,0 +5,0 @@ "main": "dist/src/index.js",

import Service from "serverless/classes/Service";
export interface Configuration {
enabled?: boolean;
addLayers: boolean;

@@ -14,2 +15,3 @@ apiKey?: string;

injectLogContext: boolean;
exclude: string[];
}

@@ -16,0 +18,0 @@ export declare const defaultConfiguration: Configuration;

@@ -26,2 +26,3 @@ "use strict";

injectLogContext: true,
exclude: [],
};

@@ -28,0 +29,0 @@ function setEnvConfiguration(config, service) {

@@ -53,3 +53,3 @@ "use strict";

"before:step-functions-offline:start": this.beforePackageFunction.bind(this),
"after:deploy:deploy": output_1.printOutputs.bind(null, this.serverless),
"after:deploy:deploy": this.afterDeploy.bind(this),
};

@@ -75,7 +75,9 @@ this.commands = {

return __awaiter(this, void 0, void 0, function* () {
const config = env_1.getConfig(this.serverless.service);
if (config.enabled === false)
return;
this.serverless.cli.log("Auto instrumenting functions with Datadog");
const config = env_1.getConfig(this.serverless.service);
env_1.setEnvConfiguration(config, this.serverless.service);
const defaultRuntime = this.serverless.service.provider.runtime;
const handlers = layer_1.findHandlers(this.serverless.service, defaultRuntime);
const handlers = layer_1.findHandlers(this.serverless.service, config.exclude, defaultRuntime);
if (config.addLayers) {

@@ -109,2 +111,4 @@ this.serverless.cli.log("Adding Lambda Layers to functions");

const config = env_1.getConfig(this.serverless.service);
if (config.enabled === false)
return;
if (config.forwarder) {

@@ -123,3 +127,3 @@ const aws = this.serverless.getProvider("aws");

const defaultRuntime = this.serverless.service.provider.runtime;
const handlers = layer_1.findHandlers(this.serverless.service, defaultRuntime);
const handlers = layer_1.findHandlers(this.serverless.service, config.exclude, defaultRuntime);
wrapper_1.redirectHandlers(handlers, config.addLayers);

@@ -129,2 +133,10 @@ output_1.addOutputLinks(this.serverless, config.site);

}
afterDeploy() {
return __awaiter(this, void 0, void 0, function* () {
const config = env_1.getConfig(this.serverless.service);
if (config.enabled === false)
return;
return output_1.printOutputs(this.serverless);
});
}
debugLogHandlers(handlers) {

@@ -131,0 +143,0 @@ for (const handler of handlers) {

@@ -24,4 +24,4 @@ import { FunctionDefinition } from "serverless";

};
export declare function findHandlers(service: Service, defaultRuntime?: string): FunctionInfo[];
export declare function findHandlers(service: Service, exclude: string[], defaultRuntime?: string): FunctionInfo[];
export declare function applyLayers(region: string, handlers: FunctionInfo[], layers: LayerJSON): void;
//# sourceMappingURL=layer.d.ts.map

@@ -18,3 +18,3 @@ "use strict";

};
function findHandlers(service, defaultRuntime) {
function findHandlers(service, exclude, defaultRuntime) {
const funcs = service.functions;

@@ -32,3 +32,4 @@ return Object.entries(funcs)

})
.filter((result) => result !== undefined);
.filter((result) => result !== undefined)
.filter((result) => exclude === undefined || (exclude !== undefined && !exclude.includes(result.name)));
}

@@ -35,0 +36,0 @@ exports.findHandlers = findHandlers;

{
"name": "serverless-plugin-datadog",
"version": "2.10.1",
"version": "2.11.0",
"description": "Serverless plugin to automatically instrument python and node functions with datadog tracing",

@@ -5,0 +5,0 @@ "main": "dist/src/index.js",

@@ -38,3 +38,6 @@ # Datadog Serverless Plugin

| `injectLogContext` | When set, the lambda layer will automatically patch console.log with Datadog's tracing ids. Defaults to `true`. |
| `exclude` | When set, this plugin will ignore all specified functions. Use this parameter if you have any functions that should not include Datadog functionality. Defaults to `[]`. |
| `enabled` | When set to false, the DataDog plugin will stay inactive. Defaults to `true`. You can control this option using an environment variable, e.g. `enabled: ${strToBool(${env:DD_PLUGIN_ENABLED, true})}`, to activate/deactivate the plugin during deployment. Alernatively, you can also use the value passed in through `--stage` to control this option, [see example.](#disable-plugin-for-particular-environment)|
To use any of these parameters, add a `custom` > `datadog` section to your `serverless.yml` similar to this example:

@@ -55,2 +58,4 @@

injectLogContext: true
exclude:
- dd-excluded-function
```

@@ -81,3 +86,3 @@

**webpack.config.js**
```
```javascript
var nodeExternals = require('webpack-node-externals')

@@ -93,3 +98,3 @@

**serverless.yml**
```
```yaml
custom:

@@ -113,3 +118,21 @@ webpack:

### Disable Plugin for Particular Environment
If you'd like to turn off the plugin based on the environment (passed via `--stage`), you can use something similar to the example below.
```yaml
provider:
stage: ${self:opt.stage, 'dev'}
custom:
staged: ${self:custom.stageVars.${self:provider.stage}, {}}
stageVars:
dev:
dd_enabled: false
datadog:
enabled: ${self:custom.staged.dd_enabled, true}
```
## Opening Issues

@@ -116,0 +139,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc