-
Notifications
You must be signed in to change notification settings - Fork 16
/
statshouse.proto
41 lines (35 loc) · 1.34 KB
/
statshouse.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
syntax = "proto3";
package statshouse;
option go_package = "github.com/vkcom/statshouse/internal/receiver/pb";
message Metric {
string name = 1;
map<string, string> tags = 2;
double counter = 3;
uint32 ts = 4; // UNIX seconds UTC
repeated double value = 5;
repeated int64 unique = 6;
}
message MetricBatch {
repeated Metric metrics = 13337; // to autodetect packet format by first bytes
}
// to compile
// sudo apt-get install libprotobuf-dev
// go install google.golang.org/protobuf/cmd/protoc-gen-go
// ~/go/src/github.com/vkcom/statshouse$ protoc -I=internal/receiver --go_out=../../../../.. statshouse.proto
// to compile if proto3 format not supported, for example by protocute
// 1. comment out line: option go_package = "github.com/vkcom/statshouse/internal/receiver/pb";
// 2. add
// message MapFieldEntry {
// optional string key = 1;
// optional string value = 2;
// }
// 3. replace Metric with
// message Metric {
// string name = 1;
// map<string, string> tags = 2;
// double counter = 3;
// uint32 ts = 4; // UNIX seconds UTC
// repeated double value = 5;
// repeated int64 unique = 6;
// }
// 4. ./protocute --cpp_out=. ~/go/src/github.com/vkcom/statshouse/internal/receiver/statshouse.proto