summaryrefslogtreecommitdiffstats
path: root/fluent-bit/lib/cmetrics/include/prometheus_remote_write/remote.pb-c.h
blob: a816a4bbdeda3353142329812d90f79278ef9de5 (plain)
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
/* Generated by the protocol buffer compiler.  DO NOT EDIT! */
/* Generated from: remote.proto */

#ifndef PROTOBUF_C_remote_2eproto__INCLUDED
#define PROTOBUF_C_remote_2eproto__INCLUDED

#include <prometheus_remote_write/protobuf-c.h>

PROTOBUF_C__BEGIN_DECLS

#if PROTOBUF_C_VERSION_NUMBER < 1003000
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
#elif 1003003 < PROTOBUF_C_MIN_COMPILER_VERSION
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
#endif

#include "types.pb-c.h"
// #include "gogoproto/gogo.pb-c.h"

typedef struct _Prometheus__WriteRequest Prometheus__WriteRequest;
typedef struct _Prometheus__ReadRequest Prometheus__ReadRequest;
typedef struct _Prometheus__ReadResponse Prometheus__ReadResponse;
typedef struct _Prometheus__Query Prometheus__Query;
typedef struct _Prometheus__QueryResult Prometheus__QueryResult;
typedef struct _Prometheus__ChunkedReadResponse Prometheus__ChunkedReadResponse;


/* --- enums --- */

typedef enum _Prometheus__ReadRequest__ResponseType {
  /*
   * Server will return a single ReadResponse message with matched series that includes list of raw samples.
   * It's recommended to use streamed response types instead.
   * Response headers:
   * Content-Type: "application/x-protobuf"
   * Content-Encoding: "snappy"
   */
  PROMETHEUS__READ_REQUEST__RESPONSE_TYPE__SAMPLES = 0,
  /*
   * Server will stream a delimited ChunkedReadResponse message that contains XOR encoded chunks for a single series.
   * Each message is following varint size and fixed size bigendian uint32 for CRC32 Castagnoli checksum.
   * Response headers:
   * Content-Type: "application/x-streamed-protobuf; proto=prometheus.ChunkedReadResponse"
   * Content-Encoding: ""
   */
  PROMETHEUS__READ_REQUEST__RESPONSE_TYPE__STREAMED_XOR_CHUNKS = 1
    PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(PROMETHEUS__READ_REQUEST__RESPONSE_TYPE)
} Prometheus__ReadRequest__ResponseType;

/* --- messages --- */

struct  _Prometheus__WriteRequest
{
  ProtobufCMessage base;
  size_t n_timeseries;
  Prometheus__TimeSeries **timeseries;
  size_t n_metadata;
  Prometheus__MetricMetadata **metadata;
};
#define PROMETHEUS__WRITE_REQUEST__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&prometheus__write_request__descriptor) \
    , 0,NULL, 0,NULL }


/*
 * ReadRequest represents a remote read request.
 */
struct  _Prometheus__ReadRequest
{
  ProtobufCMessage base;
  size_t n_queries;
  Prometheus__Query **queries;
  /*
   * accepted_response_types allows negotiating the content type of the response.
   * Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is
   * implemented by server, error is returned.
   * For request that do not contain `accepted_response_types` field the SAMPLES response type will be used.
   */
  size_t n_accepted_response_types;
  Prometheus__ReadRequest__ResponseType *accepted_response_types;
};
#define PROMETHEUS__READ_REQUEST__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&prometheus__read_request__descriptor) \
    , 0,NULL, 0,NULL }


/*
 * ReadResponse is a response when response_type equals SAMPLES.
 */
struct  _Prometheus__ReadResponse
{
  ProtobufCMessage base;
  /*
   * In same order as the request's queries.
   */
  size_t n_results;
  Prometheus__QueryResult **results;
};
#define PROMETHEUS__READ_RESPONSE__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&prometheus__read_response__descriptor) \
    , 0,NULL }


struct  _Prometheus__Query
{
  ProtobufCMessage base;
  int64_t start_timestamp_ms;
  int64_t end_timestamp_ms;
  size_t n_matchers;
  Prometheus__LabelMatcher **matchers;
  Prometheus__ReadHints *hints;
};
#define PROMETHEUS__QUERY__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&prometheus__query__descriptor) \
    , 0, 0, 0,NULL, NULL }


struct  _Prometheus__QueryResult
{
  ProtobufCMessage base;
  /*
   * Samples within a time series must be ordered by time.
   */
  size_t n_timeseries;
  Prometheus__TimeSeries **timeseries;
};
#define PROMETHEUS__QUERY_RESULT__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&prometheus__query_result__descriptor) \
    , 0,NULL }


/*
 * ChunkedReadResponse is a response when response_type equals STREAMED_XOR_CHUNKS.
 * We strictly stream full series after series, optionally split by time. This means that a single frame can contain
 * partition of the single series, but once a new series is started to be streamed it means that no more chunks will
 * be sent for previous one. Series are returned sorted in the same way TSDB block are internally.
 */
struct  _Prometheus__ChunkedReadResponse
{
  ProtobufCMessage base;
  size_t n_chunked_series;
  Prometheus__ChunkedSeries **chunked_series;
  /*
   * query_index represents an index of the query from ReadRequest.queries these chunks relates to.
   */
  int64_t query_index;
};
#define PROMETHEUS__CHUNKED_READ_RESPONSE__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&prometheus__chunked_read_response__descriptor) \
    , 0,NULL, 0 }


/* Prometheus__WriteRequest methods */
void   prometheus__write_request__init
                     (Prometheus__WriteRequest         *message);
