From 20e0a4cf9f540858197c52133c4b673916ebf950 Mon Sep 17 00:00:00 2001 From: PierreDemailly <39910767+PierreDemailly@users.noreply.github.com> Date: Fri, 30 Aug 2024 17:38:53 +0200 Subject: [PATCH] fix(agent/loki): find default loki datasource instead of all datasources (#298) --- src/agent/src/datasource.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/agent/src/datasource.ts b/src/agent/src/datasource.ts index e8aa678..755582d 100644 --- a/src/agent/src/datasource.ts +++ b/src/agent/src/datasource.ts @@ -26,7 +26,7 @@ export class Datasource { const datasources = await this.datasource.fetchDatasources(); const lokiDatasources = datasources.filter((datasource) => datasource.type === "loki")!; - const datasource = datasources.find((datasource) => datasource.isDefault) ?? lokiDatasources.at(0)!; + const datasource = lokiDatasources.find((lokiDatasource) => lokiDatasource.isDefault) ?? lokiDatasources.at(0)!; this.cache = datasource; return datasource;