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

Commit16c12e9

Browse files
authored
chore: Improve agent logging (coder#3483)
1 parentca34206 commit16c12e9

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

‎agent/agent.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ func (a *agent) run(ctx context.Context) {
129129
// An exponential back-off occurs when the connection is failing to dial.
130130
// This is to prevent server spam in case of a coderd outage.
131131
forretrier:=retry.New(50*time.Millisecond,10*time.Second);retrier.Wait(ctx); {
132+
a.logger.Info(ctx,"connecting")
132133
metadata,peerListener,err=a.dialer(ctx,a.logger)
133134
iferr!=nil {
134135
iferrors.Is(err,context.Canceled) {
@@ -255,6 +256,7 @@ func (a *agent) handlePeerConn(ctx context.Context, conn *peer.Conn) {
255256
}
256257

257258
func (a*agent)init(ctx context.Context) {
259+
a.logger.Info(ctx,"generating host key")
258260
// Clients' should ignore the host key when connecting.
259261
// The agent needs to authenticate with coderd to SSH,
260262
// so SSH authentication doesn't improve security.

‎cli/agent.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ func workspaceAgent() *cobra.Command {
7373
returnnil
7474
}
7575

76+
logger.Info(cmd.Context(),"starting agent",slog.F("url",coderURL),slog.F("auth",auth))
7677
client:=codersdk.New(coderURL)
7778

7879
ifpprofEnabled {
@@ -138,6 +139,7 @@ func workspaceAgent() *cobra.Command {
138139
}
139140

140141
ifexchangeToken!=nil {
142+
logger.Info(cmd.Context(),"exchanging identity token")
141143
// Agent's can start before resources are returned from the provisioner
142144
// daemon. If there are many resources being provisioned, this time
143145
// could be significant. This is arbitrarily set at an hour to prevent

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp