@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.mjs
CHANGED
|
@@ -5599,16 +5599,17 @@ const getMetrics = (opts, report, bundler) => {
|
|
|
5599
5599
|
if (bundler.esbuild) {
|
|
5600
5600
|
metrics.push(...getEsbuildMetrics(bundler.esbuild, opts.cwd));
|
|
5601
5601
|
}
|
|
5602
|
+
const ddOptions = getOptionsDD(opts);
|
|
5602
5603
|
const metricsToSend = metrics.map((m) => {
|
|
5603
5604
|
let metric = m;
|
|
5604
|
-
if (
|
|
5605
|
-
for (const filter of
|
|
5605
|
+
if (ddOptions.filters?.length) {
|
|
5606
|
+
for (const filter of ddOptions.filters) {
|
|
5606
5607
|
if (metric) {
|
|
5607
5608
|
metric = filter(metric);
|
|
5608
5609
|
}
|
|
5609
5610
|
}
|
|
5610
5611
|
}
|
|
5611
|
-
return metric ? getMetric(metric,
|
|
5612
|
+
return metric ? getMetric(metric, ddOptions) : null;
|
|
5612
5613
|
}).filter((m) => m !== null);
|
|
5613
5614
|
return metricsToSend;
|
|
5614
5615
|
};
|
|
@@ -5619,7 +5620,7 @@ const sendMetrics = (metrics, opts) => {
|
|
|
5619
5620
|
}
|
|
5620
5621
|
const metricsNames = [...new Set(metrics.map((m) => m.metric))].sort().map((name) => `${name} - ${metrics.filter((m) => m.metric === name).length}`);
|
|
5621
5622
|
console.log(`
|
|
5622
|
-
|
|
5623
|
+
Sending ${metrics.length} metrics.
|
|
5623
5624
|
Metrics:
|
|
5624
5625
|
- ${metricsNames.join("\n - ")}`);
|
|
5625
5626
|
return new Promise((resolve, reject) => {
|