Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3b15e9e

Browse files
committed
chore: add debug logging to agent api requests
1 parentfa314fe commit3b15e9e

33 files changed

+213
-78
lines changed

‎agent/api.go‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,19 @@ import (
99
"github.com/google/uuid"
1010

1111
"github.com/coder/coder/v2/coderd/httpapi"
12+
"github.com/coder/coder/v2/coderd/httpmw"
13+
"github.com/coder/coder/v2/coderd/httpmw/loggermw"
14+
"github.com/coder/coder/v2/coderd/tracing"
1215
"github.com/coder/coder/v2/codersdk"
1316
)
1417

1518
func (a*agent)apiHandler() http.Handler {
1619
r:=chi.NewRouter()
20+
r.Use(
21+
httpmw.Recover(a.logger),
22+
tracing.StatusWriterMiddleware,
23+
loggermw.Logger(a.logger),
24+
)
1725
r.Get("/",func(rw http.ResponseWriter,r*http.Request) {
1826
httpapi.Write(r.Context(),rw,http.StatusOK, codersdk.Response{
1927
Message:"Hello from the agent!",

‎coderd/httpmw/actor.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build !slim
2+
13
package httpmw
24

35
import (

‎coderd/httpmw/apikey.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build !slim
2+
13
package httpmw
24

35
import (

‎coderd/httpmw/clitelemetry.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build !slim
2+
13
package httpmw
24

35
import (

‎coderd/httpmw/cors.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build !slim
2+
13
package httpmw
24

35
import (

‎coderd/httpmw/csp.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build !slim
2+
13
package httpmw
24

35
import (

‎coderd/httpmw/csrf.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build !slim
2+
13
package httpmw
24

35
import (

‎coderd/httpmw/experiments.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build !slim
2+
13
package httpmw
24

35
import (

‎coderd/httpmw/externalauthparam.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build !slim
2+
13
package httpmw
24

35
import (

‎coderd/httpmw/groupparam.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build !slim
2+
13
package httpmw
24

35
import (

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp