-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
recorded_span.proto
130 lines (116 loc) · 5.67 KB
/
recorded_span.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
// Copyright 2017 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0, included in the file
// licenses/APL.txt.
syntax = "proto3";
package cockroach.util.tracing.tracingpb;
option go_package = "tracingpb";
import "gogoproto/gogo.proto";
import "google/protobuf/any.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/duration.proto";
import "util/tracing/tracingpb/tracing.proto";
// LogRecord is a log message recorded in a traced span.
message LogRecord {
// Time of the log record.
google.protobuf.Timestamp time = 1 [(gogoproto.nullable) = false,
(gogoproto.stdtime) = true];
message Field {
string key = 1;
string value = 2 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/cockroachdb/redact.RedactableString"];
}
// Fields with values converted to strings. In 22.1, the `message` field
// contains the log message, and this field is only used for compatibility
// with 21.2 nodes.
repeated Field deprecated_fields = 2 [(gogoproto.nullable) = false];
// The log message.
string message = 3 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/cockroachdb/redact.RedactableString"];
}
// StructuredRecord is a structured message recorded in a traced span.
message StructuredRecord {
// Time of the structured record.
google.protobuf.Timestamp time = 1 [(gogoproto.nullable) = false,
(gogoproto.stdtime) = true];
google.protobuf.Any payload = 2;
}
// RecordedSpan is the data recorded by a trace span. It
// needs to be able to cross RPC boundaries so that the
// complete recording of the trace can be constructed.
message RecordedSpan {
option (gogoproto.goproto_stringer) = false;
// ID of the trace; spans that are part of the same hierarchy share
// the same trace ID.
uint64 trace_id = 1 [(gogoproto.nullable) = false, (gogoproto.customname) = "TraceID", (gogoproto.customtype) = "TraceID"];
// ID of the span.
uint64 span_id = 2 [(gogoproto.nullable) = false, (gogoproto.customname) = "SpanID", (gogoproto.customtype) = "SpanID"];
// ID of the parent span.
uint64 parent_span_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "ParentSpanID", (gogoproto.customtype) = "SpanID"];
// Operation name.
string operation = 4;
// Tags associated with the span.
map<string, string> tags = 6;
// Time when the span was started.
google.protobuf.Timestamp start_time = 7 [(gogoproto.nullable) = false,
(gogoproto.stdtime) = true];
// The span's duration, measured from start to Finish().
//
// A span whose recording is collected before it's finished will have the
// duration set as the "time of collection - start time". Such a span will
// have an "unfinished" tag and a `finished` boolean value of false in this
// recording.
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
// time the recording was produced.
//
// This field is deprecated; it can be removed in 23.1. Use recording_mode
// instead.
bool verbose = 16;
// recording_mode indicates the recording mode of the span at the the
// recording was produced.
RecordingMode recording_mode = 17;
// The ID of the goroutine on which the span was created.
uint64 goroutine_id = 12 [(gogoproto.customname) = "GoroutineID"];
// True if the span has been Finish()ed, false otherwise.
bool finished = 13;
// StructuredRecords contains StructuredRecord events recorded either in this
// span, or in children spans that have finished while our span was not
// recording verbosely.
//
// A StructuredRecord wraps the Payload with a RecordedAt timestamp to expose
// information about when this event occurred.
// DeprecatedInternalStructured only stores the Payloads.
repeated StructuredRecord structured_records = 14 [(gogoproto.nullable) = false];
// FinishedChildrenDurations is a mapping from the operation to the duration
// of all finished children of this span.
map<string, int64> finished_children_durations = 18 [(gogoproto.castvalue) = "time.Duration"];
reserved 5,10,11;
// Next ID: 19
}
// NormalizedSpan is a representation of a RecordedSpan from a trace with all
// its children embedded, recursively. This JSON serialization of this proto is
// used in the system.statement_diagnostics.trace column.
//
// See RecordedSpan for the description of the fields.
message NormalizedSpan {
string operation = 1;
map<string, string> tags = 2;
google.protobuf.Timestamp start_time = 3 [(gogoproto.nullable) = false,
(gogoproto.stdtime) = true];
google.protobuf.Duration duration = 4 [(gogoproto.nullable) = false,
(gogoproto.stdduration) = true];
repeated LogRecord logs = 5 [(gogoproto.nullable) = false];
repeated StructuredRecord structured_records = 7 [(gogoproto.nullable) = false];
repeated NormalizedSpan children = 6 [(gogoproto.nullable) = false];
}