Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
log on unsupport remote logging type
Browse files Browse the repository at this point in the history
majst01 committed Jan 25, 2024
1 parent 8bf7a0a commit 4a5f215
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/remote-logging.go
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ import (
"log/slog"

"github.com/grafana/loki-client-go/loki"
"github.com/metal-stack/pixie/api"
promconfig "github.com/prometheus/common/config"
slogloki "github.com/samber/slog-loki/v3"
slogmulti "github.com/samber/slog-multi"
@@ -18,6 +19,10 @@ func AddRemoteLoggerFrom(pixieURL string, handler slog.Handler) (*slog.Logger, e
if metalConfig.Logging == nil {
return slog.New(handler), nil
}
if metalConfig.Logging.Type != api.LogTypeLoki {
slog.New(handler).Error("unsupported remote logging type, ignoring", "type", metalConfig.Logging.Type)
return slog.New(handler), nil
}

httpClient := promconfig.DefaultHTTPClientConfig
httpClient.BasicAuth = &promconfig.BasicAuth{

0 comments on commit 4a5f215

Please sign in to comment.