remove dead code
This commit is contained in:
2 files changed
+2
-14
No files matched your search
@@ -1,7 +1,6 @@
|
|||||||
package middleware
|
package middleware
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -31,14 +30,3 @@ func AccessLog(logger log.Logger) func(http.Handler) http.Handler {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ExtractRequestID extracts the request ID from the context. Since we now use the go-chi middleware to write the request
|
|
||||||
// id, this is propagated using the context, therefore read it from there.
|
|
||||||
func ExtractRequestID(ctx context.Context) string {
|
|
||||||
var rid string
|
|
||||||
if v, ok := ctx.Value(chimiddleware.RequestIDKey).(string); ok {
|
|
||||||
rid = v
|
|
||||||
}
|
|
||||||
|
|
||||||
return rid
|
|
||||||
}
|
|
||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/owncloud/ocis/proxy/pkg/middleware"
|
chimiddleware "github.com/go-chi/chi/middleware"
|
||||||
|
|
||||||
"go.opentelemetry.io/otel/attribute"
|
"go.opentelemetry.io/otel/attribute"
|
||||||
|
|
||||||
@@ -231,7 +231,7 @@ func (p *MultiHostReverseProxy) ServeHTTP(w http.ResponseWriter, r *http.Request
|
|||||||
span.SetAttributes(
|
span.SetAttributes(
|
||||||
attribute.KeyValue{
|
attribute.KeyValue{
|
||||||
Key: "x-request-id",
|
Key: "x-request-id",
|
||||||
Value: attribute.StringValue(middleware.ExtractRequestID(r.Context())),
|
Value: attribute.StringValue(chimiddleware.GetReqID(r.Context())),
|
||||||
})
|
})
|
||||||
|
|
||||||
pkgtrace.Propagator.Inject(ctx, propagation.HeaderCarrier(r.Header))
|
pkgtrace.Propagator.Inject(ctx, propagation.HeaderCarrier(r.Header))
|
||||||
|
|||||||
Reference in new issue
Block a user