Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-22.2: tracing: use timeutil for Now() and Since() #91312

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions pkg/testutils/lint/lint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -731,9 +731,6 @@ func TestLint(t *testing.T) {
":!**/embedded.go",
":!util/timeutil/time.go",
":!util/timeutil/zoneinfo.go",
":!util/tracing/span.go",
":!util/tracing/crdbspan.go",
":!util/tracing/tracer.go",
":!cmd/roachtest/tests/gorm_helpers.go",
)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/tracing/crdbspan.go
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ func (s *crdbSpan) getRecordingNoChildrenLocked(
// -1 indicates an unfinished Span. For a recording it's better to put some
// duration in it, otherwise tools get confused. For example, we export
// recordings to Jaeger, and spans with a zero duration don't look nice.
rs.Duration = time.Since(rs.StartTime)
rs.Duration = timeutil.Since(rs.StartTime)
rs.Finished = false
} else {
rs.Finished = true
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/tracing/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,7 @@ child operation: %s, tracer created at:
opts.LogTags = opts.Parent.i.crdb.logTags
}

startTime := time.Now()
startTime := timeutil.Now()

// First, create any external spans that we may need (OpenTelemetry, net/trace).
// We do this early so that they are available when we construct the main Span,
Expand Down