@loglayer/mixin-datadog-http-metrics 2.1.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +12 -73
- package/dist/index.d.cts +1 -2059
- package/dist/index.d.mts +1 -2059
- package/dist/index.mjs +3 -59
- package/package.json +10 -7
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import metrics from "datadog-metrics";
|
|
2
|
-
|
|
2
|
+
import { LogLayerMixinAugmentType } from "loglayer";
|
|
3
3
|
//#region src/client.ts
|
|
4
4
|
let metricsClient = null;
|
|
5
5
|
/**
|
|
@@ -28,54 +28,6 @@ function isNoOpClient() {
|
|
|
28
28
|
function getMetricsClient() {
|
|
29
29
|
return metricsClient;
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region ../../core/plugin/dist/index.js
|
|
34
|
-
/**
|
|
35
|
-
* List of plugin callbacks that can be called by the plugin manager.
|
|
36
|
-
*
|
|
37
|
-
* @see {@link https://loglayer.dev/plugins/creating-plugins.html#transformloglevel | transformLogLevel Docs}
|
|
38
|
-
* @see {@link https://loglayer.dev/plugins/creating-plugins.html#onbeforedataout | onBeforeDataOut Docs}
|
|
39
|
-
* @see {@link https://loglayer.dev/plugins/creating-plugins.html#shouldsendtologger | shouldSendToLogger Docs}
|
|
40
|
-
* @see {@link https://loglayer.dev/plugins/creating-plugins.html#onmetadatacalled | onMetadataCalled Docs}
|
|
41
|
-
* @see {@link https://loglayer.dev/plugins/creating-plugins.html#onbeforemessageout | onBeforeMessageOut Docs}
|
|
42
|
-
* @see {@link https://loglayer.dev/plugins/creating-plugins.html#oncontextcalled | onContextCalled Docs}
|
|
43
|
-
*/
|
|
44
|
-
let PluginCallbackType = /* @__PURE__ */ function(PluginCallbackType) {
|
|
45
|
-
PluginCallbackType["transformLogLevel"] = "transformLogLevel";
|
|
46
|
-
PluginCallbackType["onBeforeDataOut"] = "onBeforeDataOut";
|
|
47
|
-
PluginCallbackType["shouldSendToLogger"] = "shouldSendToLogger";
|
|
48
|
-
PluginCallbackType["onMetadataCalled"] = "onMetadataCalled";
|
|
49
|
-
PluginCallbackType["onBeforeMessageOut"] = "onBeforeMessageOut";
|
|
50
|
-
PluginCallbackType["onContextCalled"] = "onContextCalled";
|
|
51
|
-
return PluginCallbackType;
|
|
52
|
-
}({});
|
|
53
|
-
|
|
54
|
-
//#endregion
|
|
55
|
-
//#region ../../core/loglayer/dist/index.js
|
|
56
|
-
const CALLBACK_LIST = [
|
|
57
|
-
PluginCallbackType.onBeforeDataOut,
|
|
58
|
-
PluginCallbackType.onMetadataCalled,
|
|
59
|
-
PluginCallbackType.onBeforeMessageOut,
|
|
60
|
-
PluginCallbackType.transformLogLevel,
|
|
61
|
-
PluginCallbackType.shouldSendToLogger,
|
|
62
|
-
PluginCallbackType.onContextCalled
|
|
63
|
-
];
|
|
64
|
-
/**
|
|
65
|
-
* The class that the mixin extends
|
|
66
|
-
*/
|
|
67
|
-
let LogLayerMixinAugmentType = /* @__PURE__ */ function(LogLayerMixinAugmentType) {
|
|
68
|
-
/**
|
|
69
|
-
* Mixin extends the LogBuilder prototype
|
|
70
|
-
*/
|
|
71
|
-
LogLayerMixinAugmentType["LogBuilder"] = "LogBuilder";
|
|
72
|
-
/**
|
|
73
|
-
* Mixin extends the LogLayer prototype
|
|
74
|
-
*/
|
|
75
|
-
LogLayerMixinAugmentType["LogLayer"] = "LogLayer";
|
|
76
|
-
return LogLayerMixinAugmentType;
|
|
77
|
-
}({});
|
|
78
|
-
|
|
79
31
|
//#endregion
|
|
80
32
|
//#region src/CommonMetricsBuilder.ts
|
|
81
33
|
/**
|
|
@@ -118,7 +70,6 @@ var CommonMetricsBuilder = class {
|
|
|
118
70
|
return this;
|
|
119
71
|
}
|
|
120
72
|
};
|
|
121
|
-
|
|
122
73
|
//#endregion
|
|
123
74
|
//#region src/builders/DistributionBuilder.ts
|
|
124
75
|
/**
|
|
@@ -149,7 +100,6 @@ var DistributionBuilder = class extends CommonMetricsBuilder {
|
|
|
149
100
|
this.client.distribution(this.key, this.value, this.tags, this.timestamp);
|
|
150
101
|
}
|
|
151
102
|
};
|
|
152
|
-
|
|
153
103
|
//#endregion
|
|
154
104
|
//#region src/builders/GaugeBuilder.ts
|
|
155
105
|
/**
|
|
@@ -180,7 +130,6 @@ var GaugeBuilder = class extends CommonMetricsBuilder {
|
|
|
180
130
|
this.client.gauge(this.key, this.value, this.tags, this.timestamp);
|
|
181
131
|
}
|
|
182
132
|
};
|
|
183
|
-
|
|
184
133
|
//#endregion
|
|
185
134
|
//#region src/builders/HistogramBuilder.ts
|
|
186
135
|
/**
|
|
@@ -223,7 +172,6 @@ var HistogramBuilder = class extends CommonMetricsBuilder {
|
|
|
223
172
|
this.client.histogram(this.key, this.value, this.tags, this.timestamp, this.histogramOptions);
|
|
224
173
|
}
|
|
225
174
|
};
|
|
226
|
-
|
|
227
175
|
//#endregion
|
|
228
176
|
//#region src/builders/IncrementBuilder.ts
|
|
229
177
|
/**
|
|
@@ -262,7 +210,6 @@ var IncrementBuilder = class extends CommonMetricsBuilder {
|
|
|
262
210
|
this.client.increment(this.key, this.value, this.tags, this.timestamp);
|
|
263
211
|
}
|
|
264
212
|
};
|
|
265
|
-
|
|
266
213
|
//#endregion
|
|
267
214
|
//#region src/MetricsAPI.ts
|
|
268
215
|
/**
|
|
@@ -270,6 +217,7 @@ var IncrementBuilder = class extends CommonMetricsBuilder {
|
|
|
270
217
|
* Provides a fluent interface for sending metrics to Datadog via HTTP.
|
|
271
218
|
*/
|
|
272
219
|
var MetricsAPI = class {
|
|
220
|
+
client;
|
|
273
221
|
/**
|
|
274
222
|
* Creates a new MetricsAPI instance.
|
|
275
223
|
*
|
|
@@ -353,7 +301,6 @@ var MetricsAPI = class {
|
|
|
353
301
|
return this.client;
|
|
354
302
|
}
|
|
355
303
|
};
|
|
356
|
-
|
|
357
304
|
//#endregion
|
|
358
305
|
//#region src/MockMetricsAPI.ts
|
|
359
306
|
/**
|
|
@@ -449,7 +396,6 @@ var MockMetricsAPI = class {
|
|
|
449
396
|
};
|
|
450
397
|
}
|
|
451
398
|
};
|
|
452
|
-
|
|
453
399
|
//#endregion
|
|
454
400
|
//#region src/LogLayer.augment.ts
|
|
455
401
|
/**
|
|
@@ -485,7 +431,6 @@ const logLayerDatadogMetricsMixin = {
|
|
|
485
431
|
});
|
|
486
432
|
}
|
|
487
433
|
};
|
|
488
|
-
|
|
489
434
|
//#endregion
|
|
490
435
|
//#region src/index.ts
|
|
491
436
|
const BufferedMetricsLogger = metrics.BufferedMetricsLogger;
|
|
@@ -534,6 +479,5 @@ function datadogMetricsMixin(options) {
|
|
|
534
479
|
pluginsToAdd: []
|
|
535
480
|
};
|
|
536
481
|
}
|
|
537
|
-
|
|
538
482
|
//#endregion
|
|
539
|
-
export { BufferedMetricsLogger, DatadogReporter, MetricsAPI, MockMetricsAPI, NullReporter, datadogMetricsMixin };
|
|
483
|
+
export { BufferedMetricsLogger, DatadogReporter, MetricsAPI, MockMetricsAPI, NullReporter, datadogMetricsMixin };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loglayer/mixin-datadog-http-metrics",
|
|
3
3
|
"description": "Adds Datadog HTTP metrics functionality to LogLayer using the datadog-metrics library.",
|
|
4
|
-
"version": "2.1
|
|
4
|
+
"version": "2.2.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
@@ -37,13 +37,16 @@
|
|
|
37
37
|
"datadog-metrics": "0.12.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@types/node": "25.
|
|
41
|
-
"tsdown": "0.
|
|
42
|
-
"typescript": "
|
|
43
|
-
"vitest": "4.
|
|
40
|
+
"@types/node": "25.9.1",
|
|
41
|
+
"tsdown": "0.22.1",
|
|
42
|
+
"typescript": "6.0.3",
|
|
43
|
+
"vitest": "4.1.7",
|
|
44
44
|
"@internal/tsconfig": "2.1.0",
|
|
45
|
-
"@loglayer/shared": "4.
|
|
46
|
-
"loglayer": "9.
|
|
45
|
+
"@loglayer/shared": "4.3.0",
|
|
46
|
+
"loglayer": "9.3.0"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"loglayer": ">=9.0.0"
|
|
47
50
|
},
|
|
48
51
|
"bugs": "https://github.com/loglayer/loglayer/issues",
|
|
49
52
|
"engines": {
|