@loglayer/mixin-datadog-http-metrics 2.0.0 → 2.2.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/dist/index.mjs CHANGED
@@ -1,6 +1,4 @@
1
1
  import metrics from "datadog-metrics";
2
- import { LogLayerMixinAugmentType } from "loglayer";
3
-
4
2
  //#region src/client.ts
5
3
  let metricsClient = null;
6
4
  /**
@@ -29,7 +27,42 @@ function isNoOpClient() {
29
27
  function getMetricsClient() {
30
28
  return metricsClient;
31
29
  }
32
-
30
+ //#endregion
31
+ //#region ../../core/plugin/dist/index.js
32
+ /**
33
+ * List of plugin callbacks that can be called by the plugin manager.
34
+ *
35
+ * @see {@link https://loglayer.dev/plugins/creating-plugins.html#transformloglevel | transformLogLevel Docs}
36
+ * @see {@link https://loglayer.dev/plugins/creating-plugins.html#onbeforedataout | onBeforeDataOut Docs}
37
+ * @see {@link https://loglayer.dev/plugins/creating-plugins.html#shouldsendtologger | shouldSendToLogger Docs}
38
+ * @see {@link https://loglayer.dev/plugins/creating-plugins.html#onmetadatacalled | onMetadataCalled Docs}
39
+ * @see {@link https://loglayer.dev/plugins/creating-plugins.html#onbeforemessageout | onBeforeMessageOut Docs}
40
+ * @see {@link https://loglayer.dev/plugins/creating-plugins.html#oncontextcalled | onContextCalled Docs}
41
+ */
42
+ let PluginCallbackType = /* @__PURE__ */ function(PluginCallbackType) {
43
+ PluginCallbackType["transformLogLevel"] = "transformLogLevel";
44
+ PluginCallbackType["onBeforeDataOut"] = "onBeforeDataOut";
45
+ PluginCallbackType["shouldSendToLogger"] = "shouldSendToLogger";
46
+ PluginCallbackType["onMetadataCalled"] = "onMetadataCalled";
47
+ PluginCallbackType["onBeforeMessageOut"] = "onBeforeMessageOut";
48
+ PluginCallbackType["onContextCalled"] = "onContextCalled";
49
+ return PluginCallbackType;
50
+ }({});
51
+ PluginCallbackType.onBeforeDataOut, PluginCallbackType.onMetadataCalled, PluginCallbackType.onBeforeMessageOut, PluginCallbackType.transformLogLevel, PluginCallbackType.shouldSendToLogger, PluginCallbackType.onContextCalled;
52
+ /**
53
+ * The class that the mixin extends
54
+ */
55
+ let LogLayerMixinAugmentType = /* @__PURE__ */ function(LogLayerMixinAugmentType) {
56
+ /**
57
+ * Mixin extends the LogBuilder prototype
58
+ */
59
+ LogLayerMixinAugmentType["LogBuilder"] = "LogBuilder";
60
+ /**
61
+ * Mixin extends the LogLayer prototype
62
+ */
63
+ LogLayerMixinAugmentType["LogLayer"] = "LogLayer";
64
+ return LogLayerMixinAugmentType;
65
+ }({});
33
66
  //#endregion
34
67
  //#region src/CommonMetricsBuilder.ts
35
68
  /**
@@ -72,7 +105,6 @@ var CommonMetricsBuilder = class {
72
105
  return this;
73
106
  }
74
107
  };
75
-
76
108
  //#endregion
77
109
  //#region src/builders/DistributionBuilder.ts
78
110
  /**
@@ -103,7 +135,6 @@ var DistributionBuilder = class extends CommonMetricsBuilder {
103
135
  this.client.distribution(this.key, this.value, this.tags, this.timestamp);
104
136
  }
105
137
  };
106
-
107
138
  //#endregion
108
139
  //#region src/builders/GaugeBuilder.ts
109
140
  /**
@@ -134,7 +165,6 @@ var GaugeBuilder = class extends CommonMetricsBuilder {
134
165
  this.client.gauge(this.key, this.value, this.tags, this.timestamp);
135
166
  }
136
167
  };
137
-
138
168
  //#endregion
139
169
  //#region src/builders/HistogramBuilder.ts
140
170
  /**
@@ -177,7 +207,6 @@ var HistogramBuilder = class extends CommonMetricsBuilder {
177
207
  this.client.histogram(this.key, this.value, this.tags, this.timestamp, this.histogramOptions);
178
208
  }
179
209
  };
180
-
181
210
  //#endregion
182
211
  //#region src/builders/IncrementBuilder.ts
183
212
  /**
@@ -216,7 +245,6 @@ var IncrementBuilder = class extends CommonMetricsBuilder {
216
245
  this.client.increment(this.key, this.value, this.tags, this.timestamp);
217
246
  }
218
247
  };
219
-
220
248
  //#endregion
221
249
  //#region src/MetricsAPI.ts
222
250
  /**
@@ -224,6 +252,7 @@ var IncrementBuilder = class extends CommonMetricsBuilder {
224
252
  * Provides a fluent interface for sending metrics to Datadog via HTTP.
225
253
  */
226
254
  var MetricsAPI = class {
255
+ client;
227
256
  /**
228
257
  * Creates a new MetricsAPI instance.
229
258
  *
@@ -307,7 +336,6 @@ var MetricsAPI = class {
307
336
  return this.client;
308
337
  }
309
338
  };
310
-
311
339
  //#endregion
312
340
  //#region src/MockMetricsAPI.ts
313
341
  /**
@@ -403,7 +431,6 @@ var MockMetricsAPI = class {
403
431
  };
404
432
  }
405
433
  };
406
-
407
434
  //#endregion
408
435
  //#region src/LogLayer.augment.ts
409
436
  /**
@@ -439,7 +466,6 @@ const logLayerDatadogMetricsMixin = {
439
466
  });
440
467
  }
441
468
  };
442
-
443
469
  //#endregion
444
470
  //#region src/index.ts
445
471
  const BufferedMetricsLogger = metrics.BufferedMetricsLogger;
@@ -488,6 +514,5 @@ function datadogMetricsMixin(options) {
488
514
  pluginsToAdd: []
489
515
  };
490
516
  }
491
-
492
517
  //#endregion
493
- export { BufferedMetricsLogger, DatadogReporter, MetricsAPI, MockMetricsAPI, NullReporter, datadogMetricsMixin };
518
+ 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.0.0",
4
+ "version": "2.2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.mjs",
@@ -37,13 +37,13 @@
37
37
  "datadog-metrics": "0.12.1"
38
38
  },
39
39
  "devDependencies": {
40
- "@types/node": "25.2.0",
41
- "tsdown": "0.20.1",
42
- "typescript": "5.9.3",
43
- "vitest": "4.0.18",
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.0.0",
46
- "loglayer": "9.0.0"
45
+ "@loglayer/shared": "4.3.0",
46
+ "loglayer": "9.3.0"
47
47
  },
48
48
  "bugs": "https://github.com/loglayer/loglayer/issues",
49
49
  "engines": {