@datadog/webpack-plugin 0.0.12-dev → 0.0.13-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/src/index.js +5 -4
- package/dist/src/index.js.map +1 -1
- package/dist/src/index.mjs +5 -4
- package/dist/src/index.mjs.map +1 -1
- package/package.json +4 -2
package/dist/src/index.js
CHANGED
|
@@ -5623,16 +5623,17 @@ const getMetrics = (opts, report, bundler) => {
|
|
|
5623
5623
|
if (bundler.esbuild) {
|
|
5624
5624
|
metrics.push(...getEsbuildMetrics(bundler.esbuild, opts.cwd));
|
|
5625
5625
|
}
|
|
5626
|
+
const ddOptions = getOptionsDD(opts);
|
|
5626
5627
|
const metricsToSend = metrics.map((m) => {
|
|
5627
5628
|
let metric = m;
|
|
5628
|
-
if (
|
|
5629
|
-
for (const filter of
|
|
5629
|
+
if (ddOptions.filters?.length) {
|
|
5630
|
+
for (const filter of ddOptions.filters) {
|
|
5630
5631
|
if (metric) {
|
|
5631
5632
|
metric = filter(metric);
|
|
5632
5633
|
}
|
|
5633
5634
|
}
|
|
5634
5635
|
}
|
|
5635
|
-
return metric ? getMetric(metric,
|
|
5636
|
+
return metric ? getMetric(metric, ddOptions) : null;
|
|
5636
5637
|
}).filter((m) => m !== null);
|
|
5637
5638
|
return metricsToSend;
|
|
5638
5639
|
};
|
|
@@ -5643,7 +5644,7 @@ const sendMetrics = (metrics, opts) => {
|
|
|
5643
5644
|
}
|
|
5644
5645
|
const metricsNames = [...new Set(metrics.map((m) => m.metric))].sort().map((name) => `${name} - ${metrics.filter((m) => m.metric === name).length}`);
|
|
5645
5646
|
console.log(`
|
|
5646
|
-
|
|
5647
|
+
Sending ${metrics.length} metrics.
|
|
5647
5648
|
Metrics:
|
|
5648
5649
|
- ${metricsNames.join("\n - ")}`);
|
|
5649
5650
|
return new Promise((resolve, reject) => {
|