datadog-lambda-js
Advanced tools
Comparing version 7.102.0 to 7.103.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.STREAM_RESPONSE = exports.HANDLER_STREAMING = exports.datadogLambdaVersion = void 0; | ||
exports.datadogLambdaVersion = "7.102.0"; | ||
exports.datadogLambdaVersion = "7.103.0"; | ||
// Response streaming functions | ||
@@ -6,0 +6,0 @@ exports.HANDLER_STREAMING = Symbol.for("aws.lambda.runtime.handler.streaming"); |
@@ -27,2 +27,3 @@ import { Context, Handler } from "aws-lambda"; | ||
export declare const coldStartTraceSkipLibEnvVar = "DD_COLD_START_TRACE_SKIP_LIB"; | ||
export declare const localTestingEnvVar = "DD_LOCAL_TESTING"; | ||
interface GlobalConfig { | ||
@@ -29,0 +30,0 @@ /** |
@@ -75,3 +75,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getEnvValue = exports.getTraceHeaders = exports.sendDistributionMetric = exports.sendDistributionMetricWithDate = exports.extractArgs = exports.datadog = exports.defaultConfig = exports.coldStartTraceSkipLibEnvVar = exports.minColdStartTraceDurationEnvVar = exports.coldStartTracingEnvVar = exports.decodeAuthorizerContextEnvVar = exports.encodeAuthorizerContextEnvVar = exports.defaultSiteURL = exports.traceExtractorEnvVar = exports.mergeXrayTracesEnvVar = exports.lambdaTaskRootEnvVar = exports.datadogHandlerEnvVar = exports.enhancedMetricsEnvVar = exports.logInjectionEnvVar = exports.logForwardingEnvVar = exports.logLevelEnvVar = exports.siteURLEnvVar = exports.traceManagedServicesEnvVar = exports.captureLambdaPayloadMaxDepthEnvVar = exports.captureLambdaPayloadEnvVar = exports.apiKeyKMSEnvVar = exports.apiKeyEnvVar = void 0; | ||
exports.getEnvValue = exports.getTraceHeaders = exports.sendDistributionMetric = exports.sendDistributionMetricWithDate = exports.extractArgs = exports.datadog = exports.defaultConfig = exports.localTestingEnvVar = exports.coldStartTraceSkipLibEnvVar = exports.minColdStartTraceDurationEnvVar = exports.coldStartTracingEnvVar = exports.decodeAuthorizerContextEnvVar = exports.encodeAuthorizerContextEnvVar = exports.defaultSiteURL = exports.traceExtractorEnvVar = exports.mergeXrayTracesEnvVar = exports.lambdaTaskRootEnvVar = exports.datadogHandlerEnvVar = exports.enhancedMetricsEnvVar = exports.logInjectionEnvVar = exports.logForwardingEnvVar = exports.logLevelEnvVar = exports.siteURLEnvVar = exports.traceManagedServicesEnvVar = exports.captureLambdaPayloadMaxDepthEnvVar = exports.captureLambdaPayloadEnvVar = exports.apiKeyKMSEnvVar = exports.apiKeyEnvVar = void 0; | ||
var constants_1 = require("./constants"); | ||
@@ -103,2 +103,3 @@ var metrics_1 = require("./metrics"); | ||
exports.coldStartTraceSkipLibEnvVar = "DD_COLD_START_TRACE_SKIP_LIB"; | ||
exports.localTestingEnvVar = "DD_LOCAL_TESTING"; | ||
exports.defaultConfig = { | ||
@@ -123,2 +124,3 @@ apiKey: "", | ||
coldStartTraceSkipLib: "", | ||
localTesting: false, | ||
}; | ||
@@ -429,2 +431,9 @@ var currentMetricsListener; | ||
} | ||
if (userConfig === undefined || userConfig.localTesting === undefined) { | ||
var result = getEnvValue(exports.localTestingEnvVar, "false").toLowerCase(); | ||
// TODO deprecate 1 for truthy, this shouldn't have been allowed | ||
// but the extension allows it, so we must as well | ||
// @ts-ignore-next-line | ||
config.localTesting = result === "true" || result === "1"; | ||
} | ||
return config; | ||
@@ -431,0 +440,0 @@ } |
@@ -36,2 +36,8 @@ import { KMSService } from "./kms-service"; | ||
enhancedMetrics: boolean; | ||
/** | ||
* Whether to call the extension's Flush endpoint in a local test | ||
* Only needed locally, as the extension knows about the end of the invocation | ||
* from the runtime | ||
*/ | ||
localTesting: boolean; | ||
} | ||
@@ -38,0 +44,0 @@ export declare class MetricsListener { |
@@ -165,4 +165,4 @@ "use strict"; | ||
_a.trys.push([8, 11, , 12]); | ||
if (!this.isAgentRunning) return [3 /*break*/, 10]; | ||
(0, utils_1.logDebug)("Flushing Extension"); | ||
if (!(this.isAgentRunning && this.config.localTesting)) return [3 /*break*/, 10]; | ||
(0, utils_1.logDebug)("Flushing Extension for local test"); | ||
return [4 /*yield*/, (0, extension_1.flushExtension)()]; | ||
@@ -169,0 +169,0 @@ case 9: |
{ | ||
"name": "datadog-lambda-js", | ||
"version": "7.102.0", | ||
"version": "7.103.0", | ||
"description": "Lambda client library that supports hybrid tracing in node js", | ||
@@ -5,0 +5,0 @@ "main": "dist/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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
500480
6838