feat: add rbac tracing (#4093)

This commit is contained in:
Colin Adler
2022-09-16 13:32:15 -05:00
committed by GitHub
parent 1bca269b90
commit b340634aaa
14 changed files with 79 additions and 34 deletions

View File

@ -6,13 +6,14 @@ import (
"cdr.dev/slog"
"github.com/coder/coder/coderd/httpapi"
"github.com/coder/coder/coderd/tracing"
)
func Logger(log slog.Logger) func(next http.Handler) http.Handler {
return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
start := time.Now()
sw := &httpapi.StatusWriter{ResponseWriter: w}
sw := &tracing.StatusWriter{ResponseWriter: w}
httplog := log.With(
slog.F("host", httpapi.RequestHost(r)),