@loglayer/mixin-datadog-http-metrics 2.0.0 → 2.1.0
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/LICENSE +1 -1
- package/dist/index.cjs +50 -3
- package/dist/index.d.cts +2059 -1
- package/dist/index.d.mts +2059 -1
- package/dist/index.mjs +47 -1
- package/package.json +5 -5
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2026 Theo Gravity / [Disaresta](https://disaresta.com)
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
2
3
|
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -27,7 +28,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
28
|
//#endregion
|
|
28
29
|
let datadog_metrics = require("datadog-metrics");
|
|
29
30
|
datadog_metrics = __toESM(datadog_metrics);
|
|
30
|
-
let loglayer = require("loglayer");
|
|
31
31
|
|
|
32
32
|
//#region src/client.ts
|
|
33
33
|
let metricsClient = null;
|
|
@@ -58,6 +58,53 @@ function getMetricsClient() {
|
|
|
58
58
|
return metricsClient;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region ../../core/plugin/dist/index.js
|
|
63
|
+
/**
|
|
64
|
+
* List of plugin callbacks that can be called by the plugin manager.
|
|
65
|
+
*
|
|
66
|
+
* @see {@link https://loglayer.dev/plugins/creating-plugins.html#transformloglevel | transformLogLevel Docs}
|
|
67
|
+
* @see {@link https://loglayer.dev/plugins/creating-plugins.html#onbeforedataout | onBeforeDataOut Docs}
|
|
68
|
+
* @see {@link https://loglayer.dev/plugins/creating-plugins.html#shouldsendtologger | shouldSendToLogger Docs}
|
|
69
|
+
* @see {@link https://loglayer.dev/plugins/creating-plugins.html#onmetadatacalled | onMetadataCalled Docs}
|
|
70
|
+
* @see {@link https://loglayer.dev/plugins/creating-plugins.html#onbeforemessageout | onBeforeMessageOut Docs}
|
|
71
|
+
* @see {@link https://loglayer.dev/plugins/creating-plugins.html#oncontextcalled | onContextCalled Docs}
|
|
72
|
+
*/
|
|
73
|
+
let PluginCallbackType = /* @__PURE__ */ function(PluginCallbackType) {
|
|
74
|
+
PluginCallbackType["transformLogLevel"] = "transformLogLevel";
|
|
75
|
+
PluginCallbackType["onBeforeDataOut"] = "onBeforeDataOut";
|
|
76
|
+
PluginCallbackType["shouldSendToLogger"] = "shouldSendToLogger";
|
|
77
|
+
PluginCallbackType["onMetadataCalled"] = "onMetadataCalled";
|
|
78
|
+
PluginCallbackType["onBeforeMessageOut"] = "onBeforeMessageOut";
|
|
79
|
+
PluginCallbackType["onContextCalled"] = "onContextCalled";
|
|
80
|
+
return PluginCallbackType;
|
|
81
|
+
}({});
|
|
82
|
+
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region ../../core/loglayer/dist/index.js
|
|
85
|
+
const CALLBACK_LIST = [
|
|
86
|
+
PluginCallbackType.onBeforeDataOut,
|
|
87
|
+
PluginCallbackType.onMetadataCalled,
|
|
88
|
+
PluginCallbackType.onBeforeMessageOut,
|
|
89
|
+
PluginCallbackType.transformLogLevel,
|
|
90
|
+
PluginCallbackType.shouldSendToLogger,
|
|
91
|
+
PluginCallbackType.onContextCalled
|
|
92
|
+
];
|
|
93
|
+
/**
|
|
94
|
+
* The class that the mixin extends
|
|
95
|
+
*/
|
|
96
|
+
let LogLayerMixinAugmentType = /* @__PURE__ */ function(LogLayerMixinAugmentType) {
|
|
97
|
+
/**
|
|
98
|
+
* Mixin extends the LogBuilder prototype
|
|
99
|
+
*/
|
|
100
|
+
LogLayerMixinAugmentType["LogBuilder"] = "LogBuilder";
|
|
101
|
+
/**
|
|
102
|
+
* Mixin extends the LogLayer prototype
|
|
103
|
+
*/
|
|
104
|
+
LogLayerMixinAugmentType["LogLayer"] = "LogLayer";
|
|
105
|
+
return LogLayerMixinAugmentType;
|
|
106
|
+
}({});
|
|
107
|
+
|
|
61
108
|
//#endregion
|
|
62
109
|
//#region src/CommonMetricsBuilder.ts
|
|
63
110
|
/**
|
|
@@ -439,7 +486,7 @@ var MockMetricsAPI = class {
|
|
|
439
486
|
* Provides access to the MetricsAPI for sending metrics to Datadog via HTTP.
|
|
440
487
|
*/
|
|
441
488
|
const logLayerDatadogMetricsMixin = {
|
|
442
|
-
augmentationType:
|
|
489
|
+
augmentationType: LogLayerMixinAugmentType.LogLayer,
|
|
443
490
|
augment: (prototype) => {
|
|
444
491
|
Object.defineProperty(prototype, "ddStats", {
|
|
445
492
|
get() {
|