File: collector.proto

package info (click to toggle)
golang-github-lightstep-lightstep-tracer-common 1.1.0%2Bgit20210210.a8dfcb8-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 428 kB
  • sloc: makefile: 68
file content (116 lines) | stat: -rw-r--r-- 2,838 bytes parent folder | download | duplicates (3)
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
syntax = "proto3";

package lightstep.collector;

option go_package = "collectorpb";
option objc_class_prefix = "LSPB";
option java_multiple_files = true;
option java_package = "com.lightstep.tracer.grpc";

import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";

message SpanContext {
    uint64 trace_id = 1 [jstype=JS_STRING];
    uint64 span_id = 2 [jstype=JS_STRING];
    map<string, string> baggage = 3;
}

// Represent both tags and log fields.
message KeyValue {
    string key = 1;
    oneof value {
        // Holds arbitrary string data; well-formed JSON strings should go in
        // json_value.
        string string_value = 2;
        int64 int_value = 3 [jstype=JS_STRING];
        double double_value = 4;
        bool bool_value = 5;
        // Must be a well-formed JSON value. Truncated JSON should go in
        // string_value. Should not be used for tags.
        string json_value = 6;
    }
}

message Log {
    google.protobuf.Timestamp timestamp = 1;
    repeated KeyValue fields = 2;
}

message Reference {
    enum Relationship {
        CHILD_OF = 0;
        FOLLOWS_FROM = 1;
    }
    Relationship relationship = 1;
    SpanContext span_context = 2;
}

message Span {
    SpanContext span_context = 1;
    string operation_name = 2;
    repeated Reference references = 3;
    google.protobuf.Timestamp start_timestamp = 4;
    uint64 duration_micros = 5 [jstype=JS_STRING];
    repeated KeyValue tags = 6;
    repeated Log logs = 7;
}

message Reporter {
    uint64 reporter_id = 1 [jstype=JS_STRING];
    repeated KeyValue tags = 4;
}

message MetricsSample {
    string name = 1;
    oneof value {
        int64 int_value = 2 [jstype=JS_STRING];
        double double_value = 3;
    }
}

message InternalMetrics {
    google.protobuf.Timestamp start_timestamp = 1;
    uint64 duration_micros = 2 [jstype=JS_STRING];
    repeated Log logs = 3;
    repeated MetricsSample counts = 4;
    repeated MetricsSample gauges = 5;
}

message Auth {
    string access_token = 1;
}

message ReportRequest {
    Reporter reporter = 1;
    Auth auth = 2;
    repeated Span spans = 3;
    int64 timestamp_offset_micros = 5 [jstype=JS_STRING];
    InternalMetrics internal_metrics = 6;
}

message Command {
    bool disable = 1;
    bool dev_mode = 2;
}

message ReportResponse {
    repeated Command commands = 1;
    google.protobuf.Timestamp receive_timestamp = 2;
    google.protobuf.Timestamp transmit_timestamp = 3;
    repeated string errors = 4;
    repeated string warnings = 5;
    repeated string infos = 6;
}

service CollectorService {
    rpc Report(ReportRequest) returns (ReportResponse) {
       option (google.api.http) = {
          post: "/api/v2/reports"
          body: "*"
          additional_bindings {
             get: "/api/v2/reports"
          }
       };
    }
}