@miradorlabs/web-grpc 1.3.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,6 @@ import type { Metadata } from "@grpc/grpc-js";
10
10
  import { Observable } from "rxjs";
11
11
  import { map } from "rxjs/operators";
12
12
  import { Timestamp } from "../../../../google/protobuf/timestamp";
13
- import { ResponseStatus } from "../../common/v1/status";
14
13
  import {
15
14
  AnalyticsTimeInterval,
16
15
  analyticsTimeIntervalFromJSON,
@@ -67,107 +66,189 @@ export function metricKindToJSON(object: MetricKind): string {
67
66
  }
68
67
  }
69
68
 
70
- export enum MetricAggregation {
71
- METRIC_AGGREGATION_UNSPECIFIED = 0,
72
- METRIC_AGGREGATION_SUM = 1,
73
- METRIC_AGGREGATION_AVG = 2,
74
- METRIC_AGGREGATION_MIN = 3,
75
- METRIC_AGGREGATION_MAX = 4,
76
- METRIC_AGGREGATION_COUNT = 5,
77
- METRIC_AGGREGATION_LAST = 6,
78
- METRIC_AGGREGATION_RATE = 7,
79
- METRIC_AGGREGATION_P50 = 8,
80
- METRIC_AGGREGATION_P90 = 9,
81
- METRIC_AGGREGATION_P95 = 10,
82
- METRIC_AGGREGATION_P99 = 11,
69
+ export enum GaugeAggregation {
70
+ GAUGE_AGGREGATION_UNSPECIFIED = 0,
71
+ GAUGE_AGGREGATION_LAST = 1,
72
+ GAUGE_AGGREGATION_AVG = 2,
73
+ GAUGE_AGGREGATION_MIN = 3,
74
+ GAUGE_AGGREGATION_MAX = 4,
75
+ GAUGE_AGGREGATION_SUM = 5,
76
+ GAUGE_AGGREGATION_COUNT = 6,
83
77
  UNRECOGNIZED = -1,
84
78
  }
85
79
 
86
- export function metricAggregationFromJSON(object: any): MetricAggregation {
80
+ export function gaugeAggregationFromJSON(object: any): GaugeAggregation {
87
81
  switch (object) {
88
82
  case 0:
89
- case "METRIC_AGGREGATION_UNSPECIFIED":
90
- return MetricAggregation.METRIC_AGGREGATION_UNSPECIFIED;
83
+ case "GAUGE_AGGREGATION_UNSPECIFIED":
84
+ return GaugeAggregation.GAUGE_AGGREGATION_UNSPECIFIED;
91
85
  case 1:
92
- case "METRIC_AGGREGATION_SUM":
93
- return MetricAggregation.METRIC_AGGREGATION_SUM;
86
+ case "GAUGE_AGGREGATION_LAST":
87
+ return GaugeAggregation.GAUGE_AGGREGATION_LAST;
94
88
  case 2:
95
- case "METRIC_AGGREGATION_AVG":
96
- return MetricAggregation.METRIC_AGGREGATION_AVG;
89
+ case "GAUGE_AGGREGATION_AVG":
90
+ return GaugeAggregation.GAUGE_AGGREGATION_AVG;
97
91
  case 3:
98
- case "METRIC_AGGREGATION_MIN":
99
- return MetricAggregation.METRIC_AGGREGATION_MIN;
92
+ case "GAUGE_AGGREGATION_MIN":
93
+ return GaugeAggregation.GAUGE_AGGREGATION_MIN;
100
94
  case 4:
101
- case "METRIC_AGGREGATION_MAX":
102
- return MetricAggregation.METRIC_AGGREGATION_MAX;
95
+ case "GAUGE_AGGREGATION_MAX":
96
+ return GaugeAggregation.GAUGE_AGGREGATION_MAX;
103
97
  case 5:
104
- case "METRIC_AGGREGATION_COUNT":
105
- return MetricAggregation.METRIC_AGGREGATION_COUNT;
98
+ case "GAUGE_AGGREGATION_SUM":
99
+ return GaugeAggregation.GAUGE_AGGREGATION_SUM;
106
100
  case 6:
107
- case "METRIC_AGGREGATION_LAST":
108
- return MetricAggregation.METRIC_AGGREGATION_LAST;
109
- case 7:
110
- case "METRIC_AGGREGATION_RATE":
111
- return MetricAggregation.METRIC_AGGREGATION_RATE;
112
- case 8:
113
- case "METRIC_AGGREGATION_P50":
114
- return MetricAggregation.METRIC_AGGREGATION_P50;
115
- case 9:
116
- case "METRIC_AGGREGATION_P90":
117
- return MetricAggregation.METRIC_AGGREGATION_P90;
118
- case 10:
119
- case "METRIC_AGGREGATION_P95":
120
- return MetricAggregation.METRIC_AGGREGATION_P95;
121
- case 11:
122
- case "METRIC_AGGREGATION_P99":
123
- return MetricAggregation.METRIC_AGGREGATION_P99;
101
+ case "GAUGE_AGGREGATION_COUNT":
102
+ return GaugeAggregation.GAUGE_AGGREGATION_COUNT;
124
103
  case -1:
125
104
  case "UNRECOGNIZED":
126
105
  default:
127
- return MetricAggregation.UNRECOGNIZED;
106
+ return GaugeAggregation.UNRECOGNIZED;
128
107
  }
129
108
  }
130
109
 
131
- export function metricAggregationToJSON(object: MetricAggregation): string {
110
+ export function gaugeAggregationToJSON(object: GaugeAggregation): string {
132
111
  switch (object) {
133
- case MetricAggregation.METRIC_AGGREGATION_UNSPECIFIED:
134
- return "METRIC_AGGREGATION_UNSPECIFIED";
135
- case MetricAggregation.METRIC_AGGREGATION_SUM:
136
- return "METRIC_AGGREGATION_SUM";
137
- case MetricAggregation.METRIC_AGGREGATION_AVG:
138
- return "METRIC_AGGREGATION_AVG";
139
- case MetricAggregation.METRIC_AGGREGATION_MIN:
140
- return "METRIC_AGGREGATION_MIN";
141
- case MetricAggregation.METRIC_AGGREGATION_MAX:
142
- return "METRIC_AGGREGATION_MAX";
143
- case MetricAggregation.METRIC_AGGREGATION_COUNT:
144
- return "METRIC_AGGREGATION_COUNT";
145
- case MetricAggregation.METRIC_AGGREGATION_LAST:
146
- return "METRIC_AGGREGATION_LAST";
147
- case MetricAggregation.METRIC_AGGREGATION_RATE:
148
- return "METRIC_AGGREGATION_RATE";
149
- case MetricAggregation.METRIC_AGGREGATION_P50:
150
- return "METRIC_AGGREGATION_P50";
151
- case MetricAggregation.METRIC_AGGREGATION_P90:
152
- return "METRIC_AGGREGATION_P90";
153
- case MetricAggregation.METRIC_AGGREGATION_P95:
154
- return "METRIC_AGGREGATION_P95";
155
- case MetricAggregation.METRIC_AGGREGATION_P99:
156
- return "METRIC_AGGREGATION_P99";
157
- case MetricAggregation.UNRECOGNIZED:
112
+ case GaugeAggregation.GAUGE_AGGREGATION_UNSPECIFIED:
113
+ return "GAUGE_AGGREGATION_UNSPECIFIED";
114
+ case GaugeAggregation.GAUGE_AGGREGATION_LAST:
115
+ return "GAUGE_AGGREGATION_LAST";
116
+ case GaugeAggregation.GAUGE_AGGREGATION_AVG:
117
+ return "GAUGE_AGGREGATION_AVG";
118
+ case GaugeAggregation.GAUGE_AGGREGATION_MIN:
119
+ return "GAUGE_AGGREGATION_MIN";
120
+ case GaugeAggregation.GAUGE_AGGREGATION_MAX:
121
+ return "GAUGE_AGGREGATION_MAX";
122
+ case GaugeAggregation.GAUGE_AGGREGATION_SUM:
123
+ return "GAUGE_AGGREGATION_SUM";
124
+ case GaugeAggregation.GAUGE_AGGREGATION_COUNT:
125
+ return "GAUGE_AGGREGATION_COUNT";
126
+ case GaugeAggregation.UNRECOGNIZED:
158
127
  default:
159
128
  return "UNRECOGNIZED";
160
129
  }
161
130
  }
162
131
 
163
- export interface ListMetricsRequest {
164
- projectId: string;
132
+ export enum SumAggregation {
133
+ SUM_AGGREGATION_UNSPECIFIED = 0,
134
+ SUM_AGGREGATION_RATE = 1,
135
+ SUM_AGGREGATION_INCREASE = 2,
136
+ SUM_AGGREGATION_LAST = 3,
137
+ SUM_AGGREGATION_COUNT = 4,
138
+ UNRECOGNIZED = -1,
139
+ }
140
+
141
+ export function sumAggregationFromJSON(object: any): SumAggregation {
142
+ switch (object) {
143
+ case 0:
144
+ case "SUM_AGGREGATION_UNSPECIFIED":
145
+ return SumAggregation.SUM_AGGREGATION_UNSPECIFIED;
146
+ case 1:
147
+ case "SUM_AGGREGATION_RATE":
148
+ return SumAggregation.SUM_AGGREGATION_RATE;
149
+ case 2:
150
+ case "SUM_AGGREGATION_INCREASE":
151
+ return SumAggregation.SUM_AGGREGATION_INCREASE;
152
+ case 3:
153
+ case "SUM_AGGREGATION_LAST":
154
+ return SumAggregation.SUM_AGGREGATION_LAST;
155
+ case 4:
156
+ case "SUM_AGGREGATION_COUNT":
157
+ return SumAggregation.SUM_AGGREGATION_COUNT;
158
+ case -1:
159
+ case "UNRECOGNIZED":
160
+ default:
161
+ return SumAggregation.UNRECOGNIZED;
162
+ }
163
+ }
164
+
165
+ export function sumAggregationToJSON(object: SumAggregation): string {
166
+ switch (object) {
167
+ case SumAggregation.SUM_AGGREGATION_UNSPECIFIED:
168
+ return "SUM_AGGREGATION_UNSPECIFIED";
169
+ case SumAggregation.SUM_AGGREGATION_RATE:
170
+ return "SUM_AGGREGATION_RATE";
171
+ case SumAggregation.SUM_AGGREGATION_INCREASE:
172
+ return "SUM_AGGREGATION_INCREASE";
173
+ case SumAggregation.SUM_AGGREGATION_LAST:
174
+ return "SUM_AGGREGATION_LAST";
175
+ case SumAggregation.SUM_AGGREGATION_COUNT:
176
+ return "SUM_AGGREGATION_COUNT";
177
+ case SumAggregation.UNRECOGNIZED:
178
+ default:
179
+ return "UNRECOGNIZED";
180
+ }
181
+ }
182
+
183
+ export enum HistogramAggregation {
184
+ HISTOGRAM_AGGREGATION_UNSPECIFIED = 0,
185
+ HISTOGRAM_AGGREGATION_QUANTILE = 1,
186
+ HISTOGRAM_AGGREGATION_AVG = 2,
187
+ HISTOGRAM_AGGREGATION_MIN = 3,
188
+ HISTOGRAM_AGGREGATION_MAX = 4,
189
+ HISTOGRAM_AGGREGATION_COUNT = 5,
190
+ UNRECOGNIZED = -1,
191
+ }
192
+
193
+ export function histogramAggregationFromJSON(object: any): HistogramAggregation {
194
+ switch (object) {
195
+ case 0:
196
+ case "HISTOGRAM_AGGREGATION_UNSPECIFIED":
197
+ return HistogramAggregation.HISTOGRAM_AGGREGATION_UNSPECIFIED;
198
+ case 1:
199
+ case "HISTOGRAM_AGGREGATION_QUANTILE":
200
+ return HistogramAggregation.HISTOGRAM_AGGREGATION_QUANTILE;
201
+ case 2:
202
+ case "HISTOGRAM_AGGREGATION_AVG":
203
+ return HistogramAggregation.HISTOGRAM_AGGREGATION_AVG;
204
+ case 3:
205
+ case "HISTOGRAM_AGGREGATION_MIN":
206
+ return HistogramAggregation.HISTOGRAM_AGGREGATION_MIN;
207
+ case 4:
208
+ case "HISTOGRAM_AGGREGATION_MAX":
209
+ return HistogramAggregation.HISTOGRAM_AGGREGATION_MAX;
210
+ case 5:
211
+ case "HISTOGRAM_AGGREGATION_COUNT":
212
+ return HistogramAggregation.HISTOGRAM_AGGREGATION_COUNT;
213
+ case -1:
214
+ case "UNRECOGNIZED":
215
+ default:
216
+ return HistogramAggregation.UNRECOGNIZED;
217
+ }
218
+ }
219
+
220
+ export function histogramAggregationToJSON(object: HistogramAggregation): string {
221
+ switch (object) {
222
+ case HistogramAggregation.HISTOGRAM_AGGREGATION_UNSPECIFIED:
223
+ return "HISTOGRAM_AGGREGATION_UNSPECIFIED";
224
+ case HistogramAggregation.HISTOGRAM_AGGREGATION_QUANTILE:
225
+ return "HISTOGRAM_AGGREGATION_QUANTILE";
226
+ case HistogramAggregation.HISTOGRAM_AGGREGATION_AVG:
227
+ return "HISTOGRAM_AGGREGATION_AVG";
228
+ case HistogramAggregation.HISTOGRAM_AGGREGATION_MIN:
229
+ return "HISTOGRAM_AGGREGATION_MIN";
230
+ case HistogramAggregation.HISTOGRAM_AGGREGATION_MAX:
231
+ return "HISTOGRAM_AGGREGATION_MAX";
232
+ case HistogramAggregation.HISTOGRAM_AGGREGATION_COUNT:
233
+ return "HISTOGRAM_AGGREGATION_COUNT";
234
+ case HistogramAggregation.UNRECOGNIZED:
235
+ default:
236
+ return "UNRECOGNIZED";
237
+ }
238
+ }
239
+
240
+ export interface StreamMetricsRequest {
165
241
  /** Stamped by the gateway from the verified identity — never client-supplied. */
166
242
  organizationId: string;
243
+ projectId: string;
244
+ }
245
+
246
+ export interface MetricCatalogEnvelope {
247
+ snapshot?: MetricCatalogSnapshot | undefined;
248
+ added?: MetricInfo | undefined;
167
249
  }
168
250
 
169
- export interface ListMetricsResponse {
170
- status: ResponseStatus | undefined;
251
+ export interface MetricCatalogSnapshot {
171
252
  metrics: MetricInfo[];
172
253
  }
173
254
 
@@ -177,15 +258,19 @@ export interface MetricInfo {
177
258
  kind: MetricKind;
178
259
  }
179
260
 
180
- export interface ListMetricAttributesRequest {
181
- projectId: string;
182
- metricName: string;
261
+ export interface StreamMetricAttributesRequest {
183
262
  /** Stamped by the gateway from the verified identity — never client-supplied. */
184
263
  organizationId: string;
264
+ projectId: string;
265
+ metricName: string;
266
+ }
267
+
268
+ export interface MetricAttributeEnvelope {
269
+ snapshot?: MetricAttributeSnapshot | undefined;
270
+ added?: MetricAttribute | undefined;
185
271
  }
186
272
 
187
- export interface ListMetricAttributesResponse {
188
- status: ResponseStatus | undefined;
273
+ export interface MetricAttributeSnapshot {
189
274
  attributes: MetricAttribute[];
190
275
  }
191
276
 
@@ -194,43 +279,36 @@ export interface MetricAttribute {
194
279
  values: string[];
195
280
  }
196
281
 
197
- export interface MetricQuery {
282
+ export interface GaugeQueryRequest {
283
+ /** Stamped by the gateway from the verified identity — never client-supplied. */
284
+ organizationId: string;
198
285
  projectId: string;
199
286
  metricName: string;
200
- filter:
201
- | MetricFilter
202
- | undefined;
203
- /** Group keys: "service.name" or datapoint attribute keys; at most 2. */
204
- groupBy: string[];
205
- aggregation: MetricAggregation;
206
- /** Must satisfy: 10 <= (time_window / time_interval) <= 600 */
287
+ aggregation: GaugeAggregation;
207
288
  timeWindow: AnalyticsTimeWindow;
208
289
  timeInterval: AnalyticsTimeInterval;
209
- /** Stamped by the gateway from the verified identity — never client-supplied. */
210
- organizationId: string;
211
- }
212
-
213
- export interface MetricFilter {
214
- serviceNames: string[];
215
- attributeEquals: { [key: string]: string };
216
290
  }
217
291
 
218
- export interface MetricFilter_AttributeEqualsEntry {
219
- key: string;
220
- value: string;
221
- }
222
-
223
- export interface QueryMetricsRequest {
224
- query: MetricQuery | undefined;
225
- }
226
-
227
- export interface QueryMetricsResponse {
228
- status: ResponseStatus | undefined;
229
- snapshot: MetricAnalyticsSnapshot | undefined;
292
+ export interface SumQueryRequest {
293
+ /** Stamped by the gateway from the verified identity — never client-supplied. */
294
+ organizationId: string;
295
+ projectId: string;
296
+ metricName: string;
297
+ aggregation: SumAggregation;
298
+ timeWindow: AnalyticsTimeWindow;
299
+ timeInterval: AnalyticsTimeInterval;
230
300
  }
231
301
 
232
- export interface StreamMetricAnalyticsRequest {
233
- query: MetricQuery | undefined;
302
+ export interface HistogramQueryRequest {
303
+ /** Stamped by the gateway from the verified identity — never client-supplied. */
304
+ organizationId: string;
305
+ projectId: string;
306
+ metricName: string;
307
+ aggregation: HistogramAggregation;
308
+ /** Quantile level in (0,1); required iff aggregation == QUANTILE. */
309
+ quantile: number;
310
+ timeWindow: AnalyticsTimeWindow;
311
+ timeInterval: AnalyticsTimeInterval;
234
312
  }
235
313
 
236
314
  export interface MetricAnalyticsEnvelope {
@@ -248,50 +326,38 @@ export interface MetricAnalyticsSnapshot {
248
326
  }
249
327
 
250
328
  export interface MetricSeries {
251
- groupKey: { [key: string]: string };
252
329
  buckets: MetricBucket[];
253
330
  }
254
331
 
255
- export interface MetricSeries_GroupKeyEntry {
256
- key: string;
257
- value: string;
258
- }
259
-
260
332
  export interface MetricBucket {
261
333
  bucketStart: Date | undefined;
262
334
  value: number;
263
335
  }
264
336
 
265
337
  export interface MetricSeriesBucketUpdate {
266
- groupKey: { [key: string]: string };
267
338
  bucket: MetricBucket | undefined;
268
339
  generatedAt: Date | undefined;
269
340
  }
270
341
 
271
- export interface MetricSeriesBucketUpdate_GroupKeyEntry {
272
- key: string;
273
- value: string;
274
- }
275
-
276
- function createBaseListMetricsRequest(): ListMetricsRequest {
277
- return { projectId: "", organizationId: "" };
342
+ function createBaseStreamMetricsRequest(): StreamMetricsRequest {
343
+ return { organizationId: "", projectId: "" };
278
344
  }
279
345
 
280
- export const ListMetricsRequest: MessageFns<ListMetricsRequest> = {
281
- encode(message: ListMetricsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
282
- if (message.projectId !== "") {
283
- writer.uint32(10).string(message.projectId);
284
- }
346
+ export const StreamMetricsRequest: MessageFns<StreamMetricsRequest> = {
347
+ encode(message: StreamMetricsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
285
348
  if (message.organizationId !== "") {
286
- writer.uint32(18).string(message.organizationId);
349
+ writer.uint32(10).string(message.organizationId);
350
+ }
351
+ if (message.projectId !== "") {
352
+ writer.uint32(18).string(message.projectId);
287
353
  }
288
354
  return writer;
289
355
  },
290
356
 
291
- decode(input: BinaryReader | Uint8Array, length?: number): ListMetricsRequest {
357
+ decode(input: BinaryReader | Uint8Array, length?: number): StreamMetricsRequest {
292
358
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
293
359
  const end = length === undefined ? reader.len : reader.pos + length;
294
- const message = createBaseListMetricsRequest();
360
+ const message = createBaseStreamMetricsRequest();
295
361
  while (reader.pos < end) {
296
362
  const tag = reader.uint32();
297
363
  switch (tag >>> 3) {
@@ -300,7 +366,7 @@ export const ListMetricsRequest: MessageFns<ListMetricsRequest> = {
300
366
  break;
301
367
  }
302
368
 
303
- message.projectId = reader.string();
369
+ message.organizationId = reader.string();
304
370
  continue;
305
371
  }
306
372
  case 2: {
@@ -308,7 +374,7 @@ export const ListMetricsRequest: MessageFns<ListMetricsRequest> = {
308
374
  break;
309
375
  }
310
376
 
311
- message.organizationId = reader.string();
377
+ message.projectId = reader.string();
312
378
  continue;
313
379
  }
314
380
  }
@@ -320,62 +386,62 @@ export const ListMetricsRequest: MessageFns<ListMetricsRequest> = {
320
386
  return message;
321
387
  },
322
388
 
323
- fromJSON(object: any): ListMetricsRequest {
389
+ fromJSON(object: any): StreamMetricsRequest {
324
390
  return {
325
- projectId: isSet(object.projectId)
326
- ? globalThis.String(object.projectId)
327
- : isSet(object.project_id)
328
- ? globalThis.String(object.project_id)
329
- : "",
330
391
  organizationId: isSet(object.organizationId)
331
392
  ? globalThis.String(object.organizationId)
332
393
  : isSet(object.organization_id)
333
394
  ? globalThis.String(object.organization_id)
334
395
  : "",
396
+ projectId: isSet(object.projectId)
397
+ ? globalThis.String(object.projectId)
398
+ : isSet(object.project_id)
399
+ ? globalThis.String(object.project_id)
400
+ : "",
335
401
  };
336
402
  },
337
403
 
338
- toJSON(message: ListMetricsRequest): unknown {
404
+ toJSON(message: StreamMetricsRequest): unknown {
339
405
  const obj: any = {};
340
- if (message.projectId !== "") {
341
- obj.projectId = message.projectId;
342
- }
343
406
  if (message.organizationId !== "") {
344
407
  obj.organizationId = message.organizationId;
345
408
  }
409
+ if (message.projectId !== "") {
410
+ obj.projectId = message.projectId;
411
+ }
346
412
  return obj;
347
413
  },
348
414
 
349
- create<I extends Exact<DeepPartial<ListMetricsRequest>, I>>(base?: I): ListMetricsRequest {
350
- return ListMetricsRequest.fromPartial(base ?? ({} as any));
415
+ create<I extends Exact<DeepPartial<StreamMetricsRequest>, I>>(base?: I): StreamMetricsRequest {
416
+ return StreamMetricsRequest.fromPartial(base ?? ({} as any));
351
417
  },
352
- fromPartial<I extends Exact<DeepPartial<ListMetricsRequest>, I>>(object: I): ListMetricsRequest {
353
- const message = createBaseListMetricsRequest();
354
- message.projectId = object.projectId ?? "";
418
+ fromPartial<I extends Exact<DeepPartial<StreamMetricsRequest>, I>>(object: I): StreamMetricsRequest {
419
+ const message = createBaseStreamMetricsRequest();
355
420
  message.organizationId = object.organizationId ?? "";
421
+ message.projectId = object.projectId ?? "";
356
422
  return message;
357
423
  },
358
424
  };
359
425
 
360
- function createBaseListMetricsResponse(): ListMetricsResponse {
361
- return { status: undefined, metrics: [] };
426
+ function createBaseMetricCatalogEnvelope(): MetricCatalogEnvelope {
427
+ return { snapshot: undefined, added: undefined };
362
428
  }
363
429
 
364
- export const ListMetricsResponse: MessageFns<ListMetricsResponse> = {
365
- encode(message: ListMetricsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
366
- if (message.status !== undefined) {
367
- ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
430
+ export const MetricCatalogEnvelope: MessageFns<MetricCatalogEnvelope> = {
431
+ encode(message: MetricCatalogEnvelope, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
432
+ if (message.snapshot !== undefined) {
433
+ MetricCatalogSnapshot.encode(message.snapshot, writer.uint32(10).fork()).join();
368
434
  }
369
- for (const v of message.metrics) {
370
- MetricInfo.encode(v!, writer.uint32(18).fork()).join();
435
+ if (message.added !== undefined) {
436
+ MetricInfo.encode(message.added, writer.uint32(18).fork()).join();
371
437
  }
372
438
  return writer;
373
439
  },
374
440
 
375
- decode(input: BinaryReader | Uint8Array, length?: number): ListMetricsResponse {
441
+ decode(input: BinaryReader | Uint8Array, length?: number): MetricCatalogEnvelope {
376
442
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
377
443
  const end = length === undefined ? reader.len : reader.pos + length;
378
- const message = createBaseListMetricsResponse();
444
+ const message = createBaseMetricCatalogEnvelope();
379
445
  while (reader.pos < end) {
380
446
  const tag = reader.uint32();
381
447
  switch (tag >>> 3) {
@@ -384,7 +450,7 @@ export const ListMetricsResponse: MessageFns<ListMetricsResponse> = {
384
450
  break;
385
451
  }
386
452
 
387
- message.status = ResponseStatus.decode(reader, reader.uint32());
453
+ message.snapshot = MetricCatalogSnapshot.decode(reader, reader.uint32());
388
454
  continue;
389
455
  }
390
456
  case 2: {
@@ -392,6 +458,75 @@ export const ListMetricsResponse: MessageFns<ListMetricsResponse> = {
392
458
  break;
393
459
  }
394
460
 
461
+ message.added = MetricInfo.decode(reader, reader.uint32());
462
+ continue;
463
+ }
464
+ }
465
+ if ((tag & 7) === 4 || tag === 0) {
466
+ break;
467
+ }
468
+ reader.skip(tag & 7);
469
+ }
470
+ return message;
471
+ },
472
+
473
+ fromJSON(object: any): MetricCatalogEnvelope {
474
+ return {
475
+ snapshot: isSet(object.snapshot) ? MetricCatalogSnapshot.fromJSON(object.snapshot) : undefined,
476
+ added: isSet(object.added) ? MetricInfo.fromJSON(object.added) : undefined,
477
+ };
478
+ },
479
+
480
+ toJSON(message: MetricCatalogEnvelope): unknown {
481
+ const obj: any = {};
482
+ if (message.snapshot !== undefined) {
483
+ obj.snapshot = MetricCatalogSnapshot.toJSON(message.snapshot);
484
+ }
485
+ if (message.added !== undefined) {
486
+ obj.added = MetricInfo.toJSON(message.added);
487
+ }
488
+ return obj;
489
+ },
490
+
491
+ create<I extends Exact<DeepPartial<MetricCatalogEnvelope>, I>>(base?: I): MetricCatalogEnvelope {
492
+ return MetricCatalogEnvelope.fromPartial(base ?? ({} as any));
493
+ },
494
+ fromPartial<I extends Exact<DeepPartial<MetricCatalogEnvelope>, I>>(object: I): MetricCatalogEnvelope {
495
+ const message = createBaseMetricCatalogEnvelope();
496
+ message.snapshot = (object.snapshot !== undefined && object.snapshot !== null)
497
+ ? MetricCatalogSnapshot.fromPartial(object.snapshot)
498
+ : undefined;
499
+ message.added = (object.added !== undefined && object.added !== null)
500
+ ? MetricInfo.fromPartial(object.added)
501
+ : undefined;
502
+ return message;
503
+ },
504
+ };
505
+
506
+ function createBaseMetricCatalogSnapshot(): MetricCatalogSnapshot {
507
+ return { metrics: [] };
508
+ }
509
+
510
+ export const MetricCatalogSnapshot: MessageFns<MetricCatalogSnapshot> = {
511
+ encode(message: MetricCatalogSnapshot, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
512
+ for (const v of message.metrics) {
513
+ MetricInfo.encode(v!, writer.uint32(10).fork()).join();
514
+ }
515
+ return writer;
516
+ },
517
+
518
+ decode(input: BinaryReader | Uint8Array, length?: number): MetricCatalogSnapshot {
519
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
520
+ const end = length === undefined ? reader.len : reader.pos + length;
521
+ const message = createBaseMetricCatalogSnapshot();
522
+ while (reader.pos < end) {
523
+ const tag = reader.uint32();
524
+ switch (tag >>> 3) {
525
+ case 1: {
526
+ if (tag !== 10) {
527
+ break;
528
+ }
529
+
395
530
  message.metrics.push(MetricInfo.decode(reader, reader.uint32()));
396
531
  continue;
397
532
  }
@@ -404,32 +539,25 @@ export const ListMetricsResponse: MessageFns<ListMetricsResponse> = {
404
539
  return message;
405
540
  },
406
541
 
407
- fromJSON(object: any): ListMetricsResponse {
542
+ fromJSON(object: any): MetricCatalogSnapshot {
408
543
  return {
409
- status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
410
544
  metrics: globalThis.Array.isArray(object?.metrics) ? object.metrics.map((e: any) => MetricInfo.fromJSON(e)) : [],
411
545
  };
412
546
  },
413
547
 
414
- toJSON(message: ListMetricsResponse): unknown {
548
+ toJSON(message: MetricCatalogSnapshot): unknown {
415
549
  const obj: any = {};
416
- if (message.status !== undefined) {
417
- obj.status = ResponseStatus.toJSON(message.status);
418
- }
419
550
  if (message.metrics?.length) {
420
551
  obj.metrics = message.metrics.map((e) => MetricInfo.toJSON(e));
421
552
  }
422
553
  return obj;
423
554
  },
424
555
 
425
- create<I extends Exact<DeepPartial<ListMetricsResponse>, I>>(base?: I): ListMetricsResponse {
426
- return ListMetricsResponse.fromPartial(base ?? ({} as any));
556
+ create<I extends Exact<DeepPartial<MetricCatalogSnapshot>, I>>(base?: I): MetricCatalogSnapshot {
557
+ return MetricCatalogSnapshot.fromPartial(base ?? ({} as any));
427
558
  },
428
- fromPartial<I extends Exact<DeepPartial<ListMetricsResponse>, I>>(object: I): ListMetricsResponse {
429
- const message = createBaseListMetricsResponse();
430
- message.status = (object.status !== undefined && object.status !== null)
431
- ? ResponseStatus.fromPartial(object.status)
432
- : undefined;
559
+ fromPartial<I extends Exact<DeepPartial<MetricCatalogSnapshot>, I>>(object: I): MetricCatalogSnapshot {
560
+ const message = createBaseMetricCatalogSnapshot();
433
561
  message.metrics = object.metrics?.map((e) => MetricInfo.fromPartial(e)) || [];
434
562
  return message;
435
563
  },
@@ -527,28 +655,28 @@ export const MetricInfo: MessageFns<MetricInfo> = {
527
655
  },
528
656
  };
529
657
 
530
- function createBaseListMetricAttributesRequest(): ListMetricAttributesRequest {
531
- return { projectId: "", metricName: "", organizationId: "" };
658
+ function createBaseStreamMetricAttributesRequest(): StreamMetricAttributesRequest {
659
+ return { organizationId: "", projectId: "", metricName: "" };
532
660
  }
533
661
 
534
- export const ListMetricAttributesRequest: MessageFns<ListMetricAttributesRequest> = {
535
- encode(message: ListMetricAttributesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
662
+ export const StreamMetricAttributesRequest: MessageFns<StreamMetricAttributesRequest> = {
663
+ encode(message: StreamMetricAttributesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
664
+ if (message.organizationId !== "") {
665
+ writer.uint32(10).string(message.organizationId);
666
+ }
536
667
  if (message.projectId !== "") {
537
- writer.uint32(10).string(message.projectId);
668
+ writer.uint32(18).string(message.projectId);
538
669
  }
539
670
  if (message.metricName !== "") {
540
- writer.uint32(18).string(message.metricName);
541
- }
542
- if (message.organizationId !== "") {
543
- writer.uint32(26).string(message.organizationId);
671
+ writer.uint32(26).string(message.metricName);
544
672
  }
545
673
  return writer;
546
674
  },
547
675
 
548
- decode(input: BinaryReader | Uint8Array, length?: number): ListMetricAttributesRequest {
676
+ decode(input: BinaryReader | Uint8Array, length?: number): StreamMetricAttributesRequest {
549
677
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
550
678
  const end = length === undefined ? reader.len : reader.pos + length;
551
- const message = createBaseListMetricAttributesRequest();
679
+ const message = createBaseStreamMetricAttributesRequest();
552
680
  while (reader.pos < end) {
553
681
  const tag = reader.uint32();
554
682
  switch (tag >>> 3) {
@@ -557,7 +685,7 @@ export const ListMetricAttributesRequest: MessageFns<ListMetricAttributesRequest
557
685
  break;
558
686
  }
559
687
 
560
- message.projectId = reader.string();
688
+ message.organizationId = reader.string();
561
689
  continue;
562
690
  }
563
691
  case 2: {
@@ -565,7 +693,7 @@ export const ListMetricAttributesRequest: MessageFns<ListMetricAttributesRequest
565
693
  break;
566
694
  }
567
695
 
568
- message.metricName = reader.string();
696
+ message.projectId = reader.string();
569
697
  continue;
570
698
  }
571
699
  case 3: {
@@ -573,7 +701,7 @@ export const ListMetricAttributesRequest: MessageFns<ListMetricAttributesRequest
573
701
  break;
574
702
  }
575
703
 
576
- message.organizationId = reader.string();
704
+ message.metricName = reader.string();
577
705
  continue;
578
706
  }
579
707
  }
@@ -585,8 +713,13 @@ export const ListMetricAttributesRequest: MessageFns<ListMetricAttributesRequest
585
713
  return message;
586
714
  },
587
715
 
588
- fromJSON(object: any): ListMetricAttributesRequest {
716
+ fromJSON(object: any): StreamMetricAttributesRequest {
589
717
  return {
718
+ organizationId: isSet(object.organizationId)
719
+ ? globalThis.String(object.organizationId)
720
+ : isSet(object.organization_id)
721
+ ? globalThis.String(object.organization_id)
722
+ : "",
590
723
  projectId: isSet(object.projectId)
591
724
  ? globalThis.String(object.projectId)
592
725
  : isSet(object.project_id)
@@ -597,59 +730,56 @@ export const ListMetricAttributesRequest: MessageFns<ListMetricAttributesRequest
597
730
  : isSet(object.metric_name)
598
731
  ? globalThis.String(object.metric_name)
599
732
  : "",
600
- organizationId: isSet(object.organizationId)
601
- ? globalThis.String(object.organizationId)
602
- : isSet(object.organization_id)
603
- ? globalThis.String(object.organization_id)
604
- : "",
605
733
  };
606
734
  },
607
735
 
608
- toJSON(message: ListMetricAttributesRequest): unknown {
736
+ toJSON(message: StreamMetricAttributesRequest): unknown {
609
737
  const obj: any = {};
738
+ if (message.organizationId !== "") {
739
+ obj.organizationId = message.organizationId;
740
+ }
610
741
  if (message.projectId !== "") {
611
742
  obj.projectId = message.projectId;
612
743
  }
613
744
  if (message.metricName !== "") {
614
745
  obj.metricName = message.metricName;
615
746
  }
616
- if (message.organizationId !== "") {
617
- obj.organizationId = message.organizationId;
618
- }
619
747
  return obj;
620
748
  },
621
749
 
622
- create<I extends Exact<DeepPartial<ListMetricAttributesRequest>, I>>(base?: I): ListMetricAttributesRequest {
623
- return ListMetricAttributesRequest.fromPartial(base ?? ({} as any));
750
+ create<I extends Exact<DeepPartial<StreamMetricAttributesRequest>, I>>(base?: I): StreamMetricAttributesRequest {
751
+ return StreamMetricAttributesRequest.fromPartial(base ?? ({} as any));
624
752
  },
625
- fromPartial<I extends Exact<DeepPartial<ListMetricAttributesRequest>, I>>(object: I): ListMetricAttributesRequest {
626
- const message = createBaseListMetricAttributesRequest();
753
+ fromPartial<I extends Exact<DeepPartial<StreamMetricAttributesRequest>, I>>(
754
+ object: I,
755
+ ): StreamMetricAttributesRequest {
756
+ const message = createBaseStreamMetricAttributesRequest();
757
+ message.organizationId = object.organizationId ?? "";
627
758
  message.projectId = object.projectId ?? "";
628
759
  message.metricName = object.metricName ?? "";
629
- message.organizationId = object.organizationId ?? "";
630
760
  return message;
631
761
  },
632
762
  };
633
763
 
634
- function createBaseListMetricAttributesResponse(): ListMetricAttributesResponse {
635
- return { status: undefined, attributes: [] };
764
+ function createBaseMetricAttributeEnvelope(): MetricAttributeEnvelope {
765
+ return { snapshot: undefined, added: undefined };
636
766
  }
637
767
 
638
- export const ListMetricAttributesResponse: MessageFns<ListMetricAttributesResponse> = {
639
- encode(message: ListMetricAttributesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
640
- if (message.status !== undefined) {
641
- ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
768
+ export const MetricAttributeEnvelope: MessageFns<MetricAttributeEnvelope> = {
769
+ encode(message: MetricAttributeEnvelope, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
770
+ if (message.snapshot !== undefined) {
771
+ MetricAttributeSnapshot.encode(message.snapshot, writer.uint32(10).fork()).join();
642
772
  }
643
- for (const v of message.attributes) {
644
- MetricAttribute.encode(v!, writer.uint32(18).fork()).join();
773
+ if (message.added !== undefined) {
774
+ MetricAttribute.encode(message.added, writer.uint32(18).fork()).join();
645
775
  }
646
776
  return writer;
647
777
  },
648
778
 
649
- decode(input: BinaryReader | Uint8Array, length?: number): ListMetricAttributesResponse {
779
+ decode(input: BinaryReader | Uint8Array, length?: number): MetricAttributeEnvelope {
650
780
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
651
781
  const end = length === undefined ? reader.len : reader.pos + length;
652
- const message = createBaseListMetricAttributesResponse();
782
+ const message = createBaseMetricAttributeEnvelope();
653
783
  while (reader.pos < end) {
654
784
  const tag = reader.uint32();
655
785
  switch (tag >>> 3) {
@@ -658,7 +788,7 @@ export const ListMetricAttributesResponse: MessageFns<ListMetricAttributesRespon
658
788
  break;
659
789
  }
660
790
 
661
- message.status = ResponseStatus.decode(reader, reader.uint32());
791
+ message.snapshot = MetricAttributeSnapshot.decode(reader, reader.uint32());
662
792
  continue;
663
793
  }
664
794
  case 2: {
@@ -666,6 +796,75 @@ export const ListMetricAttributesResponse: MessageFns<ListMetricAttributesRespon
666
796
  break;
667
797
  }
668
798
 
799
+ message.added = MetricAttribute.decode(reader, reader.uint32());
800
+ continue;
801
+ }
802
+ }
803
+ if ((tag & 7) === 4 || tag === 0) {
804
+ break;
805
+ }
806
+ reader.skip(tag & 7);
807
+ }
808
+ return message;
809
+ },
810
+
811
+ fromJSON(object: any): MetricAttributeEnvelope {
812
+ return {
813
+ snapshot: isSet(object.snapshot) ? MetricAttributeSnapshot.fromJSON(object.snapshot) : undefined,
814
+ added: isSet(object.added) ? MetricAttribute.fromJSON(object.added) : undefined,
815
+ };
816
+ },
817
+
818
+ toJSON(message: MetricAttributeEnvelope): unknown {
819
+ const obj: any = {};
820
+ if (message.snapshot !== undefined) {
821
+ obj.snapshot = MetricAttributeSnapshot.toJSON(message.snapshot);
822
+ }
823
+ if (message.added !== undefined) {
824
+ obj.added = MetricAttribute.toJSON(message.added);
825
+ }
826
+ return obj;
827
+ },
828
+
829
+ create<I extends Exact<DeepPartial<MetricAttributeEnvelope>, I>>(base?: I): MetricAttributeEnvelope {
830
+ return MetricAttributeEnvelope.fromPartial(base ?? ({} as any));
831
+ },
832
+ fromPartial<I extends Exact<DeepPartial<MetricAttributeEnvelope>, I>>(object: I): MetricAttributeEnvelope {
833
+ const message = createBaseMetricAttributeEnvelope();
834
+ message.snapshot = (object.snapshot !== undefined && object.snapshot !== null)
835
+ ? MetricAttributeSnapshot.fromPartial(object.snapshot)
836
+ : undefined;
837
+ message.added = (object.added !== undefined && object.added !== null)
838
+ ? MetricAttribute.fromPartial(object.added)
839
+ : undefined;
840
+ return message;
841
+ },
842
+ };
843
+
844
+ function createBaseMetricAttributeSnapshot(): MetricAttributeSnapshot {
845
+ return { attributes: [] };
846
+ }
847
+
848
+ export const MetricAttributeSnapshot: MessageFns<MetricAttributeSnapshot> = {
849
+ encode(message: MetricAttributeSnapshot, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
850
+ for (const v of message.attributes) {
851
+ MetricAttribute.encode(v!, writer.uint32(10).fork()).join();
852
+ }
853
+ return writer;
854
+ },
855
+
856
+ decode(input: BinaryReader | Uint8Array, length?: number): MetricAttributeSnapshot {
857
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
858
+ const end = length === undefined ? reader.len : reader.pos + length;
859
+ const message = createBaseMetricAttributeSnapshot();
860
+ while (reader.pos < end) {
861
+ const tag = reader.uint32();
862
+ switch (tag >>> 3) {
863
+ case 1: {
864
+ if (tag !== 10) {
865
+ break;
866
+ }
867
+
669
868
  message.attributes.push(MetricAttribute.decode(reader, reader.uint32()));
670
869
  continue;
671
870
  }
@@ -678,34 +877,27 @@ export const ListMetricAttributesResponse: MessageFns<ListMetricAttributesRespon
678
877
  return message;
679
878
  },
680
879
 
681
- fromJSON(object: any): ListMetricAttributesResponse {
880
+ fromJSON(object: any): MetricAttributeSnapshot {
682
881
  return {
683
- status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
684
882
  attributes: globalThis.Array.isArray(object?.attributes)
685
883
  ? object.attributes.map((e: any) => MetricAttribute.fromJSON(e))
686
884
  : [],
687
885
  };
688
886
  },
689
887
 
690
- toJSON(message: ListMetricAttributesResponse): unknown {
888
+ toJSON(message: MetricAttributeSnapshot): unknown {
691
889
  const obj: any = {};
692
- if (message.status !== undefined) {
693
- obj.status = ResponseStatus.toJSON(message.status);
694
- }
695
890
  if (message.attributes?.length) {
696
891
  obj.attributes = message.attributes.map((e) => MetricAttribute.toJSON(e));
697
892
  }
698
893
  return obj;
699
894
  },
700
895
 
701
- create<I extends Exact<DeepPartial<ListMetricAttributesResponse>, I>>(base?: I): ListMetricAttributesResponse {
702
- return ListMetricAttributesResponse.fromPartial(base ?? ({} as any));
896
+ create<I extends Exact<DeepPartial<MetricAttributeSnapshot>, I>>(base?: I): MetricAttributeSnapshot {
897
+ return MetricAttributeSnapshot.fromPartial(base ?? ({} as any));
703
898
  },
704
- fromPartial<I extends Exact<DeepPartial<ListMetricAttributesResponse>, I>>(object: I): ListMetricAttributesResponse {
705
- const message = createBaseListMetricAttributesResponse();
706
- message.status = (object.status !== undefined && object.status !== null)
707
- ? ResponseStatus.fromPartial(object.status)
708
- : undefined;
899
+ fromPartial<I extends Exact<DeepPartial<MetricAttributeSnapshot>, I>>(object: I): MetricAttributeSnapshot {
900
+ const message = createBaseMetricAttributeSnapshot();
709
901
  message.attributes = object.attributes?.map((e) => MetricAttribute.fromPartial(e)) || [];
710
902
  return message;
711
903
  },
@@ -787,52 +979,37 @@ export const MetricAttribute: MessageFns<MetricAttribute> = {
787
979
  },
788
980
  };
789
981
 
790
- function createBaseMetricQuery(): MetricQuery {
791
- return {
792
- projectId: "",
793
- metricName: "",
794
- filter: undefined,
795
- groupBy: [],
796
- aggregation: 0,
797
- timeWindow: 0,
798
- timeInterval: 0,
799
- organizationId: "",
800
- };
982
+ function createBaseGaugeQueryRequest(): GaugeQueryRequest {
983
+ return { organizationId: "", projectId: "", metricName: "", aggregation: 0, timeWindow: 0, timeInterval: 0 };
801
984
  }
802
985
 
803
- export const MetricQuery: MessageFns<MetricQuery> = {
804
- encode(message: MetricQuery, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
986
+ export const GaugeQueryRequest: MessageFns<GaugeQueryRequest> = {
987
+ encode(message: GaugeQueryRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
988
+ if (message.organizationId !== "") {
989
+ writer.uint32(10).string(message.organizationId);
990
+ }
805
991
  if (message.projectId !== "") {
806
- writer.uint32(10).string(message.projectId);
992
+ writer.uint32(18).string(message.projectId);
807
993
  }
808
994
  if (message.metricName !== "") {
809
- writer.uint32(18).string(message.metricName);
810
- }
811
- if (message.filter !== undefined) {
812
- MetricFilter.encode(message.filter, writer.uint32(26).fork()).join();
813
- }
814
- for (const v of message.groupBy) {
815
- writer.uint32(34).string(v!);
995
+ writer.uint32(26).string(message.metricName);
816
996
  }
817
997
  if (message.aggregation !== 0) {
818
- writer.uint32(40).int32(message.aggregation);
998
+ writer.uint32(32).int32(message.aggregation);
819
999
  }
820
1000
  if (message.timeWindow !== 0) {
821
- writer.uint32(48).int32(message.timeWindow);
1001
+ writer.uint32(40).int32(message.timeWindow);
822
1002
  }
823
1003
  if (message.timeInterval !== 0) {
824
- writer.uint32(56).int32(message.timeInterval);
825
- }
826
- if (message.organizationId !== "") {
827
- writer.uint32(66).string(message.organizationId);
1004
+ writer.uint32(48).int32(message.timeInterval);
828
1005
  }
829
1006
  return writer;
830
1007
  },
831
1008
 
832
- decode(input: BinaryReader | Uint8Array, length?: number): MetricQuery {
1009
+ decode(input: BinaryReader | Uint8Array, length?: number): GaugeQueryRequest {
833
1010
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
834
1011
  const end = length === undefined ? reader.len : reader.pos + length;
835
- const message = createBaseMetricQuery();
1012
+ const message = createBaseGaugeQueryRequest();
836
1013
  while (reader.pos < end) {
837
1014
  const tag = reader.uint32();
838
1015
  switch (tag >>> 3) {
@@ -841,7 +1018,7 @@ export const MetricQuery: MessageFns<MetricQuery> = {
841
1018
  break;
842
1019
  }
843
1020
 
844
- message.projectId = reader.string();
1021
+ message.organizationId = reader.string();
845
1022
  continue;
846
1023
  }
847
1024
  case 2: {
@@ -849,7 +1026,7 @@ export const MetricQuery: MessageFns<MetricQuery> = {
849
1026
  break;
850
1027
  }
851
1028
 
852
- message.metricName = reader.string();
1029
+ message.projectId = reader.string();
853
1030
  continue;
854
1031
  }
855
1032
  case 3: {
@@ -857,15 +1034,15 @@ export const MetricQuery: MessageFns<MetricQuery> = {
857
1034
  break;
858
1035
  }
859
1036
 
860
- message.filter = MetricFilter.decode(reader, reader.uint32());
1037
+ message.metricName = reader.string();
861
1038
  continue;
862
1039
  }
863
1040
  case 4: {
864
- if (tag !== 34) {
1041
+ if (tag !== 32) {
865
1042
  break;
866
1043
  }
867
1044
 
868
- message.groupBy.push(reader.string());
1045
+ message.aggregation = reader.int32() as any;
869
1046
  continue;
870
1047
  }
871
1048
  case 5: {
@@ -873,7 +1050,7 @@ export const MetricQuery: MessageFns<MetricQuery> = {
873
1050
  break;
874
1051
  }
875
1052
 
876
- message.aggregation = reader.int32() as any;
1053
+ message.timeWindow = reader.int32() as any;
877
1054
  continue;
878
1055
  }
879
1056
  case 6: {
@@ -881,25 +1058,9 @@ export const MetricQuery: MessageFns<MetricQuery> = {
881
1058
  break;
882
1059
  }
883
1060
 
884
- message.timeWindow = reader.int32() as any;
885
- continue;
886
- }
887
- case 7: {
888
- if (tag !== 56) {
889
- break;
890
- }
891
-
892
1061
  message.timeInterval = reader.int32() as any;
893
1062
  continue;
894
1063
  }
895
- case 8: {
896
- if (tag !== 66) {
897
- break;
898
- }
899
-
900
- message.organizationId = reader.string();
901
- continue;
902
- }
903
1064
  }
904
1065
  if ((tag & 7) === 4 || tag === 0) {
905
1066
  break;
@@ -909,8 +1070,13 @@ export const MetricQuery: MessageFns<MetricQuery> = {
909
1070
  return message;
910
1071
  },
911
1072
 
912
- fromJSON(object: any): MetricQuery {
1073
+ fromJSON(object: any): GaugeQueryRequest {
913
1074
  return {
1075
+ organizationId: isSet(object.organizationId)
1076
+ ? globalThis.String(object.organizationId)
1077
+ : isSet(object.organization_id)
1078
+ ? globalThis.String(object.organization_id)
1079
+ : "",
914
1080
  projectId: isSet(object.projectId)
915
1081
  ? globalThis.String(object.projectId)
916
1082
  : isSet(object.project_id)
@@ -921,13 +1087,7 @@ export const MetricQuery: MessageFns<MetricQuery> = {
921
1087
  : isSet(object.metric_name)
922
1088
  ? globalThis.String(object.metric_name)
923
1089
  : "",
924
- filter: isSet(object.filter) ? MetricFilter.fromJSON(object.filter) : undefined,
925
- groupBy: globalThis.Array.isArray(object?.groupBy)
926
- ? object.groupBy.map((e: any) => globalThis.String(e))
927
- : globalThis.Array.isArray(object?.group_by)
928
- ? object.group_by.map((e: any) => globalThis.String(e))
929
- : [],
930
- aggregation: isSet(object.aggregation) ? metricAggregationFromJSON(object.aggregation) : 0,
1090
+ aggregation: isSet(object.aggregation) ? gaugeAggregationFromJSON(object.aggregation) : 0,
931
1091
  timeWindow: isSet(object.timeWindow)
932
1092
  ? analyticsTimeWindowFromJSON(object.timeWindow)
933
1093
  : isSet(object.time_window)
@@ -938,30 +1098,22 @@ export const MetricQuery: MessageFns<MetricQuery> = {
938
1098
  : isSet(object.time_interval)
939
1099
  ? analyticsTimeIntervalFromJSON(object.time_interval)
940
1100
  : 0,
941
- organizationId: isSet(object.organizationId)
942
- ? globalThis.String(object.organizationId)
943
- : isSet(object.organization_id)
944
- ? globalThis.String(object.organization_id)
945
- : "",
946
1101
  };
947
1102
  },
948
1103
 
949
- toJSON(message: MetricQuery): unknown {
1104
+ toJSON(message: GaugeQueryRequest): unknown {
950
1105
  const obj: any = {};
1106
+ if (message.organizationId !== "") {
1107
+ obj.organizationId = message.organizationId;
1108
+ }
951
1109
  if (message.projectId !== "") {
952
1110
  obj.projectId = message.projectId;
953
1111
  }
954
1112
  if (message.metricName !== "") {
955
1113
  obj.metricName = message.metricName;
956
1114
  }
957
- if (message.filter !== undefined) {
958
- obj.filter = MetricFilter.toJSON(message.filter);
959
- }
960
- if (message.groupBy?.length) {
961
- obj.groupBy = message.groupBy;
962
- }
963
1115
  if (message.aggregation !== 0) {
964
- obj.aggregation = metricAggregationToJSON(message.aggregation);
1116
+ obj.aggregation = gaugeAggregationToJSON(message.aggregation);
965
1117
  }
966
1118
  if (message.timeWindow !== 0) {
967
1119
  obj.timeWindow = analyticsTimeWindowToJSON(message.timeWindow);
@@ -969,50 +1121,55 @@ export const MetricQuery: MessageFns<MetricQuery> = {
969
1121
  if (message.timeInterval !== 0) {
970
1122
  obj.timeInterval = analyticsTimeIntervalToJSON(message.timeInterval);
971
1123
  }
972
- if (message.organizationId !== "") {
973
- obj.organizationId = message.organizationId;
974
- }
975
1124
  return obj;
976
1125
  },
977
1126
 
978
- create<I extends Exact<DeepPartial<MetricQuery>, I>>(base?: I): MetricQuery {
979
- return MetricQuery.fromPartial(base ?? ({} as any));
1127
+ create<I extends Exact<DeepPartial<GaugeQueryRequest>, I>>(base?: I): GaugeQueryRequest {
1128
+ return GaugeQueryRequest.fromPartial(base ?? ({} as any));
980
1129
  },
981
- fromPartial<I extends Exact<DeepPartial<MetricQuery>, I>>(object: I): MetricQuery {
982
- const message = createBaseMetricQuery();
1130
+ fromPartial<I extends Exact<DeepPartial<GaugeQueryRequest>, I>>(object: I): GaugeQueryRequest {
1131
+ const message = createBaseGaugeQueryRequest();
1132
+ message.organizationId = object.organizationId ?? "";
983
1133
  message.projectId = object.projectId ?? "";
984
1134
  message.metricName = object.metricName ?? "";
985
- message.filter = (object.filter !== undefined && object.filter !== null)
986
- ? MetricFilter.fromPartial(object.filter)
987
- : undefined;
988
- message.groupBy = object.groupBy?.map((e) => e) || [];
989
1135
  message.aggregation = object.aggregation ?? 0;
990
1136
  message.timeWindow = object.timeWindow ?? 0;
991
1137
  message.timeInterval = object.timeInterval ?? 0;
992
- message.organizationId = object.organizationId ?? "";
993
1138
  return message;
994
1139
  },
995
1140
  };
996
1141
 
997
- function createBaseMetricFilter(): MetricFilter {
998
- return { serviceNames: [], attributeEquals: {} };
1142
+ function createBaseSumQueryRequest(): SumQueryRequest {
1143
+ return { organizationId: "", projectId: "", metricName: "", aggregation: 0, timeWindow: 0, timeInterval: 0 };
999
1144
  }
1000
1145
 
1001
- export const MetricFilter: MessageFns<MetricFilter> = {
1002
- encode(message: MetricFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1003
- for (const v of message.serviceNames) {
1004
- writer.uint32(10).string(v!);
1146
+ export const SumQueryRequest: MessageFns<SumQueryRequest> = {
1147
+ encode(message: SumQueryRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1148
+ if (message.organizationId !== "") {
1149
+ writer.uint32(10).string(message.organizationId);
1150
+ }
1151
+ if (message.projectId !== "") {
1152
+ writer.uint32(18).string(message.projectId);
1153
+ }
1154
+ if (message.metricName !== "") {
1155
+ writer.uint32(26).string(message.metricName);
1156
+ }
1157
+ if (message.aggregation !== 0) {
1158
+ writer.uint32(32).int32(message.aggregation);
1159
+ }
1160
+ if (message.timeWindow !== 0) {
1161
+ writer.uint32(40).int32(message.timeWindow);
1162
+ }
1163
+ if (message.timeInterval !== 0) {
1164
+ writer.uint32(48).int32(message.timeInterval);
1005
1165
  }
1006
- globalThis.Object.entries(message.attributeEquals).forEach(([key, value]: [string, string]) => {
1007
- MetricFilter_AttributeEqualsEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join();
1008
- });
1009
1166
  return writer;
1010
1167
  },
1011
1168
 
1012
- decode(input: BinaryReader | Uint8Array, length?: number): MetricFilter {
1169
+ decode(input: BinaryReader | Uint8Array, length?: number): SumQueryRequest {
1013
1170
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1014
1171
  const end = length === undefined ? reader.len : reader.pos + length;
1015
- const message = createBaseMetricFilter();
1172
+ const message = createBaseSumQueryRequest();
1016
1173
  while (reader.pos < end) {
1017
1174
  const tag = reader.uint32();
1018
1175
  switch (tag >>> 3) {
@@ -1021,7 +1178,7 @@ export const MetricFilter: MessageFns<MetricFilter> = {
1021
1178
  break;
1022
1179
  }
1023
1180
 
1024
- message.serviceNames.push(reader.string());
1181
+ message.organizationId = reader.string();
1025
1182
  continue;
1026
1183
  }
1027
1184
  case 2: {
@@ -1029,120 +1186,39 @@ export const MetricFilter: MessageFns<MetricFilter> = {
1029
1186
  break;
1030
1187
  }
1031
1188
 
1032
- const entry2 = MetricFilter_AttributeEqualsEntry.decode(reader, reader.uint32());
1033
- if (entry2.value !== undefined) {
1034
- message.attributeEquals[entry2.key] = entry2.value;
1035
- }
1189
+ message.projectId = reader.string();
1036
1190
  continue;
1037
1191
  }
1038
- }
1039
- if ((tag & 7) === 4 || tag === 0) {
1040
- break;
1041
- }
1042
- reader.skip(tag & 7);
1043
- }
1044
- return message;
1045
- },
1046
-
1047
- fromJSON(object: any): MetricFilter {
1048
- return {
1049
- serviceNames: globalThis.Array.isArray(object?.serviceNames)
1050
- ? object.serviceNames.map((e: any) => globalThis.String(e))
1051
- : globalThis.Array.isArray(object?.service_names)
1052
- ? object.service_names.map((e: any) => globalThis.String(e))
1053
- : [],
1054
- attributeEquals: isObject(object.attributeEquals)
1055
- ? (globalThis.Object.entries(object.attributeEquals) as [string, any][]).reduce(
1056
- (acc: { [key: string]: string }, [key, value]: [string, any]) => {
1057
- acc[key] = globalThis.String(value);
1058
- return acc;
1059
- },
1060
- {},
1061
- )
1062
- : isObject(object.attribute_equals)
1063
- ? (globalThis.Object.entries(object.attribute_equals) as [string, any][]).reduce(
1064
- (acc: { [key: string]: string }, [key, value]: [string, any]) => {
1065
- acc[key] = globalThis.String(value);
1066
- return acc;
1067
- },
1068
- {},
1069
- )
1070
- : {},
1071
- };
1072
- },
1073
-
1074
- toJSON(message: MetricFilter): unknown {
1075
- const obj: any = {};
1076
- if (message.serviceNames?.length) {
1077
- obj.serviceNames = message.serviceNames;
1078
- }
1079
- if (message.attributeEquals) {
1080
- const entries = globalThis.Object.entries(message.attributeEquals) as [string, string][];
1081
- if (entries.length > 0) {
1082
- obj.attributeEquals = {};
1083
- entries.forEach(([k, v]) => {
1084
- obj.attributeEquals[k] = v;
1085
- });
1086
- }
1087
- }
1088
- return obj;
1089
- },
1192
+ case 3: {
1193
+ if (tag !== 26) {
1194
+ break;
1195
+ }
1090
1196
 
1091
- create<I extends Exact<DeepPartial<MetricFilter>, I>>(base?: I): MetricFilter {
1092
- return MetricFilter.fromPartial(base ?? ({} as any));
1093
- },
1094
- fromPartial<I extends Exact<DeepPartial<MetricFilter>, I>>(object: I): MetricFilter {
1095
- const message = createBaseMetricFilter();
1096
- message.serviceNames = object.serviceNames?.map((e) => e) || [];
1097
- message.attributeEquals = (globalThis.Object.entries(object.attributeEquals ?? {}) as [string, string][]).reduce(
1098
- (acc: { [key: string]: string }, [key, value]: [string, string]) => {
1099
- if (value !== undefined) {
1100
- acc[key] = globalThis.String(value);
1197
+ message.metricName = reader.string();
1198
+ continue;
1101
1199
  }
1102
- return acc;
1103
- },
1104
- {},
1105
- );
1106
- return message;
1107
- },
1108
- };
1109
-
1110
- function createBaseMetricFilter_AttributeEqualsEntry(): MetricFilter_AttributeEqualsEntry {
1111
- return { key: "", value: "" };
1112
- }
1113
-
1114
- export const MetricFilter_AttributeEqualsEntry: MessageFns<MetricFilter_AttributeEqualsEntry> = {
1115
- encode(message: MetricFilter_AttributeEqualsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1116
- if (message.key !== "") {
1117
- writer.uint32(10).string(message.key);
1118
- }
1119
- if (message.value !== "") {
1120
- writer.uint32(18).string(message.value);
1121
- }
1122
- return writer;
1123
- },
1200
+ case 4: {
1201
+ if (tag !== 32) {
1202
+ break;
1203
+ }
1124
1204
 
1125
- decode(input: BinaryReader | Uint8Array, length?: number): MetricFilter_AttributeEqualsEntry {
1126
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1127
- const end = length === undefined ? reader.len : reader.pos + length;
1128
- const message = createBaseMetricFilter_AttributeEqualsEntry();
1129
- while (reader.pos < end) {
1130
- const tag = reader.uint32();
1131
- switch (tag >>> 3) {
1132
- case 1: {
1133
- if (tag !== 10) {
1205
+ message.aggregation = reader.int32() as any;
1206
+ continue;
1207
+ }
1208
+ case 5: {
1209
+ if (tag !== 40) {
1134
1210
  break;
1135
1211
  }
1136
1212
 
1137
- message.key = reader.string();
1213
+ message.timeWindow = reader.int32() as any;
1138
1214
  continue;
1139
1215
  }
1140
- case 2: {
1141
- if (tag !== 18) {
1216
+ case 6: {
1217
+ if (tag !== 48) {
1142
1218
  break;
1143
1219
  }
1144
1220
 
1145
- message.value = reader.string();
1221
+ message.timeInterval = reader.int32() as any;
1146
1222
  continue;
1147
1223
  }
1148
1224
  }
@@ -1154,55 +1230,117 @@ export const MetricFilter_AttributeEqualsEntry: MessageFns<MetricFilter_Attribut
1154
1230
  return message;
1155
1231
  },
1156
1232
 
1157
- fromJSON(object: any): MetricFilter_AttributeEqualsEntry {
1233
+ fromJSON(object: any): SumQueryRequest {
1158
1234
  return {
1159
- key: isSet(object.key) ? globalThis.String(object.key) : "",
1160
- value: isSet(object.value) ? globalThis.String(object.value) : "",
1235
+ organizationId: isSet(object.organizationId)
1236
+ ? globalThis.String(object.organizationId)
1237
+ : isSet(object.organization_id)
1238
+ ? globalThis.String(object.organization_id)
1239
+ : "",
1240
+ projectId: isSet(object.projectId)
1241
+ ? globalThis.String(object.projectId)
1242
+ : isSet(object.project_id)
1243
+ ? globalThis.String(object.project_id)
1244
+ : "",
1245
+ metricName: isSet(object.metricName)
1246
+ ? globalThis.String(object.metricName)
1247
+ : isSet(object.metric_name)
1248
+ ? globalThis.String(object.metric_name)
1249
+ : "",
1250
+ aggregation: isSet(object.aggregation) ? sumAggregationFromJSON(object.aggregation) : 0,
1251
+ timeWindow: isSet(object.timeWindow)
1252
+ ? analyticsTimeWindowFromJSON(object.timeWindow)
1253
+ : isSet(object.time_window)
1254
+ ? analyticsTimeWindowFromJSON(object.time_window)
1255
+ : 0,
1256
+ timeInterval: isSet(object.timeInterval)
1257
+ ? analyticsTimeIntervalFromJSON(object.timeInterval)
1258
+ : isSet(object.time_interval)
1259
+ ? analyticsTimeIntervalFromJSON(object.time_interval)
1260
+ : 0,
1161
1261
  };
1162
1262
  },
1163
1263
 
1164
- toJSON(message: MetricFilter_AttributeEqualsEntry): unknown {
1264
+ toJSON(message: SumQueryRequest): unknown {
1165
1265
  const obj: any = {};
1166
- if (message.key !== "") {
1167
- obj.key = message.key;
1266
+ if (message.organizationId !== "") {
1267
+ obj.organizationId = message.organizationId;
1168
1268
  }
1169
- if (message.value !== "") {
1170
- obj.value = message.value;
1269
+ if (message.projectId !== "") {
1270
+ obj.projectId = message.projectId;
1271
+ }
1272
+ if (message.metricName !== "") {
1273
+ obj.metricName = message.metricName;
1274
+ }
1275
+ if (message.aggregation !== 0) {
1276
+ obj.aggregation = sumAggregationToJSON(message.aggregation);
1277
+ }
1278
+ if (message.timeWindow !== 0) {
1279
+ obj.timeWindow = analyticsTimeWindowToJSON(message.timeWindow);
1280
+ }
1281
+ if (message.timeInterval !== 0) {
1282
+ obj.timeInterval = analyticsTimeIntervalToJSON(message.timeInterval);
1171
1283
  }
1172
1284
  return obj;
1173
1285
  },
1174
1286
 
1175
- create<I extends Exact<DeepPartial<MetricFilter_AttributeEqualsEntry>, I>>(
1176
- base?: I,
1177
- ): MetricFilter_AttributeEqualsEntry {
1178
- return MetricFilter_AttributeEqualsEntry.fromPartial(base ?? ({} as any));
1287
+ create<I extends Exact<DeepPartial<SumQueryRequest>, I>>(base?: I): SumQueryRequest {
1288
+ return SumQueryRequest.fromPartial(base ?? ({} as any));
1179
1289
  },
1180
- fromPartial<I extends Exact<DeepPartial<MetricFilter_AttributeEqualsEntry>, I>>(
1181
- object: I,
1182
- ): MetricFilter_AttributeEqualsEntry {
1183
- const message = createBaseMetricFilter_AttributeEqualsEntry();
1184
- message.key = object.key ?? "";
1185
- message.value = object.value ?? "";
1290
+ fromPartial<I extends Exact<DeepPartial<SumQueryRequest>, I>>(object: I): SumQueryRequest {
1291
+ const message = createBaseSumQueryRequest();
1292
+ message.organizationId = object.organizationId ?? "";
1293
+ message.projectId = object.projectId ?? "";
1294
+ message.metricName = object.metricName ?? "";
1295
+ message.aggregation = object.aggregation ?? 0;
1296
+ message.timeWindow = object.timeWindow ?? 0;
1297
+ message.timeInterval = object.timeInterval ?? 0;
1186
1298
  return message;
1187
1299
  },
1188
1300
  };
1189
1301
 
1190
- function createBaseQueryMetricsRequest(): QueryMetricsRequest {
1191
- return { query: undefined };
1302
+ function createBaseHistogramQueryRequest(): HistogramQueryRequest {
1303
+ return {
1304
+ organizationId: "",
1305
+ projectId: "",
1306
+ metricName: "",
1307
+ aggregation: 0,
1308
+ quantile: 0,
1309
+ timeWindow: 0,
1310
+ timeInterval: 0,
1311
+ };
1192
1312
  }
1193
1313
 
1194
- export const QueryMetricsRequest: MessageFns<QueryMetricsRequest> = {
1195
- encode(message: QueryMetricsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1196
- if (message.query !== undefined) {
1197
- MetricQuery.encode(message.query, writer.uint32(10).fork()).join();
1314
+ export const HistogramQueryRequest: MessageFns<HistogramQueryRequest> = {
1315
+ encode(message: HistogramQueryRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1316
+ if (message.organizationId !== "") {
1317
+ writer.uint32(10).string(message.organizationId);
1318
+ }
1319
+ if (message.projectId !== "") {
1320
+ writer.uint32(18).string(message.projectId);
1321
+ }
1322
+ if (message.metricName !== "") {
1323
+ writer.uint32(26).string(message.metricName);
1324
+ }
1325
+ if (message.aggregation !== 0) {
1326
+ writer.uint32(32).int32(message.aggregation);
1327
+ }
1328
+ if (message.quantile !== 0) {
1329
+ writer.uint32(41).double(message.quantile);
1330
+ }
1331
+ if (message.timeWindow !== 0) {
1332
+ writer.uint32(48).int32(message.timeWindow);
1333
+ }
1334
+ if (message.timeInterval !== 0) {
1335
+ writer.uint32(56).int32(message.timeInterval);
1198
1336
  }
1199
1337
  return writer;
1200
1338
  },
1201
1339
 
1202
- decode(input: BinaryReader | Uint8Array, length?: number): QueryMetricsRequest {
1340
+ decode(input: BinaryReader | Uint8Array, length?: number): HistogramQueryRequest {
1203
1341
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1204
1342
  const end = length === undefined ? reader.len : reader.pos + length;
1205
- const message = createBaseQueryMetricsRequest();
1343
+ const message = createBaseHistogramQueryRequest();
1206
1344
  while (reader.pos < end) {
1207
1345
  const tag = reader.uint32();
1208
1346
  switch (tag >>> 3) {
@@ -1211,78 +1349,55 @@ export const QueryMetricsRequest: MessageFns<QueryMetricsRequest> = {
1211
1349
  break;
1212
1350
  }
1213
1351
 
1214
- message.query = MetricQuery.decode(reader, reader.uint32());
1352
+ message.organizationId = reader.string();
1215
1353
  continue;
1216
1354
  }
1217
- }
1218
- if ((tag & 7) === 4 || tag === 0) {
1219
- break;
1220
- }
1221
- reader.skip(tag & 7);
1222
- }
1223
- return message;
1224
- },
1225
-
1226
- fromJSON(object: any): QueryMetricsRequest {
1227
- return { query: isSet(object.query) ? MetricQuery.fromJSON(object.query) : undefined };
1228
- },
1229
-
1230
- toJSON(message: QueryMetricsRequest): unknown {
1231
- const obj: any = {};
1232
- if (message.query !== undefined) {
1233
- obj.query = MetricQuery.toJSON(message.query);
1234
- }
1235
- return obj;
1236
- },
1355
+ case 2: {
1356
+ if (tag !== 18) {
1357
+ break;
1358
+ }
1237
1359
 
1238
- create<I extends Exact<DeepPartial<QueryMetricsRequest>, I>>(base?: I): QueryMetricsRequest {
1239
- return QueryMetricsRequest.fromPartial(base ?? ({} as any));
1240
- },
1241
- fromPartial<I extends Exact<DeepPartial<QueryMetricsRequest>, I>>(object: I): QueryMetricsRequest {
1242
- const message = createBaseQueryMetricsRequest();
1243
- message.query = (object.query !== undefined && object.query !== null)
1244
- ? MetricQuery.fromPartial(object.query)
1245
- : undefined;
1246
- return message;
1247
- },
1248
- };
1360
+ message.projectId = reader.string();
1361
+ continue;
1362
+ }
1363
+ case 3: {
1364
+ if (tag !== 26) {
1365
+ break;
1366
+ }
1249
1367
 
1250
- function createBaseQueryMetricsResponse(): QueryMetricsResponse {
1251
- return { status: undefined, snapshot: undefined };
1252
- }
1368
+ message.metricName = reader.string();
1369
+ continue;
1370
+ }
1371
+ case 4: {
1372
+ if (tag !== 32) {
1373
+ break;
1374
+ }
1253
1375
 
1254
- export const QueryMetricsResponse: MessageFns<QueryMetricsResponse> = {
1255
- encode(message: QueryMetricsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1256
- if (message.status !== undefined) {
1257
- ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
1258
- }
1259
- if (message.snapshot !== undefined) {
1260
- MetricAnalyticsSnapshot.encode(message.snapshot, writer.uint32(18).fork()).join();
1261
- }
1262
- return writer;
1263
- },
1376
+ message.aggregation = reader.int32() as any;
1377
+ continue;
1378
+ }
1379
+ case 5: {
1380
+ if (tag !== 41) {
1381
+ break;
1382
+ }
1264
1383
 
1265
- decode(input: BinaryReader | Uint8Array, length?: number): QueryMetricsResponse {
1266
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1267
- const end = length === undefined ? reader.len : reader.pos + length;
1268
- const message = createBaseQueryMetricsResponse();
1269
- while (reader.pos < end) {
1270
- const tag = reader.uint32();
1271
- switch (tag >>> 3) {
1272
- case 1: {
1273
- if (tag !== 10) {
1384
+ message.quantile = reader.double();
1385
+ continue;
1386
+ }
1387
+ case 6: {
1388
+ if (tag !== 48) {
1274
1389
  break;
1275
1390
  }
1276
1391
 
1277
- message.status = ResponseStatus.decode(reader, reader.uint32());
1392
+ message.timeWindow = reader.int32() as any;
1278
1393
  continue;
1279
1394
  }
1280
- case 2: {
1281
- if (tag !== 18) {
1395
+ case 7: {
1396
+ if (tag !== 56) {
1282
1397
  break;
1283
1398
  }
1284
1399
 
1285
- message.snapshot = MetricAnalyticsSnapshot.decode(reader, reader.uint32());
1400
+ message.timeInterval = reader.int32() as any;
1286
1401
  continue;
1287
1402
  }
1288
1403
  }
@@ -1294,95 +1409,76 @@ export const QueryMetricsResponse: MessageFns<QueryMetricsResponse> = {
1294
1409
  return message;
1295
1410
  },
1296
1411
 
1297
- fromJSON(object: any): QueryMetricsResponse {
1412
+ fromJSON(object: any): HistogramQueryRequest {
1298
1413
  return {
1299
- status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
1300
- snapshot: isSet(object.snapshot) ? MetricAnalyticsSnapshot.fromJSON(object.snapshot) : undefined,
1414
+ organizationId: isSet(object.organizationId)
1415
+ ? globalThis.String(object.organizationId)
1416
+ : isSet(object.organization_id)
1417
+ ? globalThis.String(object.organization_id)
1418
+ : "",
1419
+ projectId: isSet(object.projectId)
1420
+ ? globalThis.String(object.projectId)
1421
+ : isSet(object.project_id)
1422
+ ? globalThis.String(object.project_id)
1423
+ : "",
1424
+ metricName: isSet(object.metricName)
1425
+ ? globalThis.String(object.metricName)
1426
+ : isSet(object.metric_name)
1427
+ ? globalThis.String(object.metric_name)
1428
+ : "",
1429
+ aggregation: isSet(object.aggregation) ? histogramAggregationFromJSON(object.aggregation) : 0,
1430
+ quantile: isSet(object.quantile) ? globalThis.Number(object.quantile) : 0,
1431
+ timeWindow: isSet(object.timeWindow)
1432
+ ? analyticsTimeWindowFromJSON(object.timeWindow)
1433
+ : isSet(object.time_window)
1434
+ ? analyticsTimeWindowFromJSON(object.time_window)
1435
+ : 0,
1436
+ timeInterval: isSet(object.timeInterval)
1437
+ ? analyticsTimeIntervalFromJSON(object.timeInterval)
1438
+ : isSet(object.time_interval)
1439
+ ? analyticsTimeIntervalFromJSON(object.time_interval)
1440
+ : 0,
1301
1441
  };
1302
1442
  },
1303
1443
 
1304
- toJSON(message: QueryMetricsResponse): unknown {
1444
+ toJSON(message: HistogramQueryRequest): unknown {
1305
1445
  const obj: any = {};
1306
- if (message.status !== undefined) {
1307
- obj.status = ResponseStatus.toJSON(message.status);
1446
+ if (message.organizationId !== "") {
1447
+ obj.organizationId = message.organizationId;
1308
1448
  }
1309
- if (message.snapshot !== undefined) {
1310
- obj.snapshot = MetricAnalyticsSnapshot.toJSON(message.snapshot);
1449
+ if (message.projectId !== "") {
1450
+ obj.projectId = message.projectId;
1311
1451
  }
1312
- return obj;
1313
- },
1314
-
1315
- create<I extends Exact<DeepPartial<QueryMetricsResponse>, I>>(base?: I): QueryMetricsResponse {
1316
- return QueryMetricsResponse.fromPartial(base ?? ({} as any));
1317
- },
1318
- fromPartial<I extends Exact<DeepPartial<QueryMetricsResponse>, I>>(object: I): QueryMetricsResponse {
1319
- const message = createBaseQueryMetricsResponse();
1320
- message.status = (object.status !== undefined && object.status !== null)
1321
- ? ResponseStatus.fromPartial(object.status)
1322
- : undefined;
1323
- message.snapshot = (object.snapshot !== undefined && object.snapshot !== null)
1324
- ? MetricAnalyticsSnapshot.fromPartial(object.snapshot)
1325
- : undefined;
1326
- return message;
1327
- },
1328
- };
1329
-
1330
- function createBaseStreamMetricAnalyticsRequest(): StreamMetricAnalyticsRequest {
1331
- return { query: undefined };
1332
- }
1333
-
1334
- export const StreamMetricAnalyticsRequest: MessageFns<StreamMetricAnalyticsRequest> = {
1335
- encode(message: StreamMetricAnalyticsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1336
- if (message.query !== undefined) {
1337
- MetricQuery.encode(message.query, writer.uint32(10).fork()).join();
1452
+ if (message.metricName !== "") {
1453
+ obj.metricName = message.metricName;
1338
1454
  }
1339
- return writer;
1340
- },
1341
-
1342
- decode(input: BinaryReader | Uint8Array, length?: number): StreamMetricAnalyticsRequest {
1343
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1344
- const end = length === undefined ? reader.len : reader.pos + length;
1345
- const message = createBaseStreamMetricAnalyticsRequest();
1346
- while (reader.pos < end) {
1347
- const tag = reader.uint32();
1348
- switch (tag >>> 3) {
1349
- case 1: {
1350
- if (tag !== 10) {
1351
- break;
1352
- }
1353
-
1354
- message.query = MetricQuery.decode(reader, reader.uint32());
1355
- continue;
1356
- }
1357
- }
1358
- if ((tag & 7) === 4 || tag === 0) {
1359
- break;
1360
- }
1361
- reader.skip(tag & 7);
1455
+ if (message.aggregation !== 0) {
1456
+ obj.aggregation = histogramAggregationToJSON(message.aggregation);
1362
1457
  }
1363
- return message;
1364
- },
1365
-
1366
- fromJSON(object: any): StreamMetricAnalyticsRequest {
1367
- return { query: isSet(object.query) ? MetricQuery.fromJSON(object.query) : undefined };
1368
- },
1369
-
1370
- toJSON(message: StreamMetricAnalyticsRequest): unknown {
1371
- const obj: any = {};
1372
- if (message.query !== undefined) {
1373
- obj.query = MetricQuery.toJSON(message.query);
1458
+ if (message.quantile !== 0) {
1459
+ obj.quantile = message.quantile;
1460
+ }
1461
+ if (message.timeWindow !== 0) {
1462
+ obj.timeWindow = analyticsTimeWindowToJSON(message.timeWindow);
1463
+ }
1464
+ if (message.timeInterval !== 0) {
1465
+ obj.timeInterval = analyticsTimeIntervalToJSON(message.timeInterval);
1374
1466
  }
1375
1467
  return obj;
1376
1468
  },
1377
1469
 
1378
- create<I extends Exact<DeepPartial<StreamMetricAnalyticsRequest>, I>>(base?: I): StreamMetricAnalyticsRequest {
1379
- return StreamMetricAnalyticsRequest.fromPartial(base ?? ({} as any));
1470
+ create<I extends Exact<DeepPartial<HistogramQueryRequest>, I>>(base?: I): HistogramQueryRequest {
1471
+ return HistogramQueryRequest.fromPartial(base ?? ({} as any));
1380
1472
  },
1381
- fromPartial<I extends Exact<DeepPartial<StreamMetricAnalyticsRequest>, I>>(object: I): StreamMetricAnalyticsRequest {
1382
- const message = createBaseStreamMetricAnalyticsRequest();
1383
- message.query = (object.query !== undefined && object.query !== null)
1384
- ? MetricQuery.fromPartial(object.query)
1385
- : undefined;
1473
+ fromPartial<I extends Exact<DeepPartial<HistogramQueryRequest>, I>>(object: I): HistogramQueryRequest {
1474
+ const message = createBaseHistogramQueryRequest();
1475
+ message.organizationId = object.organizationId ?? "";
1476
+ message.projectId = object.projectId ?? "";
1477
+ message.metricName = object.metricName ?? "";
1478
+ message.aggregation = object.aggregation ?? 0;
1479
+ message.quantile = object.quantile ?? 0;
1480
+ message.timeWindow = object.timeWindow ?? 0;
1481
+ message.timeInterval = object.timeInterval ?? 0;
1386
1482
  return message;
1387
1483
  },
1388
1484
  };
@@ -1635,16 +1731,13 @@ export const MetricAnalyticsSnapshot: MessageFns<MetricAnalyticsSnapshot> = {
1635
1731
  };
1636
1732
 
1637
1733
  function createBaseMetricSeries(): MetricSeries {
1638
- return { groupKey: {}, buckets: [] };
1734
+ return { buckets: [] };
1639
1735
  }
1640
1736
 
1641
1737
  export const MetricSeries: MessageFns<MetricSeries> = {
1642
1738
  encode(message: MetricSeries, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1643
- globalThis.Object.entries(message.groupKey).forEach(([key, value]: [string, string]) => {
1644
- MetricSeries_GroupKeyEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
1645
- });
1646
1739
  for (const v of message.buckets) {
1647
- MetricBucket.encode(v!, writer.uint32(18).fork()).join();
1740
+ MetricBucket.encode(v!, writer.uint32(10).fork()).join();
1648
1741
  }
1649
1742
  return writer;
1650
1743
  },
@@ -1661,17 +1754,6 @@ export const MetricSeries: MessageFns<MetricSeries> = {
1661
1754
  break;
1662
1755
  }
1663
1756
 
1664
- const entry1 = MetricSeries_GroupKeyEntry.decode(reader, reader.uint32());
1665
- if (entry1.value !== undefined) {
1666
- message.groupKey[entry1.key] = entry1.value;
1667
- }
1668
- continue;
1669
- }
1670
- case 2: {
1671
- if (tag !== 18) {
1672
- break;
1673
- }
1674
-
1675
1757
  message.buckets.push(MetricBucket.decode(reader, reader.uint32()));
1676
1758
  continue;
1677
1759
  }
@@ -1686,23 +1768,6 @@ export const MetricSeries: MessageFns<MetricSeries> = {
1686
1768
 
1687
1769
  fromJSON(object: any): MetricSeries {
1688
1770
  return {
1689
- groupKey: isObject(object.groupKey)
1690
- ? (globalThis.Object.entries(object.groupKey) as [string, any][]).reduce(
1691
- (acc: { [key: string]: string }, [key, value]: [string, any]) => {
1692
- acc[key] = globalThis.String(value);
1693
- return acc;
1694
- },
1695
- {},
1696
- )
1697
- : isObject(object.group_key)
1698
- ? (globalThis.Object.entries(object.group_key) as [string, any][]).reduce(
1699
- (acc: { [key: string]: string }, [key, value]: [string, any]) => {
1700
- acc[key] = globalThis.String(value);
1701
- return acc;
1702
- },
1703
- {},
1704
- )
1705
- : {},
1706
1771
  buckets: globalThis.Array.isArray(object?.buckets)
1707
1772
  ? object.buckets.map((e: any) => MetricBucket.fromJSON(e))
1708
1773
  : [],
@@ -1711,15 +1776,6 @@ export const MetricSeries: MessageFns<MetricSeries> = {
1711
1776
 
1712
1777
  toJSON(message: MetricSeries): unknown {
1713
1778
  const obj: any = {};
1714
- if (message.groupKey) {
1715
- const entries = globalThis.Object.entries(message.groupKey) as [string, string][];
1716
- if (entries.length > 0) {
1717
- obj.groupKey = {};
1718
- entries.forEach(([k, v]) => {
1719
- obj.groupKey[k] = v;
1720
- });
1721
- }
1722
- }
1723
1779
  if (message.buckets?.length) {
1724
1780
  obj.buckets = message.buckets.map((e) => MetricBucket.toJSON(e));
1725
1781
  }
@@ -1731,96 +1787,11 @@ export const MetricSeries: MessageFns<MetricSeries> = {
1731
1787
  },
1732
1788
  fromPartial<I extends Exact<DeepPartial<MetricSeries>, I>>(object: I): MetricSeries {
1733
1789
  const message = createBaseMetricSeries();
1734
- message.groupKey = (globalThis.Object.entries(object.groupKey ?? {}) as [string, string][]).reduce(
1735
- (acc: { [key: string]: string }, [key, value]: [string, string]) => {
1736
- if (value !== undefined) {
1737
- acc[key] = globalThis.String(value);
1738
- }
1739
- return acc;
1740
- },
1741
- {},
1742
- );
1743
1790
  message.buckets = object.buckets?.map((e) => MetricBucket.fromPartial(e)) || [];
1744
1791
  return message;
1745
1792
  },
1746
1793
  };
1747
1794
 
1748
- function createBaseMetricSeries_GroupKeyEntry(): MetricSeries_GroupKeyEntry {
1749
- return { key: "", value: "" };
1750
- }
1751
-
1752
- export const MetricSeries_GroupKeyEntry: MessageFns<MetricSeries_GroupKeyEntry> = {
1753
- encode(message: MetricSeries_GroupKeyEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1754
- if (message.key !== "") {
1755
- writer.uint32(10).string(message.key);
1756
- }
1757
- if (message.value !== "") {
1758
- writer.uint32(18).string(message.value);
1759
- }
1760
- return writer;
1761
- },
1762
-
1763
- decode(input: BinaryReader | Uint8Array, length?: number): MetricSeries_GroupKeyEntry {
1764
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1765
- const end = length === undefined ? reader.len : reader.pos + length;
1766
- const message = createBaseMetricSeries_GroupKeyEntry();
1767
- while (reader.pos < end) {
1768
- const tag = reader.uint32();
1769
- switch (tag >>> 3) {
1770
- case 1: {
1771
- if (tag !== 10) {
1772
- break;
1773
- }
1774
-
1775
- message.key = reader.string();
1776
- continue;
1777
- }
1778
- case 2: {
1779
- if (tag !== 18) {
1780
- break;
1781
- }
1782
-
1783
- message.value = reader.string();
1784
- continue;
1785
- }
1786
- }
1787
- if ((tag & 7) === 4 || tag === 0) {
1788
- break;
1789
- }
1790
- reader.skip(tag & 7);
1791
- }
1792
- return message;
1793
- },
1794
-
1795
- fromJSON(object: any): MetricSeries_GroupKeyEntry {
1796
- return {
1797
- key: isSet(object.key) ? globalThis.String(object.key) : "",
1798
- value: isSet(object.value) ? globalThis.String(object.value) : "",
1799
- };
1800
- },
1801
-
1802
- toJSON(message: MetricSeries_GroupKeyEntry): unknown {
1803
- const obj: any = {};
1804
- if (message.key !== "") {
1805
- obj.key = message.key;
1806
- }
1807
- if (message.value !== "") {
1808
- obj.value = message.value;
1809
- }
1810
- return obj;
1811
- },
1812
-
1813
- create<I extends Exact<DeepPartial<MetricSeries_GroupKeyEntry>, I>>(base?: I): MetricSeries_GroupKeyEntry {
1814
- return MetricSeries_GroupKeyEntry.fromPartial(base ?? ({} as any));
1815
- },
1816
- fromPartial<I extends Exact<DeepPartial<MetricSeries_GroupKeyEntry>, I>>(object: I): MetricSeries_GroupKeyEntry {
1817
- const message = createBaseMetricSeries_GroupKeyEntry();
1818
- message.key = object.key ?? "";
1819
- message.value = object.value ?? "";
1820
- return message;
1821
- },
1822
- };
1823
-
1824
1795
  function createBaseMetricBucket(): MetricBucket {
1825
1796
  return { bucketStart: undefined, value: 0 };
1826
1797
  }
@@ -1902,19 +1873,16 @@ export const MetricBucket: MessageFns<MetricBucket> = {
1902
1873
  };
1903
1874
 
1904
1875
  function createBaseMetricSeriesBucketUpdate(): MetricSeriesBucketUpdate {
1905
- return { groupKey: {}, bucket: undefined, generatedAt: undefined };
1876
+ return { bucket: undefined, generatedAt: undefined };
1906
1877
  }
1907
1878
 
1908
1879
  export const MetricSeriesBucketUpdate: MessageFns<MetricSeriesBucketUpdate> = {
1909
1880
  encode(message: MetricSeriesBucketUpdate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1910
- globalThis.Object.entries(message.groupKey).forEach(([key, value]: [string, string]) => {
1911
- MetricSeriesBucketUpdate_GroupKeyEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
1912
- });
1913
1881
  if (message.bucket !== undefined) {
1914
- MetricBucket.encode(message.bucket, writer.uint32(18).fork()).join();
1882
+ MetricBucket.encode(message.bucket, writer.uint32(10).fork()).join();
1915
1883
  }
1916
1884
  if (message.generatedAt !== undefined) {
1917
- Timestamp.encode(toTimestamp(message.generatedAt), writer.uint32(26).fork()).join();
1885
+ Timestamp.encode(toTimestamp(message.generatedAt), writer.uint32(18).fork()).join();
1918
1886
  }
1919
1887
  return writer;
1920
1888
  },
@@ -1931,10 +1899,7 @@ export const MetricSeriesBucketUpdate: MessageFns<MetricSeriesBucketUpdate> = {
1931
1899
  break;
1932
1900
  }
1933
1901
 
1934
- const entry1 = MetricSeriesBucketUpdate_GroupKeyEntry.decode(reader, reader.uint32());
1935
- if (entry1.value !== undefined) {
1936
- message.groupKey[entry1.key] = entry1.value;
1937
- }
1902
+ message.bucket = MetricBucket.decode(reader, reader.uint32());
1938
1903
  continue;
1939
1904
  }
1940
1905
  case 2: {
@@ -1942,14 +1907,6 @@ export const MetricSeriesBucketUpdate: MessageFns<MetricSeriesBucketUpdate> = {
1942
1907
  break;
1943
1908
  }
1944
1909
 
1945
- message.bucket = MetricBucket.decode(reader, reader.uint32());
1946
- continue;
1947
- }
1948
- case 3: {
1949
- if (tag !== 26) {
1950
- break;
1951
- }
1952
-
1953
1910
  message.generatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1954
1911
  continue;
1955
1912
  }
@@ -1964,23 +1921,6 @@ export const MetricSeriesBucketUpdate: MessageFns<MetricSeriesBucketUpdate> = {
1964
1921
 
1965
1922
  fromJSON(object: any): MetricSeriesBucketUpdate {
1966
1923
  return {
1967
- groupKey: isObject(object.groupKey)
1968
- ? (globalThis.Object.entries(object.groupKey) as [string, any][]).reduce(
1969
- (acc: { [key: string]: string }, [key, value]: [string, any]) => {
1970
- acc[key] = globalThis.String(value);
1971
- return acc;
1972
- },
1973
- {},
1974
- )
1975
- : isObject(object.group_key)
1976
- ? (globalThis.Object.entries(object.group_key) as [string, any][]).reduce(
1977
- (acc: { [key: string]: string }, [key, value]: [string, any]) => {
1978
- acc[key] = globalThis.String(value);
1979
- return acc;
1980
- },
1981
- {},
1982
- )
1983
- : {},
1984
1924
  bucket: isSet(object.bucket) ? MetricBucket.fromJSON(object.bucket) : undefined,
1985
1925
  generatedAt: isSet(object.generatedAt)
1986
1926
  ? fromJsonTimestamp(object.generatedAt)
@@ -1992,15 +1932,6 @@ export const MetricSeriesBucketUpdate: MessageFns<MetricSeriesBucketUpdate> = {
1992
1932
 
1993
1933
  toJSON(message: MetricSeriesBucketUpdate): unknown {
1994
1934
  const obj: any = {};
1995
- if (message.groupKey) {
1996
- const entries = globalThis.Object.entries(message.groupKey) as [string, string][];
1997
- if (entries.length > 0) {
1998
- obj.groupKey = {};
1999
- entries.forEach(([k, v]) => {
2000
- obj.groupKey[k] = v;
2001
- });
2002
- }
2003
- }
2004
1935
  if (message.bucket !== undefined) {
2005
1936
  obj.bucket = MetricBucket.toJSON(message.bucket);
2006
1937
  }
@@ -2015,15 +1946,6 @@ export const MetricSeriesBucketUpdate: MessageFns<MetricSeriesBucketUpdate> = {
2015
1946
  },
2016
1947
  fromPartial<I extends Exact<DeepPartial<MetricSeriesBucketUpdate>, I>>(object: I): MetricSeriesBucketUpdate {
2017
1948
  const message = createBaseMetricSeriesBucketUpdate();
2018
- message.groupKey = (globalThis.Object.entries(object.groupKey ?? {}) as [string, string][]).reduce(
2019
- (acc: { [key: string]: string }, [key, value]: [string, string]) => {
2020
- if (value !== undefined) {
2021
- acc[key] = globalThis.String(value);
2022
- }
2023
- return acc;
2024
- },
2025
- {},
2026
- );
2027
1949
  message.bucket = (object.bucket !== undefined && object.bucket !== null)
2028
1950
  ? MetricBucket.fromPartial(object.bucket)
2029
1951
  : undefined;
@@ -2032,101 +1954,20 @@ export const MetricSeriesBucketUpdate: MessageFns<MetricSeriesBucketUpdate> = {
2032
1954
  },
2033
1955
  };
2034
1956
 
2035
- function createBaseMetricSeriesBucketUpdate_GroupKeyEntry(): MetricSeriesBucketUpdate_GroupKeyEntry {
2036
- return { key: "", value: "" };
2037
- }
2038
-
2039
- export const MetricSeriesBucketUpdate_GroupKeyEntry: MessageFns<MetricSeriesBucketUpdate_GroupKeyEntry> = {
2040
- encode(message: MetricSeriesBucketUpdate_GroupKeyEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2041
- if (message.key !== "") {
2042
- writer.uint32(10).string(message.key);
2043
- }
2044
- if (message.value !== "") {
2045
- writer.uint32(18).string(message.value);
2046
- }
2047
- return writer;
2048
- },
2049
-
2050
- decode(input: BinaryReader | Uint8Array, length?: number): MetricSeriesBucketUpdate_GroupKeyEntry {
2051
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2052
- const end = length === undefined ? reader.len : reader.pos + length;
2053
- const message = createBaseMetricSeriesBucketUpdate_GroupKeyEntry();
2054
- while (reader.pos < end) {
2055
- const tag = reader.uint32();
2056
- switch (tag >>> 3) {
2057
- case 1: {
2058
- if (tag !== 10) {
2059
- break;
2060
- }
2061
-
2062
- message.key = reader.string();
2063
- continue;
2064
- }
2065
- case 2: {
2066
- if (tag !== 18) {
2067
- break;
2068
- }
2069
-
2070
- message.value = reader.string();
2071
- continue;
2072
- }
2073
- }
2074
- if ((tag & 7) === 4 || tag === 0) {
2075
- break;
2076
- }
2077
- reader.skip(tag & 7);
2078
- }
2079
- return message;
2080
- },
2081
-
2082
- fromJSON(object: any): MetricSeriesBucketUpdate_GroupKeyEntry {
2083
- return {
2084
- key: isSet(object.key) ? globalThis.String(object.key) : "",
2085
- value: isSet(object.value) ? globalThis.String(object.value) : "",
2086
- };
2087
- },
2088
-
2089
- toJSON(message: MetricSeriesBucketUpdate_GroupKeyEntry): unknown {
2090
- const obj: any = {};
2091
- if (message.key !== "") {
2092
- obj.key = message.key;
2093
- }
2094
- if (message.value !== "") {
2095
- obj.value = message.value;
2096
- }
2097
- return obj;
2098
- },
2099
-
2100
- create<I extends Exact<DeepPartial<MetricSeriesBucketUpdate_GroupKeyEntry>, I>>(
2101
- base?: I,
2102
- ): MetricSeriesBucketUpdate_GroupKeyEntry {
2103
- return MetricSeriesBucketUpdate_GroupKeyEntry.fromPartial(base ?? ({} as any));
2104
- },
2105
- fromPartial<I extends Exact<DeepPartial<MetricSeriesBucketUpdate_GroupKeyEntry>, I>>(
2106
- object: I,
2107
- ): MetricSeriesBucketUpdate_GroupKeyEntry {
2108
- const message = createBaseMetricSeriesBucketUpdate_GroupKeyEntry();
2109
- message.key = object.key ?? "";
2110
- message.value = object.value ?? "";
2111
- return message;
2112
- },
2113
- };
2114
-
2115
1957
  /**
2116
1958
  * TelemetryGatewayService is the web surface of telemetry.api.v1 — the types
2117
- * are domain-isolated copies converted in gateways/internal/convert.
1959
+ * are domain-isolated copies converted in gateways/internal/convert. Every RPC
1960
+ * is a server stream (snapshot first, then live updates), split by metric kind.
2118
1961
  */
2119
1962
  export interface TelemetryGatewayService {
2120
- ListMetrics(request: ListMetricsRequest, metadata?: Metadata): Promise<ListMetricsResponse>;
2121
- ListMetricAttributes(
2122
- request: ListMetricAttributesRequest,
1963
+ StreamMetrics(request: StreamMetricsRequest, metadata?: Metadata): Observable<MetricCatalogEnvelope>;
1964
+ StreamMetricAttributes(
1965
+ request: StreamMetricAttributesRequest,
2123
1966
  metadata?: Metadata,
2124
- ): Promise<ListMetricAttributesResponse>;
2125
- QueryMetrics(request: QueryMetricsRequest, metadata?: Metadata): Promise<QueryMetricsResponse>;
2126
- StreamMetricAnalytics(
2127
- request: StreamMetricAnalyticsRequest,
2128
- metadata?: Metadata,
2129
- ): Observable<MetricAnalyticsEnvelope>;
1967
+ ): Observable<MetricAttributeEnvelope>;
1968
+ StreamGaugeAnalytics(request: GaugeQueryRequest, metadata?: Metadata): Observable<MetricAnalyticsEnvelope>;
1969
+ StreamSumAnalytics(request: SumQueryRequest, metadata?: Metadata): Observable<MetricAnalyticsEnvelope>;
1970
+ StreamHistogramAnalytics(request: HistogramQueryRequest, metadata?: Metadata): Observable<MetricAnalyticsEnvelope>;
2130
1971
  }
2131
1972
 
2132
1973
  export const TelemetryGatewayServiceServiceName = "gateway.web.v1.TelemetryGatewayService";
@@ -2136,38 +1977,42 @@ export class TelemetryGatewayServiceClientImpl implements TelemetryGatewayServic
2136
1977
  constructor(rpc: Rpc, opts?: { service?: string }) {
2137
1978
  this.service = opts?.service || TelemetryGatewayServiceServiceName;
2138
1979
  this.rpc = rpc;
2139
- this.ListMetrics = this.ListMetrics.bind(this);
2140
- this.ListMetricAttributes = this.ListMetricAttributes.bind(this);
2141
- this.QueryMetrics = this.QueryMetrics.bind(this);
2142
- this.StreamMetricAnalytics = this.StreamMetricAnalytics.bind(this);
1980
+ this.StreamMetrics = this.StreamMetrics.bind(this);
1981
+ this.StreamMetricAttributes = this.StreamMetricAttributes.bind(this);
1982
+ this.StreamGaugeAnalytics = this.StreamGaugeAnalytics.bind(this);
1983
+ this.StreamSumAnalytics = this.StreamSumAnalytics.bind(this);
1984
+ this.StreamHistogramAnalytics = this.StreamHistogramAnalytics.bind(this);
2143
1985
  }
2144
- ListMetrics(request: ListMetricsRequest, metadata?: Metadata): Promise<ListMetricsResponse> {
2145
- const data = ListMetricsRequest.encode(request).finish();
2146
- const promise = this.rpc.request(this.service, "ListMetrics", data, metadata);
2147
- return promise.then((data) => ListMetricsResponse.decode(new BinaryReader(data)));
1986
+ StreamMetrics(request: StreamMetricsRequest, metadata?: Metadata): Observable<MetricCatalogEnvelope> {
1987
+ const data = StreamMetricsRequest.encode(request).finish();
1988
+ const result = this.rpc.serverStreamingRequest(this.service, "StreamMetrics", data, metadata);
1989
+ return result.pipe(map((data) => MetricCatalogEnvelope.decode(new BinaryReader(data))));
2148
1990
  }
2149
1991
 
2150
- ListMetricAttributes(
2151
- request: ListMetricAttributesRequest,
1992
+ StreamMetricAttributes(
1993
+ request: StreamMetricAttributesRequest,
2152
1994
  metadata?: Metadata,
2153
- ): Promise<ListMetricAttributesResponse> {
2154
- const data = ListMetricAttributesRequest.encode(request).finish();
2155
- const promise = this.rpc.request(this.service, "ListMetricAttributes", data, metadata);
2156
- return promise.then((data) => ListMetricAttributesResponse.decode(new BinaryReader(data)));
1995
+ ): Observable<MetricAttributeEnvelope> {
1996
+ const data = StreamMetricAttributesRequest.encode(request).finish();
1997
+ const result = this.rpc.serverStreamingRequest(this.service, "StreamMetricAttributes", data, metadata);
1998
+ return result.pipe(map((data) => MetricAttributeEnvelope.decode(new BinaryReader(data))));
2157
1999
  }
2158
2000
 
2159
- QueryMetrics(request: QueryMetricsRequest, metadata?: Metadata): Promise<QueryMetricsResponse> {
2160
- const data = QueryMetricsRequest.encode(request).finish();
2161
- const promise = this.rpc.request(this.service, "QueryMetrics", data, metadata);
2162
- return promise.then((data) => QueryMetricsResponse.decode(new BinaryReader(data)));
2001
+ StreamGaugeAnalytics(request: GaugeQueryRequest, metadata?: Metadata): Observable<MetricAnalyticsEnvelope> {
2002
+ const data = GaugeQueryRequest.encode(request).finish();
2003
+ const result = this.rpc.serverStreamingRequest(this.service, "StreamGaugeAnalytics", data, metadata);
2004
+ return result.pipe(map((data) => MetricAnalyticsEnvelope.decode(new BinaryReader(data))));
2163
2005
  }
2164
2006
 
2165
- StreamMetricAnalytics(
2166
- request: StreamMetricAnalyticsRequest,
2167
- metadata?: Metadata,
2168
- ): Observable<MetricAnalyticsEnvelope> {
2169
- const data = StreamMetricAnalyticsRequest.encode(request).finish();
2170
- const result = this.rpc.serverStreamingRequest(this.service, "StreamMetricAnalytics", data, metadata);
2007
+ StreamSumAnalytics(request: SumQueryRequest, metadata?: Metadata): Observable<MetricAnalyticsEnvelope> {
2008
+ const data = SumQueryRequest.encode(request).finish();
2009
+ const result = this.rpc.serverStreamingRequest(this.service, "StreamSumAnalytics", data, metadata);
2010
+ return result.pipe(map((data) => MetricAnalyticsEnvelope.decode(new BinaryReader(data))));
2011
+ }
2012
+
2013
+ StreamHistogramAnalytics(request: HistogramQueryRequest, metadata?: Metadata): Observable<MetricAnalyticsEnvelope> {
2014
+ const data = HistogramQueryRequest.encode(request).finish();
2015
+ const result = this.rpc.serverStreamingRequest(this.service, "StreamHistogramAnalytics", data, metadata);
2171
2016
  return result.pipe(map((data) => MetricAnalyticsEnvelope.decode(new BinaryReader(data))));
2172
2017
  }
2173
2018
  }
@@ -2239,10 +2084,6 @@ function longToNumber(int64: { toString(): string }): number {
2239
2084
  return num;
2240
2085
  }
2241
2086
 
2242
- function isObject(value: any): boolean {
2243
- return typeof value === "object" && value !== null;
2244
- }
2245
-
2246
2087
  function isSet(value: any): boolean {
2247
2088
  return value !== null && value !== undefined;
2248
2089
  }