Skip to content

Commit

Permalink
Add base_url_gap for Grafana
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcl committed Sep 18, 2024
1 parent f2d805e commit 500e5d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/config/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:"-"`
Expand Down
4 changes: 2 additions & 2 deletions lib/logstream/logstream_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 + "/"
}
Expand Down

0 comments on commit 500e5d5

Please sign in to comment.