size_t prometheus__write_request__get_packed_size
                     (const Prometheus__WriteRequest   *message);
size_t prometheus__write_request__pack
                     (const Prometheus__WriteRequest   *message,
                      uint8_t             *out);
size_t prometheus__write_request__pack_to_buffer
                     (const Prometheus__WriteRequest   *message,
                      ProtobufCBuffer     *buffer);
Prometheus__WriteRequest *
       prometheus__write_request__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   prometheus__write_request__free_unpacked
                     (Prometheus__WriteRequest *message,
                      ProtobufCAllocator *allocator);
/* Prometheus__ReadRequest methods */
void   prometheus__read_request__init
                     (Prometheus__ReadRequest         *message);
size_t prometheus__read_request__get_packed_size
                     (const Prometheus__ReadRequest   *message);
size_t prometheus__read_request__pack
                     (const Prometheus__ReadRequest   *message,
                      uint8_t             *out);
size_t prometheus__read_request__pack_to_buffer
                     (const Prometheus__ReadRequest   *message,
                      ProtobufCBuffer     *buffer);
Prometheus__ReadRequest *
       prometheus__read_request__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   prometheus__read_request__free_unpacked
                     (Prometheus__ReadRequest *message,
                      ProtobufCAllocator *allocator);
/* Prometheus__ReadResponse methods */
void   prometheus__read_response__init
                     (Prometheus__ReadResponse         *message);
size_t prometheus__read_response__get_packed_size
                     (const Prometheus__ReadResponse   *message);
size_t prometheus__read_response__pack
                     (const Prometheus__ReadResponse   *message,
                      uint8_t             *out);
size_t prometheus__read_response__pack_to_buffer
                     (const Prometheus__ReadResponse   *message,
                      ProtobufCBuffer     *buffer);
Prometheus__ReadResponse *
       prometheus__read_response__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   prometheus__read_response__free_unpacked
                     (Prometheus__ReadResponse *message,
                      ProtobufCAllocator *allocator);
/* Prometheus__Query methods */
void   prometheus__query__init
                     (Prometheus__Query         *message);
size_t prometheus__query__get_packed_size
                     (const Prometheus__Query   *message);
size_t prometheus__query__pack
                     (const Prometheus__Query   *message,
                      uint8_t             *out);
size_t prometheus__query__pack_to_buffer
                     (const Prometheus__Query   *message,
                      ProtobufCBuffer     *buffer);
Prometheus__Query *
       prometheus__query__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   prometheus__query__free_unpacked
                     (Prometheus__Query *message,
                      ProtobufCAllocator *allocator);
/* Prometheus__QueryResult methods */
void   prometheus__query_result__init
                     (Prometheus__QueryResult         *message);
size_t prometheus__query_result__get_packed_size
                     (const Prometheus__QueryResult   *message);
size_t prometheus__query_result__pack
                     (const Prometheus__QueryResult   *message,
                      uint8_t             *out);
size_t prometheus__query_result__pack_to_buffer
                     (const Prometheus__QueryResult   *message,
                      ProtobufCBuffer     *buffer);
Prometheus__QueryResult *
       prometheus__query_result__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   prometheus__query_result__free_unpacked
                     (Prometheus__QueryResult *message,
                      ProtobufCAllocator *allocator);
/* Prometheus__ChunkedReadResponse methods */
void   prometheus__chunked_read_response__init
                     (Prometheus__ChunkedReadResponse         *message);
size_t prometheus__chunked_read_response__get_packed_size
                     (const Prometheus__ChunkedReadResponse   *message);
size_t prometheus__chunked_read_response__pack
                     (const Prometheus__ChunkedReadResponse   *message,
                      uint8_t             *out);
size_t prometheus__chunked_read_response__pack_to_buffer
                     (const Prometheus__ChunkedReadResponse   *message,
                      ProtobufCBuffer     *buffer);
Prometheus__ChunkedReadResponse *
       prometheus__chunked_read_response__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   prometheus__chunked_read_response__free_unpacked
                     (Prometheus__ChunkedReadResponse *message,
                      ProtobufCAllocator *allocator);
/* --- per-message closures --- */

typedef void (*Prometheus__WriteRequest_Closure)
                 (const Prometheus__WriteRequest *message,
                  void *closure_data);
typedef void (*Prometheus__ReadRequest_Closure)
                 (const Prometheus__ReadRequest *message,
                  void *closure_data);
typedef void (*Prometheus__ReadResponse_Closure)
                 (const Prometheus__ReadResponse *message,
                  void *closure_data);
typedef void (*Prometheus__Query_Closure)
                 (const Prometheus__Query *message,
                  void *closure_data);
typedef void (*Prometheus__QueryResult_Closure)
                 (const Prometheus__QueryResult *message,
                  void *closure_data);
typedef void (*Prometheus__ChunkedReadResponse_Closure)
                 (const Prometheus__ChunkedReadResponse *message,
                  void *closure_data);

/* --- services --- */


/* --- descriptors --- */

extern const ProtobufCMessageDescriptor prometheus__write_request__descriptor;
extern const ProtobufCMessageDescriptor prometheus__read_request__descriptor;
extern const ProtobufCEnumDescriptor    prometheus__read_request__response_type__descriptor;
extern const ProtobufCMessageDescriptor prometheus__read_response__descriptor;
extern const ProtobufCMessageDescriptor prometheus__query__descriptor;
extern const ProtobufCMessageDescriptor prometheus__query_result__descriptor;
extern const ProtobufCMessageDescriptor prometheus__chunked_read_response__descriptor;

PROTOBUF_C__END_DECLS


#endif  /* PROTOBUF_C_remote_2eproto__INCLUDED */