seek-datadog-custom-metrics
Advanced tools
Comparing version 4.2.0 to 4.2.1
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createLambdaExtensionClient = void 0; | ||
const datadog_lambda_js_1 = require("datadog-lambda-js"); | ||
/** | ||
* Vendored from `datadog-lambda-js`. | ||
*/ | ||
class DatadogLambdaJs { | ||
} | ||
/** | ||
* Replaces tag special characters with an underscore | ||
@@ -17,2 +21,5 @@ */ | ||
const createLambdaExtensionClient = (config) => { | ||
const { datadog, sendDistributionMetric } = | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
require('datadog-lambda-js'); | ||
const send = (metric) => { | ||
@@ -24,3 +31,3 @@ const { value } = metric; | ||
if (config.metrics) { | ||
(0, datadog_lambda_js_1.sendDistributionMetric)(name, value, ...tags); | ||
sendDistributionMetric(name, value, ...tags); | ||
} | ||
@@ -42,3 +49,3 @@ }; | ||
return { | ||
withLambdaExtension: (fn) => config.metrics ? (0, datadog_lambda_js_1.datadog)(fn) : fn, | ||
withLambdaExtension: (fn) => (config.metrics ? datadog(fn) : fn), | ||
metricsClient: { | ||
@@ -45,0 +52,0 @@ increment: sendCount, |
@@ -1,3 +0,7 @@ | ||
import { datadog, sendDistributionMetric } from 'datadog-lambda-js'; | ||
/** | ||
* Vendored from `datadog-lambda-js`. | ||
*/ | ||
class DatadogLambdaJs { | ||
} | ||
/** | ||
* Replaces tag special characters with an underscore | ||
@@ -14,2 +18,5 @@ */ | ||
export const createLambdaExtensionClient = (config) => { | ||
const { datadog, sendDistributionMetric } = | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
require('datadog-lambda-js'); | ||
const send = (metric) => { | ||
@@ -38,3 +45,3 @@ const { value } = metric; | ||
return { | ||
withLambdaExtension: (fn) => config.metrics ? datadog(fn) : fn, | ||
withLambdaExtension: (fn) => (config.metrics ? datadog(fn) : fn), | ||
metricsClient: { | ||
@@ -41,0 +48,0 @@ increment: sendCount, |
{ | ||
"name": "seek-datadog-custom-metrics", | ||
"version": "4.2.0", | ||
"version": "4.2.1", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "Helpers for sending Datadog custom metrics", |
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
56276
845