Skip to content

Commit

Permalink
tracing: delete old field
Browse files Browse the repository at this point in the history
The RecordedSpan.RedactableLogs. This field was unused since 22.1.

Release note: None
  • Loading branch information
andreimatei committed Jul 20, 2022
1 parent 4a8f1be commit 221ac55
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 24 deletions.
10 changes: 2 additions & 8 deletions pkg/server/node_tenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ package server
import (
"github.com/cockroachdb/cockroach/pkg/roachpb"
"github.com/cockroachdb/cockroach/pkg/util/tracing/tracingpb"
"github.com/cockroachdb/errors"
"github.com/cockroachdb/redact"
)

Expand All @@ -22,7 +21,8 @@ const TraceRedactedMarker = redact.RedactableString("verbose trace message redac

// redactRecordingForTenant redacts the sensitive parts of log messages in the
// recording if the tenant to which this recording is intended is not the system
// tenant (the system tenant gets an. See https://github.com/cockroachdb/cockroach/issues/70407.
// tenant (the system tenant gets an unredacted trace).
// See https://github.com/cockroachdb/cockroach/issues/70407.
// The recording is modified in place.
//
// tenID is the tenant that will receive this recording.
Expand All @@ -36,12 +36,6 @@ func redactRecordingForTenant(tenID roachpb.TenantID, rec tracingpb.Recording) e
sp.TagGroups = nil
for j := range sp.Logs {
record := &sp.Logs[j]
if record.Message != "" && !sp.RedactableLogs {
// If Message is set, the record should have been produced by a 22.1
// node that also sets RedactableLogs.
return errors.AssertionFailedf(
"recording has non-redactable span with the Message field set: %s", sp)
}
record.Message = record.Message.Redact()
}
}
Expand Down
1 change: 0 additions & 1 deletion pkg/server/node_tenant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ func TestRedactRecordingForTenant(t *testing.T) {
TagGroups []tracingpb.TagGroup
StartTime time.Time
Duration time.Duration
RedactableLogs bool
Logs []tracingpb.LogRecord
Verbose bool
RecordingMode tracingpb.RecordingMode
Expand Down
19 changes: 9 additions & 10 deletions pkg/util/tracing/crdbspan.go
Original file line number Diff line number Diff line change
Expand Up @@ -834,16 +834,15 @@ func (s *crdbSpan) getRecordingNoChildrenLocked(
recordingType tracingpb.RecordingType, finishing bool,
) tracingpb.RecordedSpan {
rs := tracingpb.RecordedSpan{
TraceID: s.traceID,
SpanID: s.spanID,
ParentSpanID: s.parentSpanID,
GoroutineID: s.mu.goroutineID,
Operation: s.operation,
StartTime: s.startTime,
Duration: s.mu.duration,
RedactableLogs: true,
Verbose: s.recordingType() == tracingpb.RecordingVerbose,
RecordingMode: s.recordingType().ToProto(),
TraceID: s.traceID,
SpanID: s.spanID,
ParentSpanID: s.parentSpanID,
GoroutineID: s.mu.goroutineID,
Operation: s.operation,
StartTime: s.startTime,
Duration: s.mu.duration,
Verbose: s.recordingType() == tracingpb.RecordingVerbose,
RecordingMode: s.recordingType().ToProto(),
}

if rs.Duration == -1 {
Expand Down
6 changes: 1 addition & 5 deletions pkg/util/tracing/tracingpb/recorded_span.proto
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@ message RecordedSpan {
google.protobuf.Duration duration = 8 [(gogoproto.nullable) = false,
(gogoproto.stdduration) = true];

// RedactableLogs determines whether the verbose log messages are redactable.
// This field was introduced in the 22.1 release. It can be removed in the 22.2
// release. On 22.1 this is always set to `true`.
bool redactable_logs = 15;
// Events logged in the span.
repeated LogRecord logs = 9 [(gogoproto.nullable) = false];
// verbose indicates whether the span was recording in verbose mode at the
Expand Down Expand Up @@ -141,7 +137,7 @@ message RecordedSpan {
// view of the various operations that are being traced as part of a span.
map<string, OperationMetadata> children_metadata = 19 [(gogoproto.nullable) = false];

reserved 5,10,11;
reserved 5,10,11,15;
}

message TagGroup {
Expand Down

0 comments on commit 221ac55

Please sign in to comment.