datadog-mcp 2.0.0 → 2.0.2
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.js +8 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2358,13 +2358,13 @@ async function incidentsEventsV2(api, params, limits, site) {
|
|
|
2358
2358
|
};
|
|
2359
2359
|
}
|
|
2360
2360
|
async function enrichWithMonitorMetadata(events, monitorsApi) {
|
|
2361
|
-
const
|
|
2361
|
+
const monitorIds = /* @__PURE__ */ new Set();
|
|
2362
2362
|
for (const event of events) {
|
|
2363
|
-
if (event.
|
|
2364
|
-
|
|
2363
|
+
if (event.monitorId) {
|
|
2364
|
+
monitorIds.add(event.monitorId);
|
|
2365
2365
|
}
|
|
2366
2366
|
}
|
|
2367
|
-
if (
|
|
2367
|
+
if (monitorIds.size === 0) {
|
|
2368
2368
|
return events;
|
|
2369
2369
|
}
|
|
2370
2370
|
const monitorCache = /* @__PURE__ */ new Map();
|
|
@@ -2374,8 +2374,8 @@ async function enrichWithMonitorMetadata(events, monitorsApi) {
|
|
|
2374
2374
|
});
|
|
2375
2375
|
const monitors = response ?? [];
|
|
2376
2376
|
for (const monitor of monitors) {
|
|
2377
|
-
if (monitor.
|
|
2378
|
-
monitorCache.set(monitor.
|
|
2377
|
+
if (monitor.id && monitorIds.has(monitor.id)) {
|
|
2378
|
+
monitorCache.set(monitor.id, monitor);
|
|
2379
2379
|
}
|
|
2380
2380
|
}
|
|
2381
2381
|
} catch {
|
|
@@ -2383,8 +2383,8 @@ async function enrichWithMonitorMetadata(events, monitorsApi) {
|
|
|
2383
2383
|
}
|
|
2384
2384
|
return events.map((event) => {
|
|
2385
2385
|
const enriched = { ...event };
|
|
2386
|
-
if (event.
|
|
2387
|
-
const monitor = monitorCache.get(event.
|
|
2386
|
+
if (event.monitorId) {
|
|
2387
|
+
const monitor = monitorCache.get(event.monitorId);
|
|
2388
2388
|
if (monitor) {
|
|
2389
2389
|
enriched.monitorMetadata = {
|
|
2390
2390
|
id: monitor.id ?? 0,
|