fix: otel not working without USER
This commit is contained in:
parent
ad566ee9ef
commit
c5ed376d5f
127 changed files with 347 additions and 305 deletions
|
|
@ -19,9 +19,10 @@ import (
|
|||
"github.com/rs/zerolog/log"
|
||||
"github.com/sirupsen/logrus"
|
||||
ptypes "github.com/traefik/paerser/types"
|
||||
"github.com/traefik/traefik/v3/pkg/logs"
|
||||
"github.com/traefik/traefik/v3/pkg/middlewares/capture"
|
||||
"github.com/traefik/traefik/v3/pkg/middlewares/observability"
|
||||
"github.com/traefik/traefik/v3/pkg/observability/logs"
|
||||
otypes "github.com/traefik/traefik/v3/pkg/observability/types"
|
||||
traefiktls "github.com/traefik/traefik/v3/pkg/tls"
|
||||
"github.com/traefik/traefik/v3/pkg/types"
|
||||
"go.opentelemetry.io/contrib/bridges/otellogrus"
|
||||
|
|
@ -64,7 +65,7 @@ type handlerParams struct {
|
|||
|
||||
// Handler will write each request and its response to the access log.
|
||||
type Handler struct {
|
||||
config *types.AccessLog
|
||||
config *otypes.AccessLog
|
||||
logger *logrus.Logger
|
||||
file io.WriteCloser
|
||||
mu sync.Mutex
|
||||
|
|
@ -88,7 +89,7 @@ func (h *Handler) AliceConstructor() alice.Constructor {
|
|||
}
|
||||
|
||||
// NewHandler creates a new Handler.
|
||||
func NewHandler(ctx context.Context, config *types.AccessLog) (*Handler, error) {
|
||||
func NewHandler(ctx context.Context, config *otypes.AccessLog) (*Handler, error) {
|
||||
var file io.WriteCloser = noopCloser{os.Stdout}
|
||||
if len(config.FilePath) > 0 {
|
||||
f, err := openAccessLogFile(config.FilePath)
|
||||
|
|
@ -423,9 +424,9 @@ func (h *Handler) redactHeaders(headers http.Header, fields logrus.Fields, prefi
|
|||
for k := range headers {
|
||||
v := h.config.Fields.KeepHeader(k)
|
||||
switch v {
|
||||
case types.AccessLogKeep:
|
||||
case otypes.AccessLogKeep:
|
||||
fields[prefix+k] = strings.Join(headers.Values(k), ",")
|
||||
case types.AccessLogRedact:
|
||||
case otypes.AccessLogRedact:
|
||||
fields[prefix+k] = "REDACTED"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue