1syntax = "proto3";
2package carbonapi_v3_pb;
3
4// Regenerate with protoc --gogofast_out=plugins=grpc:. carbonapi_v3_grpc.proto --proto_path=../vendor/ --proto_path=.
5import "github.com/gogo/protobuf/gogoproto/gogo.proto";
6
7message FilteringFunction {
8    string name = 1;
9    repeated string arguments = 2;
10}
11
12// Fetch Storage Capabilities
13message CapabilityRequest {
14}
15
16// Storage capability information
17message CapabilityResponse {
18    // carbonapi_v2_pb, carbonapi_v3_pb, etc.
19    repeated string supportedProtocols = 1;
20    // server name
21    string name = 2;
22    bool highPrecisionTimestamps = 3;
23    bool supportFilteringFunctions = 4;
24    // true if storage will behave normally if request is splitted by maxGlobs
25    bool likeSplittedRequests = 5;
26    bool supportStreaming = 6;
27}
28
29// Fetch Data
30message FetchRequest {
31    string name = 1;
32    int64 startTime = 2;
33    int64 stopTime = 3;
34    // Should be true if our request requires more precision than seconds.
35    bool highPrecisionTimestamps = 4;
36    string pathExpression = 5;
37    repeated FilteringFunction filterFunctions = 6;
38    int64 maxDataPoints = 7;
39}
40
41message MultiFetchRequest {
42    repeated FetchRequest metrics = 1 [(gogoproto.nullable) = false];
43}
44
45// Stop time can be computed by stepTime*len(values)
46message FetchResponse {
47    string name = 1;
48    string pathExpression = 2;
49    string consolidationFunc = 3;
50    int64 startTime = 4;
51    int64 stopTime = 5;
52    int64 stepTime = 6;
53    float xFilesFactor = 7;
54    // Should be true if timestamps have better precision than seconds.
55    bool highPrecisionTimestamps = 8;
56    repeated double values = 9;
57    repeated string appliedFunctions = 10;
58    int64 requestStartTime = 11;
59    int64 requestStopTime = 12;
60}
61
62message MultiFetchResponse {
63    repeated FetchResponse metrics = 1 [(gogoproto.nullable) = false];
64}
65
66// Find Metrics
67message MultiGlobRequest {
68    repeated string metrics = 1;
69    int64 startTime = 2;
70    int64 stopTime = 3;
71}
72
73message GlobMatch {
74    string path = 1;
75    bool isLeaf = 2;
76}
77
78// request name to metrics
79message GlobResponse {
80    string name = 1;
81    repeated GlobMatch matches = 2 [(gogoproto.nullable) = false];
82}
83
84message MultiGlobResponse {
85    repeated GlobResponse metrics = 1 [(gogoproto.nullable) = false];
86}
87
88// Information about metrics
89message MetricsInfoRequest {
90    string name = 1;
91}
92
93message MultiMetricsInfoRequest {
94    repeated string names = 1;
95}
96
97message Retention {
98    int64 secondsPerPoint = 1;
99    int64 numberOfPoints = 2;
100}
101
102message MetricsInfoResponse {
103    string name = 1;
104    string consolidationFunc = 2;
105    float xFilesFactor = 4;
106    int64 maxRetention = 3;
107    repeated Retention retentions = 5 [(gogoproto.nullable) = false];
108}
109
110message MultiMetricsInfoResponse {
111    repeated MetricsInfoResponse metrics = 1 [(gogoproto.nullable) = false];
112}
113
114// key = server, value = metric
115message ZipperInfoResponse {
116    map<string, MultiMetricsInfoResponse> info = 1 [(gogoproto.nullable) = false];
117}
118
119// List all metrics
120message ListMetricsResponse {
121    repeated string Metrics = 1;
122}
123
124// Get stats about metrics
125message MetricDetails {
126    int64 Size = 2;
127    int64 ModTime = 3;
128    int64 ATime = 4;
129    int64 RdTime = 5;
130        int64 RealSize = 6;
131
132}
133
134message MetricDetailsResponse {
135    map<string, MetricDetails> metrics = 1;
136    uint64 FreeSpace = 2;
137    uint64 TotalSpace = 3;
138}
139
140message MultiDetailsResponse {
141    map<string, MetricDetailsResponse> metrics = 1;
142}
143