From 500e5d5fb6e89e60626d1bd13618c269be5704f2 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Wed, 18 Sep 2024 11:45:31 +0200 Subject: [PATCH] Add base_url_gap for Grafana --- lib/config/logging.go | 1 + lib/logstream/logstream_handlers.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/config/logging.go b/lib/config/logging.go index a050491bd..71f706a32 100644 --- a/lib/config/logging.go +++ b/lib/config/logging.go @@ -91,6 +91,7 @@ func (l *LokiConfig) Validate() error { type GrafanaConfig struct { BaseUrl *string `toml:"base_url"` + BaseUrlGap *string `toml:"base_url_gap"` // Base URL for the dashboard via GAP proxy used on CI DashboardUrl *string `toml:"dashboard_url"` DashboardUID *string `toml:"dashboard_uid"` // UID of the dashboard to put annotations on BearerToken *string `toml:"-"` diff --git a/lib/logstream/logstream_handlers.go b/lib/logstream/logstream_handlers.go index b95780978..c2be5cdf8 100644 --- a/lib/logstream/logstream_handlers.go +++ b/lib/logstream/logstream_handlers.go @@ -166,8 +166,8 @@ func (h *LokiLogHandler) GetLogLocation(consumers map[string]*ContainerLogConsum // if no Grafana URL has been set lets at least print query parameters that can be manually added to the dashboard url baseUrl := "" - if h.loggingConfig.Grafana != nil && h.loggingConfig.Grafana.BaseUrl != nil { - baseUrl = *h.loggingConfig.Grafana.BaseUrl + if h.loggingConfig.Grafana != nil && h.loggingConfig.Grafana.BaseUrlGap != nil { + baseUrl = *h.loggingConfig.Grafana.BaseUrlGap baseUrl = strings.TrimSuffix(baseUrl, "/") baseUrl = baseUrl + "/" }