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
This commit is contained in:
5
.changeset/stupid-coats-accept.md
Normal file
5
.changeset/stupid-coats-accept.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'grafana-zabbix': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix: slaid is missing error
|
||||||
@@ -670,6 +670,9 @@ export class Zabbix implements ZabbixConnector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const slaIds = slas.map((s) => s.slaid);
|
const slaIds = slas.map((s) => s.slaid);
|
||||||
|
if (slaIds.length === 0) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
if (slaIds.length > 1) {
|
if (slaIds.length > 1) {
|
||||||
const sliQueries = slaIds?.map((slaId) => this.zabbixAPI.getSLI(slaId, itServiceIds, timeRange, options));
|
const sliQueries = slaIds?.map((slaId) => this.zabbixAPI.getSLI(slaId, itServiceIds, timeRange, options));
|
||||||
const results = await Promise.all(sliQueries);
|
const results = await Promise.all(sliQueries);
|
||||||
|
|||||||
Reference in New Issue
Block a user