Bring back TraceID and SpanID fields in access logs
Co-authored-by: Kevin Pollet <pollet.kevin@gmail.com>
This commit is contained in:
parent
020ab5f347
commit
4ce4bd7121
4 changed files with 18 additions and 32 deletions
|
@ -8,7 +8,6 @@ import (
|
|||
"github.com/containous/alice"
|
||||
"github.com/rs/zerolog/log"
|
||||
"github.com/traefik/traefik/v3/pkg/middlewares"
|
||||
"github.com/traefik/traefik/v3/pkg/middlewares/accesslog"
|
||||
"github.com/traefik/traefik/v3/pkg/tracing"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
|
@ -63,12 +62,6 @@ func (e *entryPointTracing) ServeHTTP(rw http.ResponseWriter, req *http.Request)
|
|||
|
||||
e.tracer.CaptureServerRequest(span, req)
|
||||
|
||||
if logData := accesslog.GetLogData(req); logData != nil {
|
||||
spanContext := span.SpanContext()
|
||||
logData.Core[accesslog.TraceID] = spanContext.TraceID().String()
|
||||
logData.Core[accesslog.SpanID] = spanContext.SpanID().String()
|
||||
}
|
||||
|
||||
recorder := newStatusCodeRecorder(rw, http.StatusOK)
|
||||
e.next.ServeHTTP(recorder, req)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue