serverless-plugin-datadog
Advanced tools
Comparing version 3.1.0 to 3.1.1
{ | ||
"name": "serverless-plugin-datadog", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"description": "Serverless plugin to automatically instrument python and node functions with datadog tracing", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
@@ -102,3 +102,3 @@ "use strict"; | ||
this.debugLogHandlers(handlers); | ||
(0, layer_1.applyLambdaLibraryLayers)(this.serverless.service.provider.region, handlers, allLayers); | ||
(0, layer_1.applyLambdaLibraryLayers)(this.serverless.service, handlers, allLayers); | ||
if ((0, env_1.hasWebpackPlugin)(this.serverless.service)) { | ||
@@ -114,3 +114,3 @@ (0, env_1.forceExcludeDepsFromWebpack)(this.serverless.service); | ||
this.debugLogHandlers(handlers); | ||
(0, layer_1.applyExtensionLayer)(this.serverless.service.provider.region, handlers, allLayers); | ||
(0, layer_1.applyExtensionLayer)(this.serverless.service, handlers, allLayers); | ||
} | ||
@@ -117,0 +117,0 @@ else { |
@@ -25,6 +25,6 @@ import { FunctionDefinition, FunctionDefinitionHandler } from "serverless"; | ||
export declare function findHandlers(service: Service, exclude: string[], defaultRuntime?: string): FunctionInfo[]; | ||
export declare function applyLambdaLibraryLayers(region: string, handlers: FunctionInfo[], layers: LayerJSON): void; | ||
export declare function applyExtensionLayer(region: string, handlers: FunctionInfo[], layers: LayerJSON): void; | ||
export declare function applyLambdaLibraryLayers(service: Service, handlers: FunctionInfo[], layers: LayerJSON): void; | ||
export declare function applyExtensionLayer(service: Service, handlers: FunctionInfo[], layers: LayerJSON): void; | ||
export declare function pushLayerARN(layerARNs: string[], currentLayers: string[]): string[]; | ||
export declare function isFunctionDefinitionHandler(funcDef: FunctionDefinition): funcDef is FunctionDefinitionHandler; | ||
//# sourceMappingURL=layer.d.ts.map |
@@ -37,3 +37,4 @@ "use strict"; | ||
exports.findHandlers = findHandlers; | ||
function applyLambdaLibraryLayers(region, handlers, layers) { | ||
function applyLambdaLibraryLayers(service, handlers, layers) { | ||
const { region } = service.provider; | ||
const regionRuntimes = layers.regions[region]; | ||
@@ -49,3 +50,3 @@ if (regionRuntimes === undefined) { | ||
const lambdaLayerARN = runtime !== undefined ? regionRuntimes[runtime] : undefined; | ||
let currentLayers = getLayers(handler); | ||
let currentLayers = getLayers(service, handler); | ||
if (lambdaLayerARN) { | ||
@@ -58,3 +59,4 @@ currentLayers = pushLayerARN([lambdaLayerARN], currentLayers); | ||
exports.applyLambdaLibraryLayers = applyLambdaLibraryLayers; | ||
function applyExtensionLayer(region, handlers, layers) { | ||
function applyExtensionLayer(service, handlers, layers) { | ||
const { region } = service.provider; | ||
const regionRuntimes = layers.regions[region]; | ||
@@ -70,3 +72,3 @@ if (regionRuntimes === undefined) { | ||
extensionLayerARN = regionRuntimes[extensionLayerKey]; | ||
let currentLayers = getLayers(handler); | ||
let currentLayers = getLayers(service, handler); | ||
if (extensionLayerARN) { | ||
@@ -92,8 +94,7 @@ currentLayers = pushLayerARN([extensionLayerARN], currentLayers); | ||
exports.isFunctionDefinitionHandler = isFunctionDefinitionHandler; | ||
function getLayers(handler) { | ||
const layersList = handler.handler.layers; | ||
if (layersList === undefined) { | ||
return []; | ||
} | ||
return layersList; | ||
function getLayers(service, handler) { | ||
const functionLayersList = handler.handler.layers || []; | ||
const serviceLayerList = service.provider.layers || []; | ||
const layerList = serviceLayerList === null || serviceLayerList === void 0 ? void 0 : serviceLayerList.concat(functionLayersList); | ||
return layerList; | ||
} | ||
@@ -100,0 +101,0 @@ function setLayers(handler, layers) { |
{ | ||
"name": "serverless-plugin-datadog", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"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
184683
1862