mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: add debug logging and recovery to agent api requests (#20785)
This is to debug context timeouts on API requests to the agent. Because rbac and database cannot be imported in slim, split the logger middleware into slim and non-slim versions and break out the recovery middleware.
This commit is contained in:
@@ -39,6 +39,7 @@ import (
|
||||
"github.com/coder/coder/v2/enterprise/derpmesh"
|
||||
"github.com/coder/coder/v2/enterprise/replicasync"
|
||||
"github.com/coder/coder/v2/enterprise/wsproxy/wsproxysdk"
|
||||
sharedhttpmw "github.com/coder/coder/v2/httpmw"
|
||||
"github.com/coder/coder/v2/site"
|
||||
"github.com/coder/coder/v2/tailnet"
|
||||
)
|
||||
@@ -328,7 +329,7 @@ func New(ctx context.Context, opts *Options) (*Server, error) {
|
||||
// Persistent middlewares to all routes
|
||||
r.Use(
|
||||
// TODO: @emyrk Should we standardize these in some other package?
|
||||
httpmw.Recover(s.Logger),
|
||||
sharedhttpmw.Recover(s.Logger),
|
||||
httpmw.WithProfilingLabels,
|
||||
tracing.StatusWriterMiddleware,
|
||||
tracing.Middleware(s.TracerProvider),
|
||||
|
||||
Reference in New Issue
Block a user