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

Commita4c4683

Browse files
committed
pr comments
1 parent2cb35aa commita4c4683

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

‎cli/server.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,11 @@ func server() *cobra.Command {
120120
_=tracerProvider.Shutdown(ctx)
121121
}()
122122

123-
sqlDriver,err=tracing.PostgresDriver(tracerProvider,"coderd.database")
123+
d,err:=tracing.PostgresDriver(tracerProvider,"coderd.database")
124124
iferr!=nil {
125125
logger.Warn(cmd.Context(),"failed to start postgres tracing driver",slog.Error(err))
126+
}else {
127+
sqlDriver=d
126128
}
127129
}
128130
}

‎coderd/tracing/postgres.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ func formatPostgresSpan(ctx context.Context, op string) string {
3737
returnstrings.ToUpper(op)
3838
}
3939

40-
s:=strings.Split(strings.TrimPrefix(q,qPrefix)," ")[0]
40+
// Remove the qPrefix and then grab the method name.
41+
// We expect the first line of the query to be in
42+
// the format "-- name: GetAPIKeyByID :one".
43+
s:=strings.SplitN(strings.TrimPrefix(q,qPrefix)," ",2)[0]
4144
returnfmt.Sprintf("%s %s",strings.ToUpper(op),s)
4245
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp