From 9089067e038e99ce0b7c70d79468fa119ca64c13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Bedi?= Date: Mon, 15 Sep 2025 20:11:59 +0200 Subject: [PATCH] Fix: slaid is missing error (#2077) In order to reproduce this you need to create a Service and an SLO. The bug appears when an SLO is not set. Fixes #1784 --- .changeset/stupid-coats-accept.md | 5 +++++ src/datasource/zabbix/zabbix.ts | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 .changeset/stupid-coats-accept.md diff --git a/.changeset/stupid-coats-accept.md b/.changeset/stupid-coats-accept.md new file mode 100644 index 0000000..b7a9df9 --- /dev/null +++ b/.changeset/stupid-coats-accept.md @@ -0,0 +1,5 @@ +--- +'grafana-zabbix': patch +--- + +Fix: slaid is missing error diff --git a/src/datasource/zabbix/zabbix.ts b/src/datasource/zabbix/zabbix.ts index 805256b..0dea2c4 100644 --- a/src/datasource/zabbix/zabbix.ts +++ b/src/datasource/zabbix/zabbix.ts @@ -670,6 +670,9 @@ export class Zabbix implements ZabbixConnector { } const slaIds = slas.map((s) => s.slaid); + if (slaIds.length === 0) { + return []; + } if (slaIds.length > 1) { const sliQueries = slaIds?.map((slaId) => this.zabbixAPI.getSLI(slaId, itServiceIds, timeRange, options)); const results = await Promise.all(sliQueries);