Skip to content

Commit

Permalink
Address a few more
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandre-normand committed Jun 15, 2022
1 parent d39e3fb commit 6b53e19
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions contrib/database/sql/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ func WithSpanTags(ctx context.Context, tags map[string]string) context.Context {
return context.WithValue(ctx, spanTagsKey, tags)
}

// injectComments returns the query with sql comments injected according to the comment injection mode along
// with a span id injected into sql comments. The returned span id should be used when the sql span is created
// injectComments returns the query with SQL comments injected according to the comment injection mode along
// with a span ID injected into SQL comments. The returned span ID should be used when the SQL span is created
// following the traced database call.
func injectComments(ctx context.Context, query string, mode tracer.SQLCommentInjectionMode) (cquery string, spanID uint64) {
// The sql span only gets created after the call to the database because we need to be able to skip spans
Expand Down
2 changes: 1 addition & 1 deletion ddtrace/tracer/sqlcomment.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func commentQuery(query string, tags map[string]string) string {
if len(tags) == 0 {
return ""
}
b := strings.Builder{}
var b strings.Builder
// the sqlcommenter specification dictates that tags should be sorted. Since we know all injected keys,
// we skip a sorting operation by specifying the order of keys statically
orderedKeys := []string{sqlCommentEnv, sqlCommentSpanID, sqlCommentService, sqlCommentKeySamplingPriority, sqlCommentVersion, sqlCommentTraceID}
Expand Down

0 comments on commit 6b53e19

Please sign in to comment.