serverless-plugin-datadog
Advanced tools
Comparing version 2.16.2 to 2.16.4
@@ -11,3 +11,2 @@ import Service from "serverless/classes/Service"; | ||
enableDDTracing: boolean; | ||
nodeModuleType?: "es6" | "node" | "typescript"; | ||
forwarder?: string; | ||
@@ -19,3 +18,2 @@ enableTags: boolean; | ||
export declare function getConfig(service: Service): Configuration; | ||
export declare function forceExcludeDepsFromWebpack(service: Service): void; | ||
//# sourceMappingURL=env.d.ts.map |
@@ -15,2 +15,3 @@ "use strict"; | ||
const logForwardingEnvVar = "DD_FLUSH_TO_LOG"; | ||
const ddTracingEnabledEnvVar = "DD_TRACE_ENABLED"; | ||
exports.defaultConfiguration = { | ||
@@ -21,3 +22,3 @@ addLayers: true, | ||
site: "datadoghq.com", | ||
enableXrayTracing: true, | ||
enableXrayTracing: false, | ||
enableDDTracing: true, | ||
@@ -47,2 +48,5 @@ enableTags: true, | ||
} | ||
if (config.enableDDTracing !== undefined && environment[ddTracingEnabledEnvVar] === undefined) { | ||
environment[ddTracingEnabledEnvVar] = config.enableDDTracing; | ||
} | ||
} | ||
@@ -62,34 +66,2 @@ exports.setEnvConfiguration = setEnvConfiguration; | ||
exports.getConfig = getConfig; | ||
function forceExcludeDepsFromWebpack(service) { | ||
const includeModules = getPropertyFromPath(service, ["custom", "webpack", "includeModules"]); | ||
if (includeModules === undefined) { | ||
return; | ||
} | ||
let forceExclude = includeModules.forceExclude; | ||
if (forceExclude === undefined) { | ||
forceExclude = []; | ||
includeModules.forceExclude = forceExclude; | ||
} | ||
if (!forceExclude.includes("datadog-lambda-js")) { | ||
forceExclude.push("datadog-lambda-js"); | ||
} | ||
if (!forceExclude.includes("dd-trace")) { | ||
forceExclude.push("dd-trace"); | ||
} | ||
} | ||
exports.forceExcludeDepsFromWebpack = forceExcludeDepsFromWebpack; | ||
function getPropertyFromPath(obj, path) { | ||
for (const part of path) { | ||
let prop = obj[part]; | ||
if (prop === undefined || prop === true) { | ||
prop = {}; | ||
obj[part] = prop; | ||
} | ||
if (prop === false) { | ||
return; | ||
} | ||
obj = prop; | ||
} | ||
return obj; | ||
} | ||
//# sourceMappingURL=env.js.map |
@@ -18,4 +18,8 @@ "use strict"; | ||
function addCloudWatchForwarderSubscriptions(service, aws, functionArn) { | ||
var _a; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const resources = service.provider.compiledCloudFormationTemplate.Resources; | ||
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 errors = []; | ||
@@ -28,3 +32,7 @@ for (const [name, resource] of Object.entries(resources)) { | ||
const scopedSubName = `${name}Subscription`; | ||
const expectedSubName = `${service.getServiceName()}-${aws.getStage()}-${scopedSubName}-`; | ||
let expectedSubName = `${service.getServiceName()}-${aws.getStage()}-${scopedSubName}-`; | ||
const stackName = aws.naming.getStackName(); | ||
if (stackName) { | ||
expectedSubName = `${stackName}-${scopedSubName}-`; | ||
} | ||
const canSub = yield canSubscribeLogGroup(aws, logGroupName, expectedSubName); | ||
@@ -31,0 +39,0 @@ if (!canSub) { |
import { FunctionDefinition } from "serverless"; | ||
export interface FunctionDefinitionWithTags extends FunctionDefinition { | ||
export interface ExtendedFunctionDefinition extends FunctionDefinition { | ||
tags?: { | ||
[key: string]: string; | ||
}; | ||
environment?: { | ||
[key: string]: string; | ||
}; | ||
} | ||
//# sourceMappingURL=index.d.ts.map |
@@ -31,4 +31,2 @@ "use strict"; | ||
const wrapper_1 = require("./wrapper"); | ||
const util_1 = require("./util"); | ||
const common_1 = require("./templates/common"); | ||
const forwarder_1 = require("./forwarder"); | ||
@@ -47,7 +45,5 @@ var TagKeys; | ||
"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), | ||
@@ -79,15 +75,3 @@ "before:step-functions-offline:start": this.beforePackageFunction.bind(this), | ||
const defaultRuntime = this.serverless.service.provider.runtime; | ||
let defaultNodeRuntime; | ||
switch (config.nodeModuleType) { | ||
case "es6": | ||
defaultNodeRuntime = layer_1.RuntimeType.NODE_ES6; | ||
break; | ||
case "typescript": | ||
defaultNodeRuntime = layer_1.RuntimeType.NODE_TS; | ||
break; | ||
case "node": | ||
defaultNodeRuntime = layer_1.RuntimeType.NODE; | ||
break; | ||
} | ||
const handlers = layer_1.findHandlers(this.serverless.service, defaultRuntime, defaultNodeRuntime); | ||
const handlers = layer_1.findHandlers(this.serverless.service, defaultRuntime); | ||
if (config.addLayers) { | ||
@@ -97,5 +81,2 @@ this.serverless.cli.log("Adding Lambda Layers to functions"); | ||
layer_1.applyLayers(this.serverless.service.provider.region, handlers, layers); | ||
if (util_1.hasWebpackPlugin(this.serverless.service)) { | ||
env_1.forceExcludeDepsFromWebpack(this.serverless.service); | ||
} | ||
} | ||
@@ -105,14 +86,13 @@ else { | ||
} | ||
let tracingMode = common_1.TracingMode.NONE; | ||
let tracingMode = tracing_1.TracingMode.NONE; | ||
if (config.enableXrayTracing && config.enableDDTracing) { | ||
tracingMode = common_1.TracingMode.HYBRID; | ||
tracingMode = tracing_1.TracingMode.HYBRID; | ||
} | ||
else if (config.enableDDTracing) { | ||
tracingMode = common_1.TracingMode.DD_TRACE; | ||
tracingMode = tracing_1.TracingMode.DD_TRACE; | ||
} | ||
else if (config.enableXrayTracing) { | ||
tracingMode = common_1.TracingMode.XRAY; | ||
tracingMode = tracing_1.TracingMode.XRAY; | ||
} | ||
tracing_1.enableTracing(this.serverless.service, tracingMode); | ||
yield wrapper_1.writeHandlers(this.serverless.service, handlers, tracingMode); | ||
}); | ||
@@ -134,4 +114,5 @@ } | ||
} | ||
this.serverless.cli.log("Cleaning up Datadog Handlers"); | ||
yield wrapper_1.cleanupHandlers(); | ||
const defaultRuntime = this.serverless.service.provider.runtime; | ||
const handlers = layer_1.findHandlers(this.serverless.service, defaultRuntime); | ||
wrapper_1.redirectHandlers(handlers, config.addLayers); | ||
}); | ||
@@ -151,19 +132,37 @@ } | ||
} | ||
/** | ||
* Check for service and env tags on provider level (under tags and stackTags), | ||
* as well as function level. Automatically create tags for service and env with | ||
* properties from deployment configurations if needed; does not override any existing values. | ||
*/ | ||
addServiceAndEnvTags() { | ||
this.serverless.service.getAllFunctions().forEach((functionName) => { | ||
const functionDefintion = this.serverless.service.getFunction(functionName); | ||
if (!functionDefintion.tags) { | ||
functionDefintion.tags = {}; | ||
} | ||
// Service tag | ||
if (!functionDefintion.tags[TagKeys.Service]) { | ||
functionDefintion.tags[TagKeys.Service] = this.serverless.service.getServiceName(); | ||
} | ||
// Environment tag | ||
if (!functionDefintion.tags[TagKeys.Env]) { | ||
functionDefintion.tags[TagKeys.Env] = this.serverless.getProvider("aws").getStage(); | ||
} | ||
}); | ||
let providerServiceTagExists = false; | ||
let providerEnvTagExists = false; | ||
const provider = this.serverless.service.provider; | ||
const providerTags = provider.tags; | ||
if (providerTags !== undefined) { | ||
providerServiceTagExists = providerTags[TagKeys.Service] !== undefined; | ||
providerEnvTagExists = providerTags[TagKeys.Env] !== undefined; | ||
} | ||
const providerStackTags = provider.stackTags; | ||
if (providerStackTags !== undefined) { | ||
providerServiceTagExists = providerServiceTagExists || providerStackTags[TagKeys.Service] !== undefined; | ||
providerEnvTagExists = providerEnvTagExists || providerStackTags[TagKeys.Env] !== undefined; | ||
} | ||
if (!providerServiceTagExists || !providerEnvTagExists) { | ||
this.serverless.service.getAllFunctions().forEach((functionName) => { | ||
const functionDefintion = this.serverless.service.getFunction(functionName); | ||
if (!functionDefintion.tags) { | ||
functionDefintion.tags = {}; | ||
} | ||
if (!providerServiceTagExists && !functionDefintion.tags[TagKeys.Service]) { | ||
functionDefintion.tags[TagKeys.Service] = this.serverless.service.getServiceName(); | ||
} | ||
if (!providerEnvTagExists && !functionDefintion.tags[TagKeys.Env]) { | ||
functionDefintion.tags[TagKeys.Env] = this.serverless.getProvider("aws").getStage(); | ||
} | ||
}); | ||
} | ||
} | ||
}; | ||
//# sourceMappingURL=index.js.map |
@@ -5,6 +5,4 @@ import { FunctionDefinition } from "serverless"; | ||
NODE = 0, | ||
NODE_TS = 1, | ||
NODE_ES6 = 2, | ||
PYTHON = 3, | ||
UNSUPPORTED = 4 | ||
PYTHON = 1, | ||
UNSUPPORTED = 2 | ||
} | ||
@@ -27,4 +25,4 @@ export interface FunctionInfo { | ||
}; | ||
export declare function findHandlers(service: Service, defaultRuntime?: string, defaultNodeRuntime?: RuntimeType.NODE_ES6 | RuntimeType.NODE_TS | RuntimeType.NODE): FunctionInfo[]; | ||
export declare function findHandlers(service: Service, defaultRuntime?: string): FunctionInfo[]; | ||
export declare function applyLayers(region: string, handlers: FunctionInfo[], layers: LayerJSON): void; | ||
//# sourceMappingURL=layer.d.ts.map |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/* | ||
* Unless explicitly stated otherwise all files in this repository are licensed | ||
* under the Apache License Version 2.0. | ||
* | ||
* This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
* Copyright 2019 Datadog, Inc. | ||
*/ | ||
const fs_1 = __importDefault(require("fs")); | ||
const util_1 = require("./util"); | ||
var RuntimeType; | ||
(function (RuntimeType) { | ||
RuntimeType[RuntimeType["NODE"] = 0] = "NODE"; | ||
RuntimeType[RuntimeType["NODE_TS"] = 1] = "NODE_TS"; | ||
RuntimeType[RuntimeType["NODE_ES6"] = 2] = "NODE_ES6"; | ||
RuntimeType[RuntimeType["PYTHON"] = 3] = "PYTHON"; | ||
RuntimeType[RuntimeType["UNSUPPORTED"] = 4] = "UNSUPPORTED"; | ||
RuntimeType[RuntimeType["PYTHON"] = 1] = "PYTHON"; | ||
RuntimeType[RuntimeType["UNSUPPORTED"] = 2] = "UNSUPPORTED"; | ||
})(RuntimeType = exports.RuntimeType || (exports.RuntimeType = {})); | ||
@@ -32,3 +18,3 @@ exports.runtimeLookup = { | ||
}; | ||
function findHandlers(service, defaultRuntime, defaultNodeRuntime) { | ||
function findHandlers(service, defaultRuntime) { | ||
const funcs = service.functions; | ||
@@ -42,23 +28,3 @@ return Object.entries(funcs) | ||
if (runtime !== undefined && runtime in exports.runtimeLookup) { | ||
const handlerInfo = { type: exports.runtimeLookup[runtime], runtime, name, handler }; | ||
if (handlerInfo.type === RuntimeType.NODE) { | ||
const handlerPath = util_1.getHandlerPath(handlerInfo); | ||
if (handlerPath === undefined) { | ||
return; | ||
} | ||
if (defaultNodeRuntime === undefined) { | ||
if (fs_1.default.existsSync(`./${handlerPath.filename}.es.js`) || | ||
fs_1.default.existsSync(`./${handlerPath.filename}.mjs`) || | ||
util_1.hasWebpackPlugin(service)) { | ||
handlerInfo.type = RuntimeType.NODE_ES6; | ||
} | ||
if (fs_1.default.existsSync(`./${handlerPath.filename}.ts`)) { | ||
handlerInfo.type = RuntimeType.NODE_TS; | ||
} | ||
} | ||
else { | ||
handlerInfo.type = defaultNodeRuntime; | ||
} | ||
} | ||
return handlerInfo; | ||
return { type: exports.runtimeLookup[runtime], runtime, name, handler }; | ||
} | ||
@@ -65,0 +31,0 @@ return { type: RuntimeType.UNSUPPORTED, runtime, name, handler }; |
@@ -5,153 +5,153 @@ { | ||
"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:22", | ||
"nodejs12.x": "arn:aws:lambda:us-east-2:464622532012:layer:Datadog-Node12-x:22", | ||
"python2.7": "arn:aws:lambda:us-east-2:464622532012:layer:Datadog-Python27:16", | ||
"python3.6": "arn:aws:lambda:us-east-2:464622532012:layer:Datadog-Python36:16", | ||
"python3.7": "arn:aws:lambda:us-east-2:464622532012:layer:Datadog-Python37:16", | ||
"python3.8": "arn:aws:lambda:us-east-2:464622532012:layer:Datadog-Python38:16" | ||
"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" | ||
}, | ||
"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:22", | ||
"nodejs12.x": "arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Node12-x:22", | ||
"python2.7": "arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Python27:16", | ||
"python3.6": "arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Python36:16", | ||
"python3.7": "arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Python37:16", | ||
"python3.8": "arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Python38:16" | ||
"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" | ||
}, | ||
"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:22", | ||
"nodejs12.x": "arn:aws:lambda:us-west-1:464622532012:layer:Datadog-Node12-x:22", | ||
"python2.7": "arn:aws:lambda:us-west-1:464622532012:layer:Datadog-Python27:16", | ||
"python3.6": "arn:aws:lambda:us-west-1:464622532012:layer:Datadog-Python36:16", | ||
"python3.7": "arn:aws:lambda:us-west-1:464622532012:layer:Datadog-Python37:16", | ||
"python3.8": "arn:aws:lambda:us-west-1:464622532012:layer:Datadog-Python38:16" | ||
"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" | ||
}, | ||
"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:22", | ||
"nodejs12.x": "arn:aws:lambda:us-west-2:464622532012:layer:Datadog-Node12-x:22", | ||
"python2.7": "arn:aws:lambda:us-west-2:464622532012:layer:Datadog-Python27:16", | ||
"python3.6": "arn:aws:lambda:us-west-2:464622532012:layer:Datadog-Python36:16", | ||
"python3.7": "arn:aws:lambda:us-west-2:464622532012:layer:Datadog-Python37:16", | ||
"python3.8": "arn:aws:lambda:us-west-2:464622532012:layer:Datadog-Python38:16" | ||
"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" | ||
}, | ||
"ap-east-1": { | ||
"nodejs10.x": "arn:aws:lambda:ap-east-1:464622532012:layer:Datadog-Node10-x:22", | ||
"nodejs12.x": "arn:aws:lambda:ap-east-1:464622532012:layer:Datadog-Node12-x:22", | ||
"python2.7": "arn:aws:lambda:ap-east-1:464622532012:layer:Datadog-Python27:16", | ||
"python3.6": "arn:aws:lambda:ap-east-1:464622532012:layer:Datadog-Python36:16", | ||
"python3.7": "arn:aws:lambda:ap-east-1:464622532012:layer:Datadog-Python37:16", | ||
"python3.8": "arn:aws:lambda:ap-east-1:464622532012:layer:Datadog-Python38:16" | ||
"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" | ||
}, | ||
"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:22", | ||
"nodejs12.x": "arn:aws:lambda:ap-south-1:464622532012:layer:Datadog-Node12-x:22", | ||
"python2.7": "arn:aws:lambda:ap-south-1:464622532012:layer:Datadog-Python27:16", | ||
"python3.6": "arn:aws:lambda:ap-south-1:464622532012:layer:Datadog-Python36:16", | ||
"python3.7": "arn:aws:lambda:ap-south-1:464622532012:layer:Datadog-Python37:16", | ||
"python3.8": "arn:aws:lambda:ap-south-1:464622532012:layer:Datadog-Python38:16" | ||
"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" | ||
}, | ||
"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:22", | ||
"nodejs12.x": "arn:aws:lambda:ap-northeast-2:464622532012:layer:Datadog-Node12-x:22", | ||
"python2.7": "arn:aws:lambda:ap-northeast-2:464622532012:layer:Datadog-Python27:16", | ||
"python3.6": "arn:aws:lambda:ap-northeast-2:464622532012:layer:Datadog-Python36:16", | ||
"python3.7": "arn:aws:lambda:ap-northeast-2:464622532012:layer:Datadog-Python37:16", | ||
"python3.8": "arn:aws:lambda:ap-northeast-2:464622532012:layer:Datadog-Python38:16" | ||
"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" | ||
}, | ||
"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:22", | ||
"nodejs12.x": "arn:aws:lambda:ap-southeast-1:464622532012:layer:Datadog-Node12-x:22", | ||
"python2.7": "arn:aws:lambda:ap-southeast-1:464622532012:layer:Datadog-Python27:16", | ||
"python3.6": "arn:aws:lambda:ap-southeast-1:464622532012:layer:Datadog-Python36:16", | ||
"python3.7": "arn:aws:lambda:ap-southeast-1:464622532012:layer:Datadog-Python37:16", | ||
"python3.8": "arn:aws:lambda:ap-southeast-1:464622532012:layer:Datadog-Python38:16" | ||
"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" | ||
}, | ||
"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:22", | ||
"nodejs12.x": "arn:aws:lambda:ap-southeast-2:464622532012:layer:Datadog-Node12-x:22", | ||
"python2.7": "arn:aws:lambda:ap-southeast-2:464622532012:layer:Datadog-Python27:16", | ||
"python3.6": "arn:aws:lambda:ap-southeast-2:464622532012:layer:Datadog-Python36:16", | ||
"python3.7": "arn:aws:lambda:ap-southeast-2:464622532012:layer:Datadog-Python37:16", | ||
"python3.8": "arn:aws:lambda:ap-southeast-2:464622532012:layer:Datadog-Python38:16" | ||
"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" | ||
}, | ||
"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:22", | ||
"nodejs12.x": "arn:aws:lambda:ap-northeast-1:464622532012:layer:Datadog-Node12-x:22", | ||
"python2.7": "arn:aws:lambda:ap-northeast-1:464622532012:layer:Datadog-Python27:16", | ||
"python3.6": "arn:aws:lambda:ap-northeast-1:464622532012:layer:Datadog-Python36:16", | ||
"python3.7": "arn:aws:lambda:ap-northeast-1:464622532012:layer:Datadog-Python37:16", | ||
"python3.8": "arn:aws:lambda:ap-northeast-1:464622532012:layer:Datadog-Python38:16" | ||
"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" | ||
}, | ||
"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:22", | ||
"nodejs12.x": "arn:aws:lambda:ca-central-1:464622532012:layer:Datadog-Node12-x:22", | ||
"python2.7": "arn:aws:lambda:ca-central-1:464622532012:layer:Datadog-Python27:16", | ||
"python3.6": "arn:aws:lambda:ca-central-1:464622532012:layer:Datadog-Python36:16", | ||
"python3.7": "arn:aws:lambda:ca-central-1:464622532012:layer:Datadog-Python37:16", | ||
"python3.8": "arn:aws:lambda:ca-central-1:464622532012:layer:Datadog-Python38:16" | ||
"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" | ||
}, | ||
"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:22", | ||
"nodejs12.x": "arn:aws:lambda:eu-north-1:464622532012:layer:Datadog-Node12-x:22", | ||
"python2.7": "arn:aws:lambda:eu-north-1:464622532012:layer:Datadog-Python27:16", | ||
"python3.6": "arn:aws:lambda:eu-north-1:464622532012:layer:Datadog-Python36:16", | ||
"python3.7": "arn:aws:lambda:eu-north-1:464622532012:layer:Datadog-Python37:16", | ||
"python3.8": "arn:aws:lambda:eu-north-1:464622532012:layer:Datadog-Python38:16" | ||
"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" | ||
}, | ||
"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:22", | ||
"nodejs12.x": "arn:aws:lambda:eu-central-1:464622532012:layer:Datadog-Node12-x:22", | ||
"python2.7": "arn:aws:lambda:eu-central-1:464622532012:layer:Datadog-Python27:16", | ||
"python3.6": "arn:aws:lambda:eu-central-1:464622532012:layer:Datadog-Python36:16", | ||
"python3.7": "arn:aws:lambda:eu-central-1:464622532012:layer:Datadog-Python37:16", | ||
"python3.8": "arn:aws:lambda:eu-central-1:464622532012:layer:Datadog-Python38:16" | ||
"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" | ||
}, | ||
"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:22", | ||
"nodejs12.x": "arn:aws:lambda:eu-west-1:464622532012:layer:Datadog-Node12-x:22", | ||
"python2.7": "arn:aws:lambda:eu-west-1:464622532012:layer:Datadog-Python27:16", | ||
"python3.6": "arn:aws:lambda:eu-west-1:464622532012:layer:Datadog-Python36:16", | ||
"python3.7": "arn:aws:lambda:eu-west-1:464622532012:layer:Datadog-Python37:16", | ||
"python3.8": "arn:aws:lambda:eu-west-1:464622532012:layer:Datadog-Python38:16" | ||
"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" | ||
}, | ||
"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:22", | ||
"nodejs12.x": "arn:aws:lambda:eu-west-2:464622532012:layer:Datadog-Node12-x:22", | ||
"python2.7": "arn:aws:lambda:eu-west-2:464622532012:layer:Datadog-Python27:16", | ||
"python3.6": "arn:aws:lambda:eu-west-2:464622532012:layer:Datadog-Python36:16", | ||
"python3.7": "arn:aws:lambda:eu-west-2:464622532012:layer:Datadog-Python37:16", | ||
"python3.8": "arn:aws:lambda:eu-west-2:464622532012:layer:Datadog-Python38:16" | ||
"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" | ||
}, | ||
"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:22", | ||
"nodejs12.x": "arn:aws:lambda:eu-west-3:464622532012:layer:Datadog-Node12-x:22", | ||
"python2.7": "arn:aws:lambda:eu-west-3:464622532012:layer:Datadog-Python27:16", | ||
"python3.6": "arn:aws:lambda:eu-west-3:464622532012:layer:Datadog-Python36:16", | ||
"python3.7": "arn:aws:lambda:eu-west-3:464622532012:layer:Datadog-Python37:16", | ||
"python3.8": "arn:aws:lambda:eu-west-3:464622532012:layer:Datadog-Python38:16" | ||
"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" | ||
}, | ||
"sa-east-1": { | ||
"nodejs8.10": "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Node8-10:18", | ||
"nodejs10.x": "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Node10-x:22", | ||
"nodejs12.x": "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Node12-x:22", | ||
"python2.7": "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Python27:16", | ||
"python3.6": "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Python36:16", | ||
"python3.7": "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Python37:16", | ||
"python3.8": "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Python38:16" | ||
"nodejs10.x": "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Node10-x:27", | ||
"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" | ||
} | ||
} | ||
} |
{ | ||
"name": "serverless-plugin-datadog", | ||
"version": "2.16.2", | ||
"version": "2.16.4", | ||
"description": "Serverless plugin to automatically instrument python and node functions with datadog tracing", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
{ | ||
"regions": { | ||
"us-gov-west-1": { | ||
"nodejs10.x": "arn:aws-us-gov:lambda:us-gov-west-1:002406178527:layer:Datadog-Node10-x:48", | ||
"nodejs12.x": "arn:aws-us-gov:lambda:us-gov-west-1:002406178527:layer:Datadog-Node12-x:48", | ||
"nodejs14.x": "arn:aws-us-gov:lambda:us-gov-west-1:002406178527:layer:Datadog-Node14-x:48", | ||
"nodejs10.x": "arn:aws-us-gov:lambda:us-gov-west-1:002406178527:layer:Datadog-Node10-x:49", | ||
"nodejs12.x": "arn:aws-us-gov:lambda:us-gov-west-1:002406178527:layer:Datadog-Node12-x:49", | ||
"nodejs14.x": "arn:aws-us-gov:lambda:us-gov-west-1:002406178527:layer:Datadog-Node14-x:49", | ||
"python2.7": "arn:aws-us-gov:lambda:us-gov-west-1:002406178527:layer:Datadog-Python27:28", | ||
@@ -13,5 +13,5 @@ "python3.6": "arn:aws-us-gov:lambda:us-gov-west-1:002406178527:layer:Datadog-Python36:28", | ||
"us-gov-east-1": { | ||
"nodejs10.x": "arn:aws-us-gov:lambda:us-gov-east-1:002406178527:layer:Datadog-Node10-x:48", | ||
"nodejs12.x": "arn:aws-us-gov:lambda:us-gov-east-1:002406178527:layer:Datadog-Node12-x:48", | ||
"nodejs14.x": "arn:aws-us-gov:lambda:us-gov-east-1:002406178527:layer:Datadog-Node14-x:48", | ||
"nodejs10.x": "arn:aws-us-gov:lambda:us-gov-east-1:002406178527:layer:Datadog-Node10-x:49", | ||
"nodejs12.x": "arn:aws-us-gov:lambda:us-gov-east-1:002406178527:layer:Datadog-Node12-x:49", | ||
"nodejs14.x": "arn:aws-us-gov:lambda:us-gov-east-1:002406178527:layer:Datadog-Node14-x:49", | ||
"python2.7": "arn:aws-us-gov:lambda:us-gov-east-1:002406178527:layer:Datadog-Python27:28", | ||
@@ -18,0 +18,0 @@ "python3.6": "arn:aws-us-gov:lambda:us-gov-east-1:002406178527:layer:Datadog-Python36:28", |
{ | ||
"regions": { | ||
"af-south-1": { | ||
"nodejs10.x": "arn:aws:lambda:af-south-1:464622532012:layer:Datadog-Node10-x:48", | ||
"nodejs12.x": "arn:aws:lambda:af-south-1:464622532012:layer:Datadog-Node12-x:48", | ||
"nodejs14.x": "arn:aws:lambda:af-south-1:464622532012:layer:Datadog-Node14-x:48", | ||
"nodejs10.x": "arn:aws:lambda:af-south-1:464622532012:layer:Datadog-Node10-x:49", | ||
"nodejs12.x": "arn:aws:lambda:af-south-1:464622532012:layer:Datadog-Node12-x:49", | ||
"nodejs14.x": "arn:aws:lambda:af-south-1:464622532012:layer:Datadog-Node14-x:49", | ||
"python2.7": "arn:aws:lambda:af-south-1:464622532012:layer:Datadog-Python27:28", | ||
@@ -14,5 +14,5 @@ "python3.6": "arn:aws:lambda:af-south-1:464622532012:layer:Datadog-Python36:28", | ||
"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:48", | ||
"nodejs12.x": "arn:aws:lambda:eu-north-1:464622532012:layer:Datadog-Node12-x:48", | ||
"nodejs14.x": "arn:aws:lambda:eu-north-1:464622532012:layer:Datadog-Node14-x:48", | ||
"nodejs10.x": "arn:aws:lambda:eu-north-1:464622532012:layer:Datadog-Node10-x:49", | ||
"nodejs12.x": "arn:aws:lambda:eu-north-1:464622532012:layer:Datadog-Node12-x:49", | ||
"nodejs14.x": "arn:aws:lambda:eu-north-1:464622532012:layer:Datadog-Node14-x:49", | ||
"python2.7": "arn:aws:lambda:eu-north-1:464622532012:layer:Datadog-Python27:28", | ||
@@ -25,5 +25,5 @@ "python3.6": "arn:aws:lambda:eu-north-1:464622532012:layer:Datadog-Python36:28", | ||
"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:48", | ||
"nodejs12.x": "arn:aws:lambda:ap-south-1:464622532012:layer:Datadog-Node12-x:48", | ||
"nodejs14.x": "arn:aws:lambda:ap-south-1:464622532012:layer:Datadog-Node14-x:48", | ||
"nodejs10.x": "arn:aws:lambda:ap-south-1:464622532012:layer:Datadog-Node10-x:49", | ||
"nodejs12.x": "arn:aws:lambda:ap-south-1:464622532012:layer:Datadog-Node12-x:49", | ||
"nodejs14.x": "arn:aws:lambda:ap-south-1:464622532012:layer:Datadog-Node14-x:49", | ||
"python2.7": "arn:aws:lambda:ap-south-1:464622532012:layer:Datadog-Python27:28", | ||
@@ -36,5 +36,5 @@ "python3.6": "arn:aws:lambda:ap-south-1:464622532012:layer:Datadog-Python36:28", | ||
"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:48", | ||
"nodejs12.x": "arn:aws:lambda:eu-west-3:464622532012:layer:Datadog-Node12-x:48", | ||
"nodejs14.x": "arn:aws:lambda:eu-west-3:464622532012:layer:Datadog-Node14-x:48", | ||
"nodejs10.x": "arn:aws:lambda:eu-west-3:464622532012:layer:Datadog-Node10-x:49", | ||
"nodejs12.x": "arn:aws:lambda:eu-west-3:464622532012:layer:Datadog-Node12-x:49", | ||
"nodejs14.x": "arn:aws:lambda:eu-west-3:464622532012:layer:Datadog-Node14-x:49", | ||
"python2.7": "arn:aws:lambda:eu-west-3:464622532012:layer:Datadog-Python27:28", | ||
@@ -47,5 +47,5 @@ "python3.6": "arn:aws:lambda:eu-west-3:464622532012:layer:Datadog-Python36:28", | ||
"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:48", | ||
"nodejs12.x": "arn:aws:lambda:eu-west-2:464622532012:layer:Datadog-Node12-x:48", | ||
"nodejs14.x": "arn:aws:lambda:eu-west-2:464622532012:layer:Datadog-Node14-x:48", | ||
"nodejs10.x": "arn:aws:lambda:eu-west-2:464622532012:layer:Datadog-Node10-x:49", | ||
"nodejs12.x": "arn:aws:lambda:eu-west-2:464622532012:layer:Datadog-Node12-x:49", | ||
"nodejs14.x": "arn:aws:lambda:eu-west-2:464622532012:layer:Datadog-Node14-x:49", | ||
"python2.7": "arn:aws:lambda:eu-west-2:464622532012:layer:Datadog-Python27:28", | ||
@@ -57,5 +57,5 @@ "python3.6": "arn:aws:lambda:eu-west-2:464622532012:layer:Datadog-Python36:28", | ||
"eu-south-1": { | ||
"nodejs10.x": "arn:aws:lambda:eu-south-1:464622532012:layer:Datadog-Node10-x:48", | ||
"nodejs12.x": "arn:aws:lambda:eu-south-1:464622532012:layer:Datadog-Node12-x:48", | ||
"nodejs14.x": "arn:aws:lambda:eu-south-1:464622532012:layer:Datadog-Node14-x:48", | ||
"nodejs10.x": "arn:aws:lambda:eu-south-1:464622532012:layer:Datadog-Node10-x:49", | ||
"nodejs12.x": "arn:aws:lambda:eu-south-1:464622532012:layer:Datadog-Node12-x:49", | ||
"nodejs14.x": "arn:aws:lambda:eu-south-1:464622532012:layer:Datadog-Node14-x:49", | ||
"python2.7": "arn:aws:lambda:eu-south-1:464622532012:layer:Datadog-Python27:28", | ||
@@ -68,5 +68,5 @@ "python3.6": "arn:aws:lambda:eu-south-1:464622532012:layer:Datadog-Python36:28", | ||
"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:48", | ||
"nodejs12.x": "arn:aws:lambda:eu-west-1:464622532012:layer:Datadog-Node12-x:48", | ||
"nodejs14.x": "arn:aws:lambda:eu-west-1:464622532012:layer:Datadog-Node14-x:48", | ||
"nodejs10.x": "arn:aws:lambda:eu-west-1:464622532012:layer:Datadog-Node10-x:49", | ||
"nodejs12.x": "arn:aws:lambda:eu-west-1:464622532012:layer:Datadog-Node12-x:49", | ||
"nodejs14.x": "arn:aws:lambda:eu-west-1:464622532012:layer:Datadog-Node14-x:49", | ||
"python2.7": "arn:aws:lambda:eu-west-1:464622532012:layer:Datadog-Python27:28", | ||
@@ -79,5 +79,5 @@ "python3.6": "arn:aws:lambda:eu-west-1:464622532012:layer:Datadog-Python36:28", | ||
"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:48", | ||
"nodejs12.x": "arn:aws:lambda:ap-northeast-2:464622532012:layer:Datadog-Node12-x:48", | ||
"nodejs14.x": "arn:aws:lambda:ap-northeast-2:464622532012:layer:Datadog-Node14-x:48", | ||
"nodejs10.x": "arn:aws:lambda:ap-northeast-2:464622532012:layer:Datadog-Node10-x:49", | ||
"nodejs12.x": "arn:aws:lambda:ap-northeast-2:464622532012:layer:Datadog-Node12-x:49", | ||
"nodejs14.x": "arn:aws:lambda:ap-northeast-2:464622532012:layer:Datadog-Node14-x:49", | ||
"python2.7": "arn:aws:lambda:ap-northeast-2:464622532012:layer:Datadog-Python27:28", | ||
@@ -89,5 +89,5 @@ "python3.6": "arn:aws:lambda:ap-northeast-2:464622532012:layer:Datadog-Python36:28", | ||
"me-south-1": { | ||
"nodejs10.x": "arn:aws:lambda:me-south-1:464622532012:layer:Datadog-Node10-x:48", | ||
"nodejs12.x": "arn:aws:lambda:me-south-1:464622532012:layer:Datadog-Node12-x:48", | ||
"nodejs14.x": "arn:aws:lambda:me-south-1:464622532012:layer:Datadog-Node14-x:48", | ||
"nodejs10.x": "arn:aws:lambda:me-south-1:464622532012:layer:Datadog-Node10-x:49", | ||
"nodejs12.x": "arn:aws:lambda:me-south-1:464622532012:layer:Datadog-Node12-x:49", | ||
"nodejs14.x": "arn:aws:lambda:me-south-1:464622532012:layer:Datadog-Node14-x:49", | ||
"python2.7": "arn:aws:lambda:me-south-1:464622532012:layer:Datadog-Python27:28", | ||
@@ -100,5 +100,5 @@ "python3.6": "arn:aws:lambda:me-south-1:464622532012:layer:Datadog-Python36:28", | ||
"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:48", | ||
"nodejs12.x": "arn:aws:lambda:ap-northeast-1:464622532012:layer:Datadog-Node12-x:48", | ||
"nodejs14.x": "arn:aws:lambda:ap-northeast-1:464622532012:layer:Datadog-Node14-x:48", | ||
"nodejs10.x": "arn:aws:lambda:ap-northeast-1:464622532012:layer:Datadog-Node10-x:49", | ||
"nodejs12.x": "arn:aws:lambda:ap-northeast-1:464622532012:layer:Datadog-Node12-x:49", | ||
"nodejs14.x": "arn:aws:lambda:ap-northeast-1:464622532012:layer:Datadog-Node14-x:49", | ||
"python2.7": "arn:aws:lambda:ap-northeast-1:464622532012:layer:Datadog-Python27:28", | ||
@@ -111,5 +111,5 @@ "python3.6": "arn:aws:lambda:ap-northeast-1:464622532012:layer:Datadog-Python36:28", | ||
"nodejs8.10": "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Node8-10:18", | ||
"nodejs10.x": "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Node10-x:48", | ||
"nodejs12.x": "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Node12-x:48", | ||
"nodejs14.x": "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Node14-x:48", | ||
"nodejs10.x": "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Node10-x:49", | ||
"nodejs12.x": "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Node12-x:49", | ||
"nodejs14.x": "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Node14-x:49", | ||
"python2.7": "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Python27:28", | ||
@@ -122,5 +122,5 @@ "python3.6": "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Python36:28", | ||
"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:48", | ||
"nodejs12.x": "arn:aws:lambda:ca-central-1:464622532012:layer:Datadog-Node12-x:48", | ||
"nodejs14.x": "arn:aws:lambda:ca-central-1:464622532012:layer:Datadog-Node14-x:48", | ||
"nodejs10.x": "arn:aws:lambda:ca-central-1:464622532012:layer:Datadog-Node10-x:49", | ||
"nodejs12.x": "arn:aws:lambda:ca-central-1:464622532012:layer:Datadog-Node12-x:49", | ||
"nodejs14.x": "arn:aws:lambda:ca-central-1:464622532012:layer:Datadog-Node14-x:49", | ||
"python2.7": "arn:aws:lambda:ca-central-1:464622532012:layer:Datadog-Python27:28", | ||
@@ -132,5 +132,5 @@ "python3.6": "arn:aws:lambda:ca-central-1:464622532012:layer:Datadog-Python36:28", | ||
"ap-east-1": { | ||
"nodejs10.x": "arn:aws:lambda:ap-east-1:464622532012:layer:Datadog-Node10-x:48", | ||
"nodejs12.x": "arn:aws:lambda:ap-east-1:464622532012:layer:Datadog-Node12-x:48", | ||
"nodejs14.x": "arn:aws:lambda:ap-east-1:464622532012:layer:Datadog-Node14-x:48", | ||
"nodejs10.x": "arn:aws:lambda:ap-east-1:464622532012:layer:Datadog-Node10-x:49", | ||
"nodejs12.x": "arn:aws:lambda:ap-east-1:464622532012:layer:Datadog-Node12-x:49", | ||
"nodejs14.x": "arn:aws:lambda:ap-east-1:464622532012:layer:Datadog-Node14-x:49", | ||
"python2.7": "arn:aws:lambda:ap-east-1:464622532012:layer:Datadog-Python27:28", | ||
@@ -143,5 +143,5 @@ "python3.6": "arn:aws:lambda:ap-east-1:464622532012:layer:Datadog-Python36:28", | ||
"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:48", | ||
"nodejs12.x": "arn:aws:lambda:ap-southeast-1:464622532012:layer:Datadog-Node12-x:48", | ||
"nodejs14.x": "arn:aws:lambda:ap-southeast-1:464622532012:layer:Datadog-Node14-x:48", | ||
"nodejs10.x": "arn:aws:lambda:ap-southeast-1:464622532012:layer:Datadog-Node10-x:49", | ||
"nodejs12.x": "arn:aws:lambda:ap-southeast-1:464622532012:layer:Datadog-Node12-x:49", | ||
"nodejs14.x": "arn:aws:lambda:ap-southeast-1:464622532012:layer:Datadog-Node14-x:49", | ||
"python2.7": "arn:aws:lambda:ap-southeast-1:464622532012:layer:Datadog-Python27:28", | ||
@@ -154,5 +154,5 @@ "python3.6": "arn:aws:lambda:ap-southeast-1:464622532012:layer:Datadog-Python36:28", | ||
"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:48", | ||
"nodejs12.x": "arn:aws:lambda:ap-southeast-2:464622532012:layer:Datadog-Node12-x:48", | ||
"nodejs14.x": "arn:aws:lambda:ap-southeast-2:464622532012:layer:Datadog-Node14-x:48", | ||
"nodejs10.x": "arn:aws:lambda:ap-southeast-2:464622532012:layer:Datadog-Node10-x:49", | ||
"nodejs12.x": "arn:aws:lambda:ap-southeast-2:464622532012:layer:Datadog-Node12-x:49", | ||
"nodejs14.x": "arn:aws:lambda:ap-southeast-2:464622532012:layer:Datadog-Node14-x:49", | ||
"python2.7": "arn:aws:lambda:ap-southeast-2:464622532012:layer:Datadog-Python27:28", | ||
@@ -165,5 +165,5 @@ "python3.6": "arn:aws:lambda:ap-southeast-2:464622532012:layer:Datadog-Python36:28", | ||
"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:48", | ||
"nodejs12.x": "arn:aws:lambda:eu-central-1:464622532012:layer:Datadog-Node12-x:48", | ||
"nodejs14.x": "arn:aws:lambda:eu-central-1:464622532012:layer:Datadog-Node14-x:48", | ||
"nodejs10.x": "arn:aws:lambda:eu-central-1:464622532012:layer:Datadog-Node10-x:49", | ||
"nodejs12.x": "arn:aws:lambda:eu-central-1:464622532012:layer:Datadog-Node12-x:49", | ||
"nodejs14.x": "arn:aws:lambda:eu-central-1:464622532012:layer:Datadog-Node14-x:49", | ||
"python2.7": "arn:aws:lambda:eu-central-1:464622532012:layer:Datadog-Python27:28", | ||
@@ -176,5 +176,5 @@ "python3.6": "arn:aws:lambda:eu-central-1:464622532012:layer:Datadog-Python36:28", | ||
"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:48", | ||
"nodejs12.x": "arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Node12-x:48", | ||
"nodejs14.x": "arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Node14-x:48", | ||
"nodejs10.x": "arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Node10-x:49", | ||
"nodejs12.x": "arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Node12-x:49", | ||
"nodejs14.x": "arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Node14-x:49", | ||
"python2.7": "arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Python27:28", | ||
@@ -187,5 +187,5 @@ "python3.6": "arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Python36:28", | ||
"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:48", | ||
"nodejs12.x": "arn:aws:lambda:us-east-2:464622532012:layer:Datadog-Node12-x:48", | ||
"nodejs14.x": "arn:aws:lambda:us-east-2:464622532012:layer:Datadog-Node14-x:48", | ||
"nodejs10.x": "arn:aws:lambda:us-east-2:464622532012:layer:Datadog-Node10-x:49", | ||
"nodejs12.x": "arn:aws:lambda:us-east-2:464622532012:layer:Datadog-Node12-x:49", | ||
"nodejs14.x": "arn:aws:lambda:us-east-2:464622532012:layer:Datadog-Node14-x:49", | ||
"python2.7": "arn:aws:lambda:us-east-2:464622532012:layer:Datadog-Python27:28", | ||
@@ -198,5 +198,5 @@ "python3.6": "arn:aws:lambda:us-east-2:464622532012:layer:Datadog-Python36:28", | ||
"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:48", | ||
"nodejs12.x": "arn:aws:lambda:us-west-1:464622532012:layer:Datadog-Node12-x:48", | ||
"nodejs14.x": "arn:aws:lambda:us-west-1:464622532012:layer:Datadog-Node14-x:48", | ||
"nodejs10.x": "arn:aws:lambda:us-west-1:464622532012:layer:Datadog-Node10-x:49", | ||
"nodejs12.x": "arn:aws:lambda:us-west-1:464622532012:layer:Datadog-Node12-x:49", | ||
"nodejs14.x": "arn:aws:lambda:us-west-1:464622532012:layer:Datadog-Node14-x:49", | ||
"python2.7": "arn:aws:lambda:us-west-1:464622532012:layer:Datadog-Python27:28", | ||
@@ -209,5 +209,5 @@ "python3.6": "arn:aws:lambda:us-west-1:464622532012:layer:Datadog-Python36:28", | ||
"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:48", | ||
"nodejs12.x": "arn:aws:lambda:us-west-2:464622532012:layer:Datadog-Node12-x:48", | ||
"nodejs14.x": "arn:aws:lambda:us-west-2:464622532012:layer:Datadog-Node14-x:48", | ||
"nodejs10.x": "arn:aws:lambda:us-west-2:464622532012:layer:Datadog-Node10-x:49", | ||
"nodejs12.x": "arn:aws:lambda:us-west-2:464622532012:layer:Datadog-Node12-x:49", | ||
"nodejs14.x": "arn:aws:lambda:us-west-2:464622532012:layer:Datadog-Node14-x:49", | ||
"python2.7": "arn:aws:lambda:us-west-2:464622532012:layer:Datadog-Python27:28", | ||
@@ -214,0 +214,0 @@ "python3.6": "arn:aws:lambda:us-west-2:464622532012:layer:Datadog-Python36:28", |
@@ -1,3 +0,2 @@ | ||
import { TracingMode } from "./common"; | ||
export declare function es6Template(filePath: string, methods: string[], mode: TracingMode): string; | ||
export declare function es6Template(filePath: string, methods: string[]): string; | ||
//# sourceMappingURL=node-es6-template.d.ts.map |
@@ -10,29 +10,14 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const common_1 = require("./common"); | ||
function es6Template(filePath, methods, mode) { | ||
const methodsString = methodsTemplate(methods, mode); | ||
const tracerString = tracerTemplate(mode); | ||
return `/* eslint-disable */ | ||
${tracerString} | ||
const { datadog } = require("datadog-lambda-js"); | ||
import * as original from "../${filePath}"; | ||
${methodsString}`; | ||
function es6Template(filePath, methods) { | ||
const methodsString = methodsTemplate(methods); | ||
return (`/* eslint-disable */ | ||
const { datadog } = require("datadog-lambda-js"); | ||
import * as original from "../${filePath}";` + methodsString); | ||
} | ||
exports.es6Template = es6Template; | ||
function tracerTemplate(mode) { | ||
switch (mode) { | ||
case common_1.TracingMode.DD_TRACE: | ||
case common_1.TracingMode.HYBRID: | ||
return 'require("dd-trace").init();'; | ||
case common_1.TracingMode.XRAY: | ||
case common_1.TracingMode.NONE: | ||
return ""; | ||
} | ||
} | ||
function methodsTemplate(methods, tracingMode) { | ||
const optionsStr = common_1.optionsTemplate(tracingMode); | ||
function methodsTemplate(methods) { | ||
let data = ""; | ||
for (const method of methods) { | ||
data += "\n"; | ||
data += `export const ${method} = datadog(original.${method},${optionsStr});`; | ||
data += ` export const ${method} = datadog(original.${method});`; | ||
} | ||
@@ -39,0 +24,0 @@ return data; |
@@ -1,3 +0,2 @@ | ||
import { TracingMode } from "./common"; | ||
export declare function nodeTemplate(filePath: string, methods: string[], mode: TracingMode): string; | ||
export declare function nodeTemplate(filePath: string, methods: string[]): string; | ||
//# sourceMappingURL=node-js-template.d.ts.map |
@@ -10,28 +10,13 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const common_1 = require("./common"); | ||
function nodeTemplate(filePath, methods, mode) { | ||
const methodsString = methodsTemplate(methods, mode); | ||
const tracerString = tracerTemplate(mode); | ||
return `const { datadog } = require("datadog-lambda-js"); | ||
${tracerString} | ||
const original = require("../${filePath}"); | ||
${methodsString}`; | ||
function nodeTemplate(filePath, methods) { | ||
const methodsString = methodsTemplate(methods); | ||
return (`const { datadog } = require("datadog-lambda-js"); | ||
const original = require("../${filePath}");` + methodsString); | ||
} | ||
exports.nodeTemplate = nodeTemplate; | ||
function tracerTemplate(mode) { | ||
switch (mode) { | ||
case common_1.TracingMode.DD_TRACE: | ||
case common_1.TracingMode.HYBRID: | ||
return 'require("dd-trace").init();'; | ||
case common_1.TracingMode.XRAY: | ||
case common_1.TracingMode.NONE: | ||
return ""; | ||
} | ||
} | ||
function methodsTemplate(methods, tracingMode) { | ||
const optionsStr = common_1.optionsTemplate(tracingMode); | ||
function methodsTemplate(methods) { | ||
let data = ""; | ||
for (const method of methods) { | ||
data += "\n"; | ||
data += `module.exports.${method} = datadog(original.${method}, ${optionsStr});`; | ||
data += `module.exports.${method} = datadog(original.${method});`; | ||
} | ||
@@ -38,0 +23,0 @@ return data; |
@@ -1,3 +0,2 @@ | ||
import { TracingMode } from "./common"; | ||
export declare function typescriptTemplate(filePath: string, methods: string[], mode: TracingMode): string; | ||
export declare function typescriptTemplate(filePath: string, methods: string[]): string; | ||
//# sourceMappingURL=node-ts-template.d.ts.map |
@@ -10,30 +10,15 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const common_1 = require("./common"); | ||
function typescriptTemplate(filePath, methods, mode) { | ||
const methodsString = methodsTemplate(methods, mode); | ||
const tracerString = tracerTemplate(mode); | ||
return `/* tslint:disable */ | ||
function typescriptTemplate(filePath, methods) { | ||
const methodsString = methodsTemplate(methods); | ||
return (`/* tslint:disable */ | ||
/* eslint-disable */ | ||
${tracerString} | ||
const { datadog } = require("datadog-lambda-js") as any; | ||
import * as original from "../${filePath}"; | ||
${methodsString}`; | ||
import * as original from "../${filePath}";` + methodsString); | ||
} | ||
exports.typescriptTemplate = typescriptTemplate; | ||
function tracerTemplate(mode) { | ||
switch (mode) { | ||
case common_1.TracingMode.DD_TRACE: | ||
case common_1.TracingMode.HYBRID: | ||
return 'const tracer = require("dd-trace") as any;\ntracer.init();'; | ||
case common_1.TracingMode.XRAY: | ||
case common_1.TracingMode.NONE: | ||
return ""; | ||
} | ||
} | ||
function methodsTemplate(methods, tracingMode) { | ||
const optionsStr = common_1.optionsTemplate(tracingMode); | ||
function methodsTemplate(methods) { | ||
let data = ""; | ||
for (const method of methods) { | ||
data += "\n"; | ||
data += `export const ${method} = datadog(original.${method},${optionsStr});`; | ||
data += `export const ${method} = datadog(original.${method});`; | ||
} | ||
@@ -40,0 +25,0 @@ return data; |
import Service from "serverless/classes/Service"; | ||
import { TracingMode } from "./templates/common"; | ||
export declare enum TracingMode { | ||
XRAY = 0, | ||
DD_TRACE = 1, | ||
HYBRID = 2, | ||
NONE = 3 | ||
} | ||
export declare function enableTracing(service: Service, tracingMode: TracingMode): void; | ||
//# sourceMappingURL=tracing.d.ts.map |
@@ -10,9 +10,15 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const common_1 = require("./templates/common"); | ||
const ddTraceEnabledEnvVar = "DD_TRACE_ENABLED"; | ||
const ddMergeXrayTracesEnvVar = "DD_MERGE_XRAY_TRACES"; | ||
var TracingMode; | ||
(function (TracingMode) { | ||
TracingMode[TracingMode["XRAY"] = 0] = "XRAY"; | ||
TracingMode[TracingMode["DD_TRACE"] = 1] = "DD_TRACE"; | ||
TracingMode[TracingMode["HYBRID"] = 2] = "HYBRID"; | ||
TracingMode[TracingMode["NONE"] = 3] = "NONE"; | ||
})(TracingMode = exports.TracingMode || (exports.TracingMode = {})); | ||
function enableTracing(service, tracingMode) { | ||
var _a; | ||
const provider = service.provider; | ||
if (tracingMode === common_1.TracingMode.XRAY || tracingMode === common_1.TracingMode.HYBRID) { | ||
if (tracingMode === TracingMode.XRAY || tracingMode === TracingMode.HYBRID) { | ||
provider.tracing = { | ||
@@ -23,6 +29,6 @@ apiGateway: true, | ||
} | ||
if (tracingMode === common_1.TracingMode.HYBRID || tracingMode === common_1.TracingMode.DD_TRACE) { | ||
if (tracingMode === TracingMode.HYBRID || tracingMode === TracingMode.DD_TRACE) { | ||
const environment = (_a = provider.environment) !== null && _a !== void 0 ? _a : {}; | ||
environment[ddTraceEnabledEnvVar] = true; | ||
environment[ddMergeXrayTracesEnvVar] = tracingMode === common_1.TracingMode.HYBRID; | ||
environment[ddMergeXrayTracesEnvVar] = tracingMode === TracingMode.HYBRID; | ||
provider.environment = environment; | ||
@@ -29,0 +35,0 @@ } |
@@ -1,19 +0,11 @@ | ||
import Service from "serverless/classes/Service"; | ||
import { FunctionInfo, RuntimeType } from "./layer"; | ||
import { TracingMode } from "./templates/common"; | ||
export declare const datadogDirectory = "datadog_handlers"; | ||
export interface FunctionGroup { | ||
funcs: { | ||
info: FunctionInfo; | ||
method: string; | ||
}[]; | ||
filename: string; | ||
runtime: RuntimeType; | ||
} | ||
export declare function writeHandlers(service: Service, funcs: FunctionInfo[], tracingMode: TracingMode): Promise<void>; | ||
export declare function cleanupHandlers(): Promise<void>; | ||
export declare function getWrapperText(type: RuntimeType, filename: string, methods: string[], tracingMode: TracingMode): string | undefined; | ||
export declare function getFunctionGroups(functionInfos: FunctionInfo[]): FunctionGroup[]; | ||
export declare function writeWrapperFunction(group: FunctionGroup, wrapperText: string): Promise<string>; | ||
export declare function addToExclusionList(service: any, files: string[]): Promise<void>; | ||
import { FunctionInfo } from "./layer"; | ||
export declare const datadogHandlerEnvVar = "DD_LAMBDA_HANDLER"; | ||
export declare const pythonHandler = "datadog_lambda.handler.handler"; | ||
export declare const jsHandlerWithLayers = "/opt/nodejs/node_modules/datadog-lambda-js/handler.handler"; | ||
export declare const jsHandler = "node_modules/datadog-lambda-js/dist/handler.handler"; | ||
/** | ||
* For each lambda function, redirects handler to the Datadog handler for the given runtime, | ||
* and sets Datadog environment variable `DD_LAMBDA_HANDLER` to the original handler. | ||
*/ | ||
export declare function redirectHandlers(funcs: FunctionInfo[], addLayers: boolean): void; | ||
//# sourceMappingURL=wrapper.d.ts.map |
@@ -9,140 +9,50 @@ "use strict"; | ||
*/ | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const fs_1 = __importDefault(require("fs")); | ||
const path_1 = __importDefault(require("path")); | ||
const util_1 = __importDefault(require("util")); | ||
const layer_1 = require("./layer"); | ||
const node_es6_template_1 = require("./templates/node-es6-template"); | ||
const node_js_template_1 = require("./templates/node-js-template"); | ||
const node_ts_template_1 = require("./templates/node-ts-template"); | ||
const python_template_1 = require("./templates/python-template"); | ||
const util_2 = require("./util"); | ||
exports.datadogDirectory = "datadog_handlers"; | ||
function writeHandlers(service, funcs, tracingMode) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
yield cleanupHandlers(); | ||
yield util_1.default.promisify(fs_1.default.mkdir)(exports.datadogDirectory); | ||
const groups = getFunctionGroups(funcs); | ||
const promises = groups.map((funcGroup) => __awaiter(this, void 0, void 0, function* () { | ||
const methods = getMethods(funcGroup); | ||
const result = getWrapperText(funcGroup.runtime, funcGroup.filename, methods, tracingMode); | ||
if (result === undefined) { | ||
return; | ||
} | ||
const text = result; | ||
const filename = yield writeWrapperFunction(funcGroup, text); | ||
const baseMethodName = path_1.default.posix.join(exports.datadogDirectory, funcGroup.funcs[0].info.name); | ||
for (const func of funcGroup.funcs) { | ||
func.info.handler.handler = `${baseMethodName}.${func.method}`; | ||
if (func.info.handler.package === undefined) { | ||
func.info.handler.package = { | ||
exclude: [], | ||
include: [], | ||
}; | ||
} | ||
if (func.info.handler.package.include === undefined) { | ||
func.info.handler.package.include = []; | ||
} | ||
func.info.handler.package.include.push(filename); | ||
} | ||
return `${filename}`; | ||
})); | ||
const files = [...(yield Promise.all(promises))]; | ||
const allFiles = files.filter((file) => file !== undefined); | ||
allFiles.push(path_1.default.join(exports.datadogDirectory, "**")); | ||
addToExclusionList(service, allFiles); | ||
}); | ||
} | ||
exports.writeHandlers = writeHandlers; | ||
function cleanupHandlers() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
yield util_2.removeDirectory(exports.datadogDirectory); | ||
}); | ||
} | ||
exports.cleanupHandlers = cleanupHandlers; | ||
function getWrapperText(type, filename, methods, tracingMode) { | ||
switch (type) { | ||
case layer_1.RuntimeType.NODE: | ||
return node_js_template_1.nodeTemplate(filename, methods, tracingMode); | ||
case layer_1.RuntimeType.NODE_ES6: | ||
return node_es6_template_1.es6Template(filename, methods, tracingMode); | ||
case layer_1.RuntimeType.NODE_TS: | ||
return node_ts_template_1.typescriptTemplate(filename, methods, tracingMode); | ||
case layer_1.RuntimeType.PYTHON: | ||
return python_template_1.pythonTemplate(filename, methods); | ||
} | ||
} | ||
exports.getWrapperText = getWrapperText; | ||
function getFunctionGroups(functionInfos) { | ||
var _a; | ||
const lookup = {}; | ||
for (const func of functionInfos) { | ||
const handlerPath = util_2.getHandlerPath(func); | ||
if (handlerPath === undefined) { | ||
continue; | ||
exports.datadogHandlerEnvVar = "DD_LAMBDA_HANDLER"; | ||
exports.pythonHandler = "datadog_lambda.handler.handler"; | ||
exports.jsHandlerWithLayers = "/opt/nodejs/node_modules/datadog-lambda-js/handler.handler"; | ||
exports.jsHandler = "node_modules/datadog-lambda-js/dist/handler.handler"; | ||
/** | ||
* For each lambda function, redirects handler to the Datadog handler for the given runtime, | ||
* and sets Datadog environment variable `DD_LAMBDA_HANDLER` to the original handler. | ||
*/ | ||
function redirectHandlers(funcs, addLayers) { | ||
funcs.forEach((func) => { | ||
setEnvDatadogHandler(func); | ||
const handler = getDDHandler(func.type, addLayers); | ||
if (handler === undefined) { | ||
return; | ||
} | ||
const key = `${handlerPath.filename}.${getHandlerExtension(func.type)}`; | ||
const group = (_a = lookup[key]) !== null && _a !== void 0 ? _a : { | ||
funcs: [], | ||
filename: handlerPath.filename, | ||
runtime: func.type, | ||
}; | ||
group.funcs.push({ info: func, method: handlerPath.method }); | ||
lookup[key] = group; | ||
} | ||
return [...Object.values(lookup)]; | ||
} | ||
exports.getFunctionGroups = getFunctionGroups; | ||
function writeWrapperFunction(group, wrapperText) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const extension = getHandlerExtension(group.runtime); | ||
const filename = `${group.funcs[0].info.name}.${extension}`; | ||
const pathname = path_1.default.join(exports.datadogDirectory, filename); | ||
yield util_1.default.promisify(fs_1.default.writeFile)(pathname, wrapperText); | ||
return pathname; | ||
}); | ||
} | ||
exports.writeWrapperFunction = writeWrapperFunction; | ||
function addToExclusionList(service, files) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (service.package === undefined) { | ||
service.package = {}; | ||
func.handler.handler = handler; | ||
if (func.handler.package === undefined) { | ||
func.handler.package = { | ||
exclude: [], | ||
include: [], | ||
}; | ||
} | ||
const pack = service.package; | ||
if (pack.include === undefined) { | ||
pack.include = []; | ||
if (func.handler.package.include === undefined) { | ||
func.handler.package.include = []; | ||
} | ||
pack.include.push(...files); | ||
}); | ||
} | ||
exports.addToExclusionList = addToExclusionList; | ||
function getMethods(funcGroup) { | ||
// Dedups methods shared between multiple function groups | ||
return [...new Set(funcGroup.funcs.map((func) => func.method)).values()].sort(); | ||
} | ||
function getHandlerExtension(type) { | ||
switch (type) { | ||
case layer_1.RuntimeType.NODE_ES6: | ||
exports.redirectHandlers = redirectHandlers; | ||
function getDDHandler(lambdaRuntime, addLayers) { | ||
if (lambdaRuntime === undefined) { | ||
return; | ||
} | ||
switch (lambdaRuntime) { | ||
case layer_1.RuntimeType.NODE: | ||
return "js"; | ||
case layer_1.RuntimeType.NODE_TS: | ||
return "ts"; | ||
return addLayers ? exports.jsHandlerWithLayers : exports.jsHandler; | ||
case layer_1.RuntimeType.PYTHON: | ||
return "py"; | ||
case layer_1.RuntimeType.UNSUPPORTED: | ||
return ""; | ||
return exports.pythonHandler; | ||
} | ||
} | ||
function setEnvDatadogHandler(func) { | ||
var _a; | ||
const originalHandler = func.handler.handler; | ||
const environment = (_a = func.handler.environment) !== null && _a !== void 0 ? _a : {}; | ||
environment[exports.datadogHandlerEnvVar] = originalHandler; | ||
func.handler.environment = environment; | ||
} | ||
//# sourceMappingURL=wrapper.js.map |
{ | ||
"name": "serverless-plugin-datadog", | ||
"version": "2.16.2", | ||
"version": "2.16.4", | ||
"description": "Serverless plugin to automatically instrument python and node functions with datadog tracing", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
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
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
323170
2
83
1898