File: tracepb.proto

package info (click to toggle)
golang-github-pingcap-kvproto 6.1.0~alpha-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,040 kB
  • sloc: sh: 111; makefile: 34
file content (60 lines) | stat: -rw-r--r-- 1,673 bytes parent folder | download
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
syntax = "proto3";
package tracepb;

option java_package = "org.tikv.kvproto";

service TraceRecordPubSub {
    // Subscribe the Trace records generated on this service. The service will periodically (e.g. per minute)
    // publishes Trace records to clients via gRPC stream.
    rpc Subscribe(TraceRecordRequest) returns (stream TraceRecord) {}
}

message TraceRecordRequest {}

message TraceRecord {
    oneof record_oneof {
        Report report = 1;
        NotifyCollect notify_collect = 2;
    }
}

message RemoteParentSpan {
    // A unique id to identify the request. It's usually a UUID.
    uint64 trace_id = 1;
    // The span of remote caller that is awaiting the request.
    uint64 span_id = 2;
}

// The context of the request to be traced.
message TraceContext {
    repeated RemoteParentSpan remote_parent_spans = 1;
    // Report the trace records only if the duration of handling the request exceeds the threshold.
    uint32 duration_threshold_ms = 2;
}

// Report the spans collected when handling a request on a service.
message Report {
    repeated RemoteParentSpan remote_parent_spans = 1;
    repeated Span spans = 2;
}

// Notify the subscriber to persis the spans of the trace.
message NotifyCollect {
    uint64 trace_id = 1;
}

message Span {
    // The unique span id within the spans with the same `trace_id`.
    // The most significant 32 bits should be random number generated by each service instance.
    uint64 span_id = 1;
    uint64 parent_id = 2;
    uint64 begin_unix_ns = 3;
    uint64 duration_ns = 4;
    string event = 5;
    repeated Property properties = 6;
}

message Property {
    string key = 1;
    string value = 2;
}