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

seek-datadog-custom-metrics

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

seek-datadog-custom-metrics - npm Package Compare versions

Comparing version 4.4.0 to 4.5.0

6

lib-commonjs/createTimedSpan.js

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

*/
const createTimedSpan = (metricsClient) => async (name, block, afterCompletion) => {
const createTimedSpan = (metricsClient) => async (name, block, afterCompletion, tags) => {
const startTime = process.hrtime.bigint();

@@ -22,4 +22,4 @@ const handleCompletion = (success) => {

const durationMilliseconds = Number(durationNanos) / 1e6;
metricsClient.timing(`${name}.latency`, durationMilliseconds);
metricsClient.increment(`${name}.count`, [successTag]);
metricsClient.timing(`${name}.latency`, durationMilliseconds, tags);
metricsClient.increment(`${name}.count`, [successTag, ...(tags !== null && tags !== void 0 ? tags : [])]);
afterCompletion === null || afterCompletion === void 0 ? void 0 : afterCompletion(durationMilliseconds, success);

@@ -26,0 +26,0 @@ };

@@ -12,3 +12,3 @@ /**

*/
export const createTimedSpan = (metricsClient) => async (name, block, afterCompletion) => {
export const createTimedSpan = (metricsClient) => async (name, block, afterCompletion, tags) => {
const startTime = process.hrtime.bigint();

@@ -19,4 +19,4 @@ const handleCompletion = (success) => {

const durationMilliseconds = Number(durationNanos) / 1e6;
metricsClient.timing(`${name}.latency`, durationMilliseconds);
metricsClient.increment(`${name}.count`, [successTag]);
metricsClient.timing(`${name}.latency`, durationMilliseconds, tags);
metricsClient.increment(`${name}.count`, [successTag, ...(tags !== null && tags !== void 0 ? tags : [])]);
afterCompletion === null || afterCompletion === void 0 ? void 0 : afterCompletion(durationMilliseconds, success);

@@ -23,0 +23,0 @@ };

@@ -14,3 +14,3 @@ import type { MetricsClient } from './MetricsClient';

*/
export declare const createTimedSpan: (metricsClient: TimingMetricsClient) => <T>(name: string, block: () => PromiseLike<T>, afterCompletion?: ((duration: number, success: boolean) => void) | undefined) => Promise<T>;
export declare const createTimedSpan: (metricsClient: TimingMetricsClient) => <T>(name: string, block: () => PromiseLike<T>, afterCompletion?: ((duration: number, success: boolean) => void) | undefined, tags?: string[]) => Promise<T>;
export {};
{
"name": "seek-datadog-custom-metrics",
"version": "4.4.0",
"version": "4.5.0",
"private": false,

@@ -38,4 +38,4 @@ "description": "Helpers for sending Datadog custom metrics",

"@types/node": "16.18.37",
"datadog-lambda-js": "6.84.0",
"dd-trace": "3.9.3",
"datadog-lambda-js": "6.89.0",
"dd-trace": "3.28.0",
"hot-shots": "10.0.0",

@@ -45,3 +45,3 @@ "skuba": "6.2.0"

"peerDependencies": {
"datadog-lambda-js": "6.x",
"datadog-lambda-js": "6.x || 7.x",
"hot-shots": "6.x || 7.x || 8.x || 9.x || 10.x"

@@ -48,0 +48,0 @@ },

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