@miradorlabs/web-grpc 2.23.0 → 2.25.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.
@@ -73,290 +73,6 @@ export function metricKindToJSON(object: MetricKind): string {
73
73
  }
74
74
  }
75
75
 
76
- export enum GaugeAggregation {
77
- GAUGE_AGGREGATION_UNSPECIFIED = 0,
78
- GAUGE_AGGREGATION_LAST = 1,
79
- GAUGE_AGGREGATION_AVG = 2,
80
- GAUGE_AGGREGATION_MIN = 3,
81
- GAUGE_AGGREGATION_MAX = 4,
82
- GAUGE_AGGREGATION_SUM = 5,
83
- GAUGE_AGGREGATION_COUNT = 6,
84
- UNRECOGNIZED = -1,
85
- }
86
-
87
- export function gaugeAggregationFromJSON(object: any): GaugeAggregation {
88
- switch (object) {
89
- case 0:
90
- case "GAUGE_AGGREGATION_UNSPECIFIED":
91
- return GaugeAggregation.GAUGE_AGGREGATION_UNSPECIFIED;
92
- case 1:
93
- case "GAUGE_AGGREGATION_LAST":
94
- return GaugeAggregation.GAUGE_AGGREGATION_LAST;
95
- case 2:
96
- case "GAUGE_AGGREGATION_AVG":
97
- return GaugeAggregation.GAUGE_AGGREGATION_AVG;
98
- case 3:
99
- case "GAUGE_AGGREGATION_MIN":
100
- return GaugeAggregation.GAUGE_AGGREGATION_MIN;
101
- case 4:
102
- case "GAUGE_AGGREGATION_MAX":
103
- return GaugeAggregation.GAUGE_AGGREGATION_MAX;
104
- case 5:
105
- case "GAUGE_AGGREGATION_SUM":
106
- return GaugeAggregation.GAUGE_AGGREGATION_SUM;
107
- case 6:
108
- case "GAUGE_AGGREGATION_COUNT":
109
- return GaugeAggregation.GAUGE_AGGREGATION_COUNT;
110
- case -1:
111
- case "UNRECOGNIZED":
112
- default:
113
- return GaugeAggregation.UNRECOGNIZED;
114
- }
115
- }
116
-
117
- export function gaugeAggregationToJSON(object: GaugeAggregation): string {
118
- switch (object) {
119
- case GaugeAggregation.GAUGE_AGGREGATION_UNSPECIFIED:
120
- return "GAUGE_AGGREGATION_UNSPECIFIED";
121
- case GaugeAggregation.GAUGE_AGGREGATION_LAST:
122
- return "GAUGE_AGGREGATION_LAST";
123
- case GaugeAggregation.GAUGE_AGGREGATION_AVG:
124
- return "GAUGE_AGGREGATION_AVG";
125
- case GaugeAggregation.GAUGE_AGGREGATION_MIN:
126
- return "GAUGE_AGGREGATION_MIN";
127
- case GaugeAggregation.GAUGE_AGGREGATION_MAX:
128
- return "GAUGE_AGGREGATION_MAX";
129
- case GaugeAggregation.GAUGE_AGGREGATION_SUM:
130
- return "GAUGE_AGGREGATION_SUM";
131
- case GaugeAggregation.GAUGE_AGGREGATION_COUNT:
132
- return "GAUGE_AGGREGATION_COUNT";
133
- case GaugeAggregation.UNRECOGNIZED:
134
- default:
135
- return "UNRECOGNIZED";
136
- }
137
- }
138
-
139
- export enum SumAggregation {
140
- SUM_AGGREGATION_UNSPECIFIED = 0,
141
- /** SUM_AGGREGATION_RATE - Per-second rate from monotonic deltas. */
142
- SUM_AGGREGATION_RATE = 1,
143
- /** SUM_AGGREGATION_INCREASE - Windowed total (sum of per-point deltas). */
144
- SUM_AGGREGATION_INCREASE = 2,
145
- /** SUM_AGGREGATION_LAST - Latest cumulative value in each bucket. */
146
- SUM_AGGREGATION_LAST = 3,
147
- SUM_AGGREGATION_COUNT = 4,
148
- UNRECOGNIZED = -1,
149
- }
150
-
151
- export function sumAggregationFromJSON(object: any): SumAggregation {
152
- switch (object) {
153
- case 0:
154
- case "SUM_AGGREGATION_UNSPECIFIED":
155
- return SumAggregation.SUM_AGGREGATION_UNSPECIFIED;
156
- case 1:
157
- case "SUM_AGGREGATION_RATE":
158
- return SumAggregation.SUM_AGGREGATION_RATE;
159
- case 2:
160
- case "SUM_AGGREGATION_INCREASE":
161
- return SumAggregation.SUM_AGGREGATION_INCREASE;
162
- case 3:
163
- case "SUM_AGGREGATION_LAST":
164
- return SumAggregation.SUM_AGGREGATION_LAST;
165
- case 4:
166
- case "SUM_AGGREGATION_COUNT":
167
- return SumAggregation.SUM_AGGREGATION_COUNT;
168
- case -1:
169
- case "UNRECOGNIZED":
170
- default:
171
- return SumAggregation.UNRECOGNIZED;
172
- }
173
- }
174
-
175
- export function sumAggregationToJSON(object: SumAggregation): string {
176
- switch (object) {
177
- case SumAggregation.SUM_AGGREGATION_UNSPECIFIED:
178
- return "SUM_AGGREGATION_UNSPECIFIED";
179
- case SumAggregation.SUM_AGGREGATION_RATE:
180
- return "SUM_AGGREGATION_RATE";
181
- case SumAggregation.SUM_AGGREGATION_INCREASE:
182
- return "SUM_AGGREGATION_INCREASE";
183
- case SumAggregation.SUM_AGGREGATION_LAST:
184
- return "SUM_AGGREGATION_LAST";
185
- case SumAggregation.SUM_AGGREGATION_COUNT:
186
- return "SUM_AGGREGATION_COUNT";
187
- case SumAggregation.UNRECOGNIZED:
188
- default:
189
- return "UNRECOGNIZED";
190
- }
191
- }
192
-
193
- export enum HistogramAggregation {
194
- HISTOGRAM_AGGREGATION_UNSPECIFIED = 0,
195
- /** HISTOGRAM_AGGREGATION_QUANTILE - Interpolated percentile; reads HistogramQuerySpec.quantile. */
196
- HISTOGRAM_AGGREGATION_QUANTILE = 1,
197
- HISTOGRAM_AGGREGATION_AVG = 2,
198
- HISTOGRAM_AGGREGATION_MIN = 3,
199
- HISTOGRAM_AGGREGATION_MAX = 4,
200
- HISTOGRAM_AGGREGATION_COUNT = 5,
201
- UNRECOGNIZED = -1,
202
- }
203
-
204
- export function histogramAggregationFromJSON(object: any): HistogramAggregation {
205
- switch (object) {
206
- case 0:
207
- case "HISTOGRAM_AGGREGATION_UNSPECIFIED":
208
- return HistogramAggregation.HISTOGRAM_AGGREGATION_UNSPECIFIED;
209
- case 1:
210
- case "HISTOGRAM_AGGREGATION_QUANTILE":
211
- return HistogramAggregation.HISTOGRAM_AGGREGATION_QUANTILE;
212
- case 2:
213
- case "HISTOGRAM_AGGREGATION_AVG":
214
- return HistogramAggregation.HISTOGRAM_AGGREGATION_AVG;
215
- case 3:
216
- case "HISTOGRAM_AGGREGATION_MIN":
217
- return HistogramAggregation.HISTOGRAM_AGGREGATION_MIN;
218
- case 4:
219
- case "HISTOGRAM_AGGREGATION_MAX":
220
- return HistogramAggregation.HISTOGRAM_AGGREGATION_MAX;
221
- case 5:
222
- case "HISTOGRAM_AGGREGATION_COUNT":
223
- return HistogramAggregation.HISTOGRAM_AGGREGATION_COUNT;
224
- case -1:
225
- case "UNRECOGNIZED":
226
- default:
227
- return HistogramAggregation.UNRECOGNIZED;
228
- }
229
- }
230
-
231
- export function histogramAggregationToJSON(object: HistogramAggregation): string {
232
- switch (object) {
233
- case HistogramAggregation.HISTOGRAM_AGGREGATION_UNSPECIFIED:
234
- return "HISTOGRAM_AGGREGATION_UNSPECIFIED";
235
- case HistogramAggregation.HISTOGRAM_AGGREGATION_QUANTILE:
236
- return "HISTOGRAM_AGGREGATION_QUANTILE";
237
- case HistogramAggregation.HISTOGRAM_AGGREGATION_AVG:
238
- return "HISTOGRAM_AGGREGATION_AVG";
239
- case HistogramAggregation.HISTOGRAM_AGGREGATION_MIN:
240
- return "HISTOGRAM_AGGREGATION_MIN";
241
- case HistogramAggregation.HISTOGRAM_AGGREGATION_MAX:
242
- return "HISTOGRAM_AGGREGATION_MAX";
243
- case HistogramAggregation.HISTOGRAM_AGGREGATION_COUNT:
244
- return "HISTOGRAM_AGGREGATION_COUNT";
245
- case HistogramAggregation.UNRECOGNIZED:
246
- default:
247
- return "UNRECOGNIZED";
248
- }
249
- }
250
-
251
- export enum ExponentialHistogramAggregation {
252
- EXPONENTIAL_HISTOGRAM_AGGREGATION_UNSPECIFIED = 0,
253
- /** EXPONENTIAL_HISTOGRAM_AGGREGATION_QUANTILE - Percentile from exponential buckets; reads ExponentialHistogramQuerySpec.quantile. */
254
- EXPONENTIAL_HISTOGRAM_AGGREGATION_QUANTILE = 1,
255
- EXPONENTIAL_HISTOGRAM_AGGREGATION_AVG = 2,
256
- EXPONENTIAL_HISTOGRAM_AGGREGATION_MIN = 3,
257
- EXPONENTIAL_HISTOGRAM_AGGREGATION_MAX = 4,
258
- EXPONENTIAL_HISTOGRAM_AGGREGATION_COUNT = 5,
259
- UNRECOGNIZED = -1,
260
- }
261
-
262
- export function exponentialHistogramAggregationFromJSON(object: any): ExponentialHistogramAggregation {
263
- switch (object) {
264
- case 0:
265
- case "EXPONENTIAL_HISTOGRAM_AGGREGATION_UNSPECIFIED":
266
- return ExponentialHistogramAggregation.EXPONENTIAL_HISTOGRAM_AGGREGATION_UNSPECIFIED;
267
- case 1:
268
- case "EXPONENTIAL_HISTOGRAM_AGGREGATION_QUANTILE":
269
- return ExponentialHistogramAggregation.EXPONENTIAL_HISTOGRAM_AGGREGATION_QUANTILE;
270
- case 2:
271
- case "EXPONENTIAL_HISTOGRAM_AGGREGATION_AVG":
272
- return ExponentialHistogramAggregation.EXPONENTIAL_HISTOGRAM_AGGREGATION_AVG;
273
- case 3:
274
- case "EXPONENTIAL_HISTOGRAM_AGGREGATION_MIN":
275
- return ExponentialHistogramAggregation.EXPONENTIAL_HISTOGRAM_AGGREGATION_MIN;
276
- case 4:
277
- case "EXPONENTIAL_HISTOGRAM_AGGREGATION_MAX":
278
- return ExponentialHistogramAggregation.EXPONENTIAL_HISTOGRAM_AGGREGATION_MAX;
279
- case 5:
280
- case "EXPONENTIAL_HISTOGRAM_AGGREGATION_COUNT":
281
- return ExponentialHistogramAggregation.EXPONENTIAL_HISTOGRAM_AGGREGATION_COUNT;
282
- case -1:
283
- case "UNRECOGNIZED":
284
- default:
285
- return ExponentialHistogramAggregation.UNRECOGNIZED;
286
- }
287
- }
288
-
289
- export function exponentialHistogramAggregationToJSON(object: ExponentialHistogramAggregation): string {
290
- switch (object) {
291
- case ExponentialHistogramAggregation.EXPONENTIAL_HISTOGRAM_AGGREGATION_UNSPECIFIED:
292
- return "EXPONENTIAL_HISTOGRAM_AGGREGATION_UNSPECIFIED";
293
- case ExponentialHistogramAggregation.EXPONENTIAL_HISTOGRAM_AGGREGATION_QUANTILE:
294
- return "EXPONENTIAL_HISTOGRAM_AGGREGATION_QUANTILE";
295
- case ExponentialHistogramAggregation.EXPONENTIAL_HISTOGRAM_AGGREGATION_AVG:
296
- return "EXPONENTIAL_HISTOGRAM_AGGREGATION_AVG";
297
- case ExponentialHistogramAggregation.EXPONENTIAL_HISTOGRAM_AGGREGATION_MIN:
298
- return "EXPONENTIAL_HISTOGRAM_AGGREGATION_MIN";
299
- case ExponentialHistogramAggregation.EXPONENTIAL_HISTOGRAM_AGGREGATION_MAX:
300
- return "EXPONENTIAL_HISTOGRAM_AGGREGATION_MAX";
301
- case ExponentialHistogramAggregation.EXPONENTIAL_HISTOGRAM_AGGREGATION_COUNT:
302
- return "EXPONENTIAL_HISTOGRAM_AGGREGATION_COUNT";
303
- case ExponentialHistogramAggregation.UNRECOGNIZED:
304
- default:
305
- return "UNRECOGNIZED";
306
- }
307
- }
308
-
309
- export enum AttributeFilterOp {
310
- ATTRIBUTE_FILTER_OP_UNSPECIFIED = 0,
311
- ATTRIBUTE_FILTER_OP_EQUALS = 1,
312
- ATTRIBUTE_FILTER_OP_NOT_EQUALS = 2,
313
- ATTRIBUTE_FILTER_OP_IN = 3,
314
- ATTRIBUTE_FILTER_OP_NOT_IN = 4,
315
- UNRECOGNIZED = -1,
316
- }
317
-
318
- export function attributeFilterOpFromJSON(object: any): AttributeFilterOp {
319
- switch (object) {
320
- case 0:
321
- case "ATTRIBUTE_FILTER_OP_UNSPECIFIED":
322
- return AttributeFilterOp.ATTRIBUTE_FILTER_OP_UNSPECIFIED;
323
- case 1:
324
- case "ATTRIBUTE_FILTER_OP_EQUALS":
325
- return AttributeFilterOp.ATTRIBUTE_FILTER_OP_EQUALS;
326
- case 2:
327
- case "ATTRIBUTE_FILTER_OP_NOT_EQUALS":
328
- return AttributeFilterOp.ATTRIBUTE_FILTER_OP_NOT_EQUALS;
329
- case 3:
330
- case "ATTRIBUTE_FILTER_OP_IN":
331
- return AttributeFilterOp.ATTRIBUTE_FILTER_OP_IN;
332
- case 4:
333
- case "ATTRIBUTE_FILTER_OP_NOT_IN":
334
- return AttributeFilterOp.ATTRIBUTE_FILTER_OP_NOT_IN;
335
- case -1:
336
- case "UNRECOGNIZED":
337
- default:
338
- return AttributeFilterOp.UNRECOGNIZED;
339
- }
340
- }
341
-
342
- export function attributeFilterOpToJSON(object: AttributeFilterOp): string {
343
- switch (object) {
344
- case AttributeFilterOp.ATTRIBUTE_FILTER_OP_UNSPECIFIED:
345
- return "ATTRIBUTE_FILTER_OP_UNSPECIFIED";
346
- case AttributeFilterOp.ATTRIBUTE_FILTER_OP_EQUALS:
347
- return "ATTRIBUTE_FILTER_OP_EQUALS";
348
- case AttributeFilterOp.ATTRIBUTE_FILTER_OP_NOT_EQUALS:
349
- return "ATTRIBUTE_FILTER_OP_NOT_EQUALS";
350
- case AttributeFilterOp.ATTRIBUTE_FILTER_OP_IN:
351
- return "ATTRIBUTE_FILTER_OP_IN";
352
- case AttributeFilterOp.ATTRIBUTE_FILTER_OP_NOT_IN:
353
- return "ATTRIBUTE_FILTER_OP_NOT_IN";
354
- case AttributeFilterOp.UNRECOGNIZED:
355
- default:
356
- return "UNRECOGNIZED";
357
- }
358
- }
359
-
360
76
  export enum WidgetType {
361
77
  WIDGET_TYPE_UNSPECIFIED = 0,
362
78
  /** WIDGET_TYPE_TIMESERIES - Bucketed series over the range. */
@@ -516,7 +232,11 @@ export interface StreamQueryRequest {
516
232
  /** Verified against the caller's identity before proxying. */
517
233
  organizationId: string;
518
234
  projectId: string;
519
- query: MetricQuery | undefined;
235
+ /**
236
+ * PromQL expression. A bucketed time_interval range-queries it (timeseries);
237
+ * WHOLE_RANGE evaluates it instantly at the range end (stat/pie/table).
238
+ */
239
+ promql: string;
520
240
  timeRange:
521
241
  | TimeRange
522
242
  | undefined;
@@ -527,60 +247,6 @@ export interface StreamQueryRequest {
527
247
  timeInterval: AnalyticsTimeInterval;
528
248
  }
529
249
 
530
- /**
531
- * MetricQuery is the stored, validated unit of computation: which metric, how
532
- * to aggregate it, filtered and split by attributes. The kind arm must match
533
- * the metric's catalog kind, and each arm exposes only its own aggregations.
534
- */
535
- export interface MetricQuery {
536
- metricName: string;
537
- gauge?: GaugeQuerySpec | undefined;
538
- sum?: SumQuerySpec | undefined;
539
- histogram?: HistogramQuerySpec | undefined;
540
- exponentialHistogram?:
541
- | ExponentialHistogramQuerySpec
542
- | undefined;
543
- /** ≤16 filters, ANDed. Keys resolve point attributes first, then resource. */
544
- filters: AttributeFilter[];
545
- /**
546
- * Attribute keys to split series by (≤4), same key resolution as filters.
547
- * Empty = one unlabeled series.
548
- */
549
- groupBy: string[];
550
- /**
551
- * Top-k series kept when group_by is set, ranked by aggregate magnitude
552
- * over the range. 0 = server default (10); server-capped at 50.
553
- */
554
- groupLimit: number;
555
- }
556
-
557
- export interface GaugeQuerySpec {
558
- aggregation: GaugeAggregation;
559
- }
560
-
561
- export interface SumQuerySpec {
562
- aggregation: SumAggregation;
563
- }
564
-
565
- export interface HistogramQuerySpec {
566
- aggregation: HistogramAggregation;
567
- /** Quantile level in (0,1); required iff aggregation == QUANTILE. */
568
- quantile: number;
569
- }
570
-
571
- export interface ExponentialHistogramQuerySpec {
572
- aggregation: ExponentialHistogramAggregation;
573
- /** Quantile level in (0,1); required iff aggregation == QUANTILE. */
574
- quantile: number;
575
- }
576
-
577
- export interface AttributeFilter {
578
- key: string;
579
- op: AttributeFilterOp;
580
- /** EQUALS / NOT_EQUALS use exactly one value; IN / NOT_IN use one or more. */
581
- values: string[];
582
- }
583
-
584
250
  export interface TimeRange {
585
251
  /** Relative: [now - window, now). Slides while the stream is open. */
586
252
  window?:
@@ -665,6 +331,18 @@ export interface Dashboard {
665
331
  updatedAt: Date | undefined;
666
332
  }
667
333
 
334
+ /**
335
+ * WidgetQuery is one query in a widget. Today the only query language is PromQL
336
+ * (the native `histogram_quantile(q, rate(m[w]))` and classic
337
+ * `histogram_quantile(q, sum by (le)(rate(m_bucket[w])))` histogram idioms are
338
+ * the same language — the metric store serves both series shapes). The oneof
339
+ * leaves room for other query types (a structured builder, log/trace queries)
340
+ * without reshaping the widget.
341
+ */
342
+ export interface WidgetQuery {
343
+ promql?: string | undefined;
344
+ }
345
+
668
346
  export interface Widget {
669
347
  /**
670
348
  * Client-generated, [A-Za-z0-9_-]{1,64}, unique within the dashboard — the
@@ -677,11 +355,13 @@ export interface Widget {
677
355
  | GridPos
678
356
  | undefined;
679
357
  /**
680
- * Data queries. TIMESERIES 1-4 (one plotted series set per query), STAT and
681
- * PIE exactly 1, TABLE 1-4 (one column per query), MARKDOWN none.
682
- * STAT, PIE, and TABLE queries run with a single whole-range bucket.
358
+ * Queries. TIMESERIES 1-4 (one plotted series set per query, evaluated as a
359
+ * range query over the effective window), STAT and PIE exactly 1, TABLE 1-4
360
+ * (one column per query). MARKDOWN none. STAT/PIE/TABLE evaluate the query
361
+ * instantly at the range end (write range aggregation into the PromQL, e.g.
362
+ * sum(rate(m[1h]))).
683
363
  */
684
- queries: MetricQuery[];
364
+ queries: WidgetQuery[];
685
365
  /** UNSPECIFIED = follow the view (stream override or dashboard default). */
686
366
  timeWindow: AnalyticsTimeWindow;
687
367
  /** UNSPECIFIED = server-derived from the effective range. TIMESERIES only. */
@@ -1212,689 +892,75 @@ export const StreamMetricAttributesRequest: MessageFns<StreamMetricAttributesReq
1212
892
  metricName: isSet(object.metricName)
1213
893
  ? globalThis.String(object.metricName)
1214
894
  : isSet(object.metric_name)
1215
- ? globalThis.String(object.metric_name)
1216
- : "",
1217
- };
1218
- },
1219
-
1220
- toJSON(message: StreamMetricAttributesRequest): unknown {
1221
- const obj: any = {};
1222
- if (message.organizationId !== "") {
1223
- obj.organizationId = message.organizationId;
1224
- }
1225
- if (message.projectId !== "") {
1226
- obj.projectId = message.projectId;
1227
- }
1228
- if (message.metricName !== "") {
1229
- obj.metricName = message.metricName;
1230
- }
1231
- return obj;
1232
- },
1233
-
1234
- create<I extends Exact<DeepPartial<StreamMetricAttributesRequest>, I>>(base?: I): StreamMetricAttributesRequest {
1235
- return StreamMetricAttributesRequest.fromPartial(base ?? ({} as any));
1236
- },
1237
- fromPartial<I extends Exact<DeepPartial<StreamMetricAttributesRequest>, I>>(
1238
- object: I,
1239
- ): StreamMetricAttributesRequest {
1240
- const message = createBaseStreamMetricAttributesRequest();
1241
- message.organizationId = object.organizationId ?? "";
1242
- message.projectId = object.projectId ?? "";
1243
- message.metricName = object.metricName ?? "";
1244
- return message;
1245
- },
1246
- };
1247
-
1248
- function createBaseMetricAttributeEnvelope(): MetricAttributeEnvelope {
1249
- return { snapshot: undefined, added: undefined };
1250
- }
1251
-
1252
- export const MetricAttributeEnvelope: MessageFns<MetricAttributeEnvelope> = {
1253
- encode(message: MetricAttributeEnvelope, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1254
- if (message.snapshot !== undefined) {
1255
- MetricAttributeSnapshot.encode(message.snapshot, writer.uint32(10).fork()).join();
1256
- }
1257
- if (message.added !== undefined) {
1258
- MetricAttribute.encode(message.added, writer.uint32(18).fork()).join();
1259
- }
1260
- return writer;
1261
- },
1262
-
1263
- decode(input: BinaryReader | Uint8Array, length?: number): MetricAttributeEnvelope {
1264
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1265
- const end = length === undefined ? reader.len : reader.pos + length;
1266
- const message = createBaseMetricAttributeEnvelope();
1267
- while (reader.pos < end) {
1268
- const tag = reader.uint32();
1269
- switch (tag >>> 3) {
1270
- case 1: {
1271
- if (tag !== 10) {
1272
- break;
1273
- }
1274
-
1275
- message.snapshot = MetricAttributeSnapshot.decode(reader, reader.uint32());
1276
- continue;
1277
- }
1278
- case 2: {
1279
- if (tag !== 18) {
1280
- break;
1281
- }
1282
-
1283
- message.added = MetricAttribute.decode(reader, reader.uint32());
1284
- continue;
1285
- }
1286
- }
1287
- if ((tag & 7) === 4 || tag === 0) {
1288
- break;
1289
- }
1290
- reader.skip(tag & 7);
1291
- }
1292
- return message;
1293
- },
1294
-
1295
- fromJSON(object: any): MetricAttributeEnvelope {
1296
- return {
1297
- snapshot: isSet(object.snapshot) ? MetricAttributeSnapshot.fromJSON(object.snapshot) : undefined,
1298
- added: isSet(object.added) ? MetricAttribute.fromJSON(object.added) : undefined,
1299
- };
1300
- },
1301
-
1302
- toJSON(message: MetricAttributeEnvelope): unknown {
1303
- const obj: any = {};
1304
- if (message.snapshot !== undefined) {
1305
- obj.snapshot = MetricAttributeSnapshot.toJSON(message.snapshot);
1306
- }
1307
- if (message.added !== undefined) {
1308
- obj.added = MetricAttribute.toJSON(message.added);
1309
- }
1310
- return obj;
1311
- },
1312
-
1313
- create<I extends Exact<DeepPartial<MetricAttributeEnvelope>, I>>(base?: I): MetricAttributeEnvelope {
1314
- return MetricAttributeEnvelope.fromPartial(base ?? ({} as any));
1315
- },
1316
- fromPartial<I extends Exact<DeepPartial<MetricAttributeEnvelope>, I>>(object: I): MetricAttributeEnvelope {
1317
- const message = createBaseMetricAttributeEnvelope();
1318
- message.snapshot = (object.snapshot !== undefined && object.snapshot !== null)
1319
- ? MetricAttributeSnapshot.fromPartial(object.snapshot)
1320
- : undefined;
1321
- message.added = (object.added !== undefined && object.added !== null)
1322
- ? MetricAttribute.fromPartial(object.added)
1323
- : undefined;
1324
- return message;
1325
- },
1326
- };
1327
-
1328
- function createBaseMetricAttributeSnapshot(): MetricAttributeSnapshot {
1329
- return { attributes: [] };
1330
- }
1331
-
1332
- export const MetricAttributeSnapshot: MessageFns<MetricAttributeSnapshot> = {
1333
- encode(message: MetricAttributeSnapshot, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1334
- for (const v of message.attributes) {
1335
- MetricAttribute.encode(v!, writer.uint32(10).fork()).join();
1336
- }
1337
- return writer;
1338
- },
1339
-
1340
- decode(input: BinaryReader | Uint8Array, length?: number): MetricAttributeSnapshot {
1341
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1342
- const end = length === undefined ? reader.len : reader.pos + length;
1343
- const message = createBaseMetricAttributeSnapshot();
1344
- while (reader.pos < end) {
1345
- const tag = reader.uint32();
1346
- switch (tag >>> 3) {
1347
- case 1: {
1348
- if (tag !== 10) {
1349
- break;
1350
- }
1351
-
1352
- message.attributes.push(MetricAttribute.decode(reader, reader.uint32()));
1353
- continue;
1354
- }
1355
- }
1356
- if ((tag & 7) === 4 || tag === 0) {
1357
- break;
1358
- }
1359
- reader.skip(tag & 7);
1360
- }
1361
- return message;
1362
- },
1363
-
1364
- fromJSON(object: any): MetricAttributeSnapshot {
1365
- return {
1366
- attributes: globalThis.Array.isArray(object?.attributes)
1367
- ? object.attributes.map((e: any) => MetricAttribute.fromJSON(e))
1368
- : [],
1369
- };
1370
- },
1371
-
1372
- toJSON(message: MetricAttributeSnapshot): unknown {
1373
- const obj: any = {};
1374
- if (message.attributes?.length) {
1375
- obj.attributes = message.attributes.map((e) => MetricAttribute.toJSON(e));
1376
- }
1377
- return obj;
1378
- },
1379
-
1380
- create<I extends Exact<DeepPartial<MetricAttributeSnapshot>, I>>(base?: I): MetricAttributeSnapshot {
1381
- return MetricAttributeSnapshot.fromPartial(base ?? ({} as any));
1382
- },
1383
- fromPartial<I extends Exact<DeepPartial<MetricAttributeSnapshot>, I>>(object: I): MetricAttributeSnapshot {
1384
- const message = createBaseMetricAttributeSnapshot();
1385
- message.attributes = object.attributes?.map((e) => MetricAttribute.fromPartial(e)) || [];
1386
- return message;
1387
- },
1388
- };
1389
-
1390
- function createBaseMetricAttribute(): MetricAttribute {
1391
- return { key: "", values: [] };
1392
- }
1393
-
1394
- export const MetricAttribute: MessageFns<MetricAttribute> = {
1395
- encode(message: MetricAttribute, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1396
- if (message.key !== "") {
1397
- writer.uint32(10).string(message.key);
1398
- }
1399
- for (const v of message.values) {
1400
- writer.uint32(18).string(v!);
1401
- }
1402
- return writer;
1403
- },
1404
-
1405
- decode(input: BinaryReader | Uint8Array, length?: number): MetricAttribute {
1406
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1407
- const end = length === undefined ? reader.len : reader.pos + length;
1408
- const message = createBaseMetricAttribute();
1409
- while (reader.pos < end) {
1410
- const tag = reader.uint32();
1411
- switch (tag >>> 3) {
1412
- case 1: {
1413
- if (tag !== 10) {
1414
- break;
1415
- }
1416
-
1417
- message.key = reader.string();
1418
- continue;
1419
- }
1420
- case 2: {
1421
- if (tag !== 18) {
1422
- break;
1423
- }
1424
-
1425
- message.values.push(reader.string());
1426
- continue;
1427
- }
1428
- }
1429
- if ((tag & 7) === 4 || tag === 0) {
1430
- break;
1431
- }
1432
- reader.skip(tag & 7);
1433
- }
1434
- return message;
1435
- },
1436
-
1437
- fromJSON(object: any): MetricAttribute {
1438
- return {
1439
- key: isSet(object.key) ? globalThis.String(object.key) : "",
1440
- values: globalThis.Array.isArray(object?.values) ? object.values.map((e: any) => globalThis.String(e)) : [],
1441
- };
1442
- },
1443
-
1444
- toJSON(message: MetricAttribute): unknown {
1445
- const obj: any = {};
1446
- if (message.key !== "") {
1447
- obj.key = message.key;
1448
- }
1449
- if (message.values?.length) {
1450
- obj.values = message.values;
1451
- }
1452
- return obj;
1453
- },
1454
-
1455
- create<I extends Exact<DeepPartial<MetricAttribute>, I>>(base?: I): MetricAttribute {
1456
- return MetricAttribute.fromPartial(base ?? ({} as any));
1457
- },
1458
- fromPartial<I extends Exact<DeepPartial<MetricAttribute>, I>>(object: I): MetricAttribute {
1459
- const message = createBaseMetricAttribute();
1460
- message.key = object.key ?? "";
1461
- message.values = object.values?.map((e) => e) || [];
1462
- return message;
1463
- },
1464
- };
1465
-
1466
- function createBaseStreamQueryRequest(): StreamQueryRequest {
1467
- return { organizationId: "", projectId: "", query: undefined, timeRange: undefined, timeInterval: 0 };
1468
- }
1469
-
1470
- export const StreamQueryRequest: MessageFns<StreamQueryRequest> = {
1471
- encode(message: StreamQueryRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1472
- if (message.organizationId !== "") {
1473
- writer.uint32(10).string(message.organizationId);
1474
- }
1475
- if (message.projectId !== "") {
1476
- writer.uint32(18).string(message.projectId);
1477
- }
1478
- if (message.query !== undefined) {
1479
- MetricQuery.encode(message.query, writer.uint32(26).fork()).join();
1480
- }
1481
- if (message.timeRange !== undefined) {
1482
- TimeRange.encode(message.timeRange, writer.uint32(34).fork()).join();
1483
- }
1484
- if (message.timeInterval !== 0) {
1485
- writer.uint32(40).int32(message.timeInterval);
1486
- }
1487
- return writer;
1488
- },
1489
-
1490
- decode(input: BinaryReader | Uint8Array, length?: number): StreamQueryRequest {
1491
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1492
- const end = length === undefined ? reader.len : reader.pos + length;
1493
- const message = createBaseStreamQueryRequest();
1494
- while (reader.pos < end) {
1495
- const tag = reader.uint32();
1496
- switch (tag >>> 3) {
1497
- case 1: {
1498
- if (tag !== 10) {
1499
- break;
1500
- }
1501
-
1502
- message.organizationId = reader.string();
1503
- continue;
1504
- }
1505
- case 2: {
1506
- if (tag !== 18) {
1507
- break;
1508
- }
1509
-
1510
- message.projectId = reader.string();
1511
- continue;
1512
- }
1513
- case 3: {
1514
- if (tag !== 26) {
1515
- break;
1516
- }
1517
-
1518
- message.query = MetricQuery.decode(reader, reader.uint32());
1519
- continue;
1520
- }
1521
- case 4: {
1522
- if (tag !== 34) {
1523
- break;
1524
- }
1525
-
1526
- message.timeRange = TimeRange.decode(reader, reader.uint32());
1527
- continue;
1528
- }
1529
- case 5: {
1530
- if (tag !== 40) {
1531
- break;
1532
- }
1533
-
1534
- message.timeInterval = reader.int32() as any;
1535
- continue;
1536
- }
1537
- }
1538
- if ((tag & 7) === 4 || tag === 0) {
1539
- break;
1540
- }
1541
- reader.skip(tag & 7);
1542
- }
1543
- return message;
1544
- },
1545
-
1546
- fromJSON(object: any): StreamQueryRequest {
1547
- return {
1548
- organizationId: isSet(object.organizationId)
1549
- ? globalThis.String(object.organizationId)
1550
- : isSet(object.organization_id)
1551
- ? globalThis.String(object.organization_id)
1552
- : "",
1553
- projectId: isSet(object.projectId)
1554
- ? globalThis.String(object.projectId)
1555
- : isSet(object.project_id)
1556
- ? globalThis.String(object.project_id)
1557
- : "",
1558
- query: isSet(object.query) ? MetricQuery.fromJSON(object.query) : undefined,
1559
- timeRange: isSet(object.timeRange)
1560
- ? TimeRange.fromJSON(object.timeRange)
1561
- : isSet(object.time_range)
1562
- ? TimeRange.fromJSON(object.time_range)
1563
- : undefined,
1564
- timeInterval: isSet(object.timeInterval)
1565
- ? analyticsTimeIntervalFromJSON(object.timeInterval)
1566
- : isSet(object.time_interval)
1567
- ? analyticsTimeIntervalFromJSON(object.time_interval)
1568
- : 0,
1569
- };
1570
- },
1571
-
1572
- toJSON(message: StreamQueryRequest): unknown {
1573
- const obj: any = {};
1574
- if (message.organizationId !== "") {
1575
- obj.organizationId = message.organizationId;
1576
- }
1577
- if (message.projectId !== "") {
1578
- obj.projectId = message.projectId;
1579
- }
1580
- if (message.query !== undefined) {
1581
- obj.query = MetricQuery.toJSON(message.query);
1582
- }
1583
- if (message.timeRange !== undefined) {
1584
- obj.timeRange = TimeRange.toJSON(message.timeRange);
1585
- }
1586
- if (message.timeInterval !== 0) {
1587
- obj.timeInterval = analyticsTimeIntervalToJSON(message.timeInterval);
1588
- }
1589
- return obj;
1590
- },
1591
-
1592
- create<I extends Exact<DeepPartial<StreamQueryRequest>, I>>(base?: I): StreamQueryRequest {
1593
- return StreamQueryRequest.fromPartial(base ?? ({} as any));
1594
- },
1595
- fromPartial<I extends Exact<DeepPartial<StreamQueryRequest>, I>>(object: I): StreamQueryRequest {
1596
- const message = createBaseStreamQueryRequest();
1597
- message.organizationId = object.organizationId ?? "";
1598
- message.projectId = object.projectId ?? "";
1599
- message.query = (object.query !== undefined && object.query !== null)
1600
- ? MetricQuery.fromPartial(object.query)
1601
- : undefined;
1602
- message.timeRange = (object.timeRange !== undefined && object.timeRange !== null)
1603
- ? TimeRange.fromPartial(object.timeRange)
1604
- : undefined;
1605
- message.timeInterval = object.timeInterval ?? 0;
1606
- return message;
1607
- },
1608
- };
1609
-
1610
- function createBaseMetricQuery(): MetricQuery {
1611
- return {
1612
- metricName: "",
1613
- gauge: undefined,
1614
- sum: undefined,
1615
- histogram: undefined,
1616
- exponentialHistogram: undefined,
1617
- filters: [],
1618
- groupBy: [],
1619
- groupLimit: 0,
1620
- };
1621
- }
1622
-
1623
- export const MetricQuery: MessageFns<MetricQuery> = {
1624
- encode(message: MetricQuery, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1625
- if (message.metricName !== "") {
1626
- writer.uint32(10).string(message.metricName);
1627
- }
1628
- if (message.gauge !== undefined) {
1629
- GaugeQuerySpec.encode(message.gauge, writer.uint32(18).fork()).join();
1630
- }
1631
- if (message.sum !== undefined) {
1632
- SumQuerySpec.encode(message.sum, writer.uint32(26).fork()).join();
1633
- }
1634
- if (message.histogram !== undefined) {
1635
- HistogramQuerySpec.encode(message.histogram, writer.uint32(34).fork()).join();
1636
- }
1637
- if (message.exponentialHistogram !== undefined) {
1638
- ExponentialHistogramQuerySpec.encode(message.exponentialHistogram, writer.uint32(66).fork()).join();
1639
- }
1640
- for (const v of message.filters) {
1641
- AttributeFilter.encode(v!, writer.uint32(42).fork()).join();
1642
- }
1643
- for (const v of message.groupBy) {
1644
- writer.uint32(50).string(v!);
1645
- }
1646
- if (message.groupLimit !== 0) {
1647
- writer.uint32(56).int32(message.groupLimit);
1648
- }
1649
- return writer;
1650
- },
1651
-
1652
- decode(input: BinaryReader | Uint8Array, length?: number): MetricQuery {
1653
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1654
- const end = length === undefined ? reader.len : reader.pos + length;
1655
- const message = createBaseMetricQuery();
1656
- while (reader.pos < end) {
1657
- const tag = reader.uint32();
1658
- switch (tag >>> 3) {
1659
- case 1: {
1660
- if (tag !== 10) {
1661
- break;
1662
- }
1663
-
1664
- message.metricName = reader.string();
1665
- continue;
1666
- }
1667
- case 2: {
1668
- if (tag !== 18) {
1669
- break;
1670
- }
1671
-
1672
- message.gauge = GaugeQuerySpec.decode(reader, reader.uint32());
1673
- continue;
1674
- }
1675
- case 3: {
1676
- if (tag !== 26) {
1677
- break;
1678
- }
1679
-
1680
- message.sum = SumQuerySpec.decode(reader, reader.uint32());
1681
- continue;
1682
- }
1683
- case 4: {
1684
- if (tag !== 34) {
1685
- break;
1686
- }
1687
-
1688
- message.histogram = HistogramQuerySpec.decode(reader, reader.uint32());
1689
- continue;
1690
- }
1691
- case 8: {
1692
- if (tag !== 66) {
1693
- break;
1694
- }
1695
-
1696
- message.exponentialHistogram = ExponentialHistogramQuerySpec.decode(reader, reader.uint32());
1697
- continue;
1698
- }
1699
- case 5: {
1700
- if (tag !== 42) {
1701
- break;
1702
- }
1703
-
1704
- message.filters.push(AttributeFilter.decode(reader, reader.uint32()));
1705
- continue;
1706
- }
1707
- case 6: {
1708
- if (tag !== 50) {
1709
- break;
1710
- }
1711
-
1712
- message.groupBy.push(reader.string());
1713
- continue;
1714
- }
1715
- case 7: {
1716
- if (tag !== 56) {
1717
- break;
1718
- }
1719
-
1720
- message.groupLimit = reader.int32();
1721
- continue;
1722
- }
1723
- }
1724
- if ((tag & 7) === 4 || tag === 0) {
1725
- break;
1726
- }
1727
- reader.skip(tag & 7);
1728
- }
1729
- return message;
1730
- },
1731
-
1732
- fromJSON(object: any): MetricQuery {
1733
- return {
1734
- metricName: isSet(object.metricName)
1735
- ? globalThis.String(object.metricName)
1736
- : isSet(object.metric_name)
1737
- ? globalThis.String(object.metric_name)
1738
- : "",
1739
- gauge: isSet(object.gauge) ? GaugeQuerySpec.fromJSON(object.gauge) : undefined,
1740
- sum: isSet(object.sum) ? SumQuerySpec.fromJSON(object.sum) : undefined,
1741
- histogram: isSet(object.histogram) ? HistogramQuerySpec.fromJSON(object.histogram) : undefined,
1742
- exponentialHistogram: isSet(object.exponentialHistogram)
1743
- ? ExponentialHistogramQuerySpec.fromJSON(object.exponentialHistogram)
1744
- : isSet(object.exponential_histogram)
1745
- ? ExponentialHistogramQuerySpec.fromJSON(object.exponential_histogram)
1746
- : undefined,
1747
- filters: globalThis.Array.isArray(object?.filters)
1748
- ? object.filters.map((e: any) => AttributeFilter.fromJSON(e))
1749
- : [],
1750
- groupBy: globalThis.Array.isArray(object?.groupBy)
1751
- ? object.groupBy.map((e: any) => globalThis.String(e))
1752
- : globalThis.Array.isArray(object?.group_by)
1753
- ? object.group_by.map((e: any) => globalThis.String(e))
1754
- : [],
1755
- groupLimit: isSet(object.groupLimit)
1756
- ? globalThis.Number(object.groupLimit)
1757
- : isSet(object.group_limit)
1758
- ? globalThis.Number(object.group_limit)
1759
- : 0,
1760
- };
1761
- },
1762
-
1763
- toJSON(message: MetricQuery): unknown {
1764
- const obj: any = {};
1765
- if (message.metricName !== "") {
1766
- obj.metricName = message.metricName;
1767
- }
1768
- if (message.gauge !== undefined) {
1769
- obj.gauge = GaugeQuerySpec.toJSON(message.gauge);
1770
- }
1771
- if (message.sum !== undefined) {
1772
- obj.sum = SumQuerySpec.toJSON(message.sum);
1773
- }
1774
- if (message.histogram !== undefined) {
1775
- obj.histogram = HistogramQuerySpec.toJSON(message.histogram);
1776
- }
1777
- if (message.exponentialHistogram !== undefined) {
1778
- obj.exponentialHistogram = ExponentialHistogramQuerySpec.toJSON(message.exponentialHistogram);
1779
- }
1780
- if (message.filters?.length) {
1781
- obj.filters = message.filters.map((e) => AttributeFilter.toJSON(e));
1782
- }
1783
- if (message.groupBy?.length) {
1784
- obj.groupBy = message.groupBy;
1785
- }
1786
- if (message.groupLimit !== 0) {
1787
- obj.groupLimit = Math.round(message.groupLimit);
1788
- }
1789
- return obj;
1790
- },
1791
-
1792
- create<I extends Exact<DeepPartial<MetricQuery>, I>>(base?: I): MetricQuery {
1793
- return MetricQuery.fromPartial(base ?? ({} as any));
1794
- },
1795
- fromPartial<I extends Exact<DeepPartial<MetricQuery>, I>>(object: I): MetricQuery {
1796
- const message = createBaseMetricQuery();
1797
- message.metricName = object.metricName ?? "";
1798
- message.gauge = (object.gauge !== undefined && object.gauge !== null)
1799
- ? GaugeQuerySpec.fromPartial(object.gauge)
1800
- : undefined;
1801
- message.sum = (object.sum !== undefined && object.sum !== null) ? SumQuerySpec.fromPartial(object.sum) : undefined;
1802
- message.histogram = (object.histogram !== undefined && object.histogram !== null)
1803
- ? HistogramQuerySpec.fromPartial(object.histogram)
1804
- : undefined;
1805
- message.exponentialHistogram = (object.exponentialHistogram !== undefined && object.exponentialHistogram !== null)
1806
- ? ExponentialHistogramQuerySpec.fromPartial(object.exponentialHistogram)
1807
- : undefined;
1808
- message.filters = object.filters?.map((e) => AttributeFilter.fromPartial(e)) || [];
1809
- message.groupBy = object.groupBy?.map((e) => e) || [];
1810
- message.groupLimit = object.groupLimit ?? 0;
1811
- return message;
1812
- },
1813
- };
1814
-
1815
- function createBaseGaugeQuerySpec(): GaugeQuerySpec {
1816
- return { aggregation: 0 };
1817
- }
1818
-
1819
- export const GaugeQuerySpec: MessageFns<GaugeQuerySpec> = {
1820
- encode(message: GaugeQuerySpec, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1821
- if (message.aggregation !== 0) {
1822
- writer.uint32(8).int32(message.aggregation);
1823
- }
1824
- return writer;
1825
- },
1826
-
1827
- decode(input: BinaryReader | Uint8Array, length?: number): GaugeQuerySpec {
1828
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1829
- const end = length === undefined ? reader.len : reader.pos + length;
1830
- const message = createBaseGaugeQuerySpec();
1831
- while (reader.pos < end) {
1832
- const tag = reader.uint32();
1833
- switch (tag >>> 3) {
1834
- case 1: {
1835
- if (tag !== 8) {
1836
- break;
1837
- }
1838
-
1839
- message.aggregation = reader.int32() as any;
1840
- continue;
1841
- }
1842
- }
1843
- if ((tag & 7) === 4 || tag === 0) {
1844
- break;
1845
- }
1846
- reader.skip(tag & 7);
1847
- }
1848
- return message;
1849
- },
1850
-
1851
- fromJSON(object: any): GaugeQuerySpec {
1852
- return { aggregation: isSet(object.aggregation) ? gaugeAggregationFromJSON(object.aggregation) : 0 };
895
+ ? globalThis.String(object.metric_name)
896
+ : "",
897
+ };
1853
898
  },
1854
899
 
1855
- toJSON(message: GaugeQuerySpec): unknown {
900
+ toJSON(message: StreamMetricAttributesRequest): unknown {
1856
901
  const obj: any = {};
1857
- if (message.aggregation !== 0) {
1858
- obj.aggregation = gaugeAggregationToJSON(message.aggregation);
902
+ if (message.organizationId !== "") {
903
+ obj.organizationId = message.organizationId;
904
+ }
905
+ if (message.projectId !== "") {
906
+ obj.projectId = message.projectId;
907
+ }
908
+ if (message.metricName !== "") {
909
+ obj.metricName = message.metricName;
1859
910
  }
1860
911
  return obj;
1861
912
  },
1862
913
 
1863
- create<I extends Exact<DeepPartial<GaugeQuerySpec>, I>>(base?: I): GaugeQuerySpec {
1864
- return GaugeQuerySpec.fromPartial(base ?? ({} as any));
914
+ create<I extends Exact<DeepPartial<StreamMetricAttributesRequest>, I>>(base?: I): StreamMetricAttributesRequest {
915
+ return StreamMetricAttributesRequest.fromPartial(base ?? ({} as any));
1865
916
  },
1866
- fromPartial<I extends Exact<DeepPartial<GaugeQuerySpec>, I>>(object: I): GaugeQuerySpec {
1867
- const message = createBaseGaugeQuerySpec();
1868
- message.aggregation = object.aggregation ?? 0;
917
+ fromPartial<I extends Exact<DeepPartial<StreamMetricAttributesRequest>, I>>(
918
+ object: I,
919
+ ): StreamMetricAttributesRequest {
920
+ const message = createBaseStreamMetricAttributesRequest();
921
+ message.organizationId = object.organizationId ?? "";
922
+ message.projectId = object.projectId ?? "";
923
+ message.metricName = object.metricName ?? "";
1869
924
  return message;
1870
925
  },
1871
926
  };
1872
927
 
1873
- function createBaseSumQuerySpec(): SumQuerySpec {
1874
- return { aggregation: 0 };
928
+ function createBaseMetricAttributeEnvelope(): MetricAttributeEnvelope {
929
+ return { snapshot: undefined, added: undefined };
1875
930
  }
1876
931
 
1877
- export const SumQuerySpec: MessageFns<SumQuerySpec> = {
1878
- encode(message: SumQuerySpec, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1879
- if (message.aggregation !== 0) {
1880
- writer.uint32(8).int32(message.aggregation);
932
+ export const MetricAttributeEnvelope: MessageFns<MetricAttributeEnvelope> = {
933
+ encode(message: MetricAttributeEnvelope, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
934
+ if (message.snapshot !== undefined) {
935
+ MetricAttributeSnapshot.encode(message.snapshot, writer.uint32(10).fork()).join();
936
+ }
937
+ if (message.added !== undefined) {
938
+ MetricAttribute.encode(message.added, writer.uint32(18).fork()).join();
1881
939
  }
1882
940
  return writer;
1883
941
  },
1884
942
 
1885
- decode(input: BinaryReader | Uint8Array, length?: number): SumQuerySpec {
943
+ decode(input: BinaryReader | Uint8Array, length?: number): MetricAttributeEnvelope {
1886
944
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1887
945
  const end = length === undefined ? reader.len : reader.pos + length;
1888
- const message = createBaseSumQuerySpec();
946
+ const message = createBaseMetricAttributeEnvelope();
1889
947
  while (reader.pos < end) {
1890
948
  const tag = reader.uint32();
1891
949
  switch (tag >>> 3) {
1892
950
  case 1: {
1893
- if (tag !== 8) {
951
+ if (tag !== 10) {
952
+ break;
953
+ }
954
+
955
+ message.snapshot = MetricAttributeSnapshot.decode(reader, reader.uint32());
956
+ continue;
957
+ }
958
+ case 2: {
959
+ if (tag !== 18) {
1894
960
  break;
1895
961
  }
1896
962
 
1897
- message.aggregation = reader.int32() as any;
963
+ message.added = MetricAttribute.decode(reader, reader.uint32());
1898
964
  continue;
1899
965
  }
1900
966
  }
@@ -1906,64 +972,64 @@ export const SumQuerySpec: MessageFns<SumQuerySpec> = {
1906
972
  return message;
1907
973
  },
1908
974
 
1909
- fromJSON(object: any): SumQuerySpec {
1910
- return { aggregation: isSet(object.aggregation) ? sumAggregationFromJSON(object.aggregation) : 0 };
975
+ fromJSON(object: any): MetricAttributeEnvelope {
976
+ return {
977
+ snapshot: isSet(object.snapshot) ? MetricAttributeSnapshot.fromJSON(object.snapshot) : undefined,
978
+ added: isSet(object.added) ? MetricAttribute.fromJSON(object.added) : undefined,
979
+ };
1911
980
  },
1912
981
 
1913
- toJSON(message: SumQuerySpec): unknown {
982
+ toJSON(message: MetricAttributeEnvelope): unknown {
1914
983
  const obj: any = {};
1915
- if (message.aggregation !== 0) {
1916
- obj.aggregation = sumAggregationToJSON(message.aggregation);
984
+ if (message.snapshot !== undefined) {
985
+ obj.snapshot = MetricAttributeSnapshot.toJSON(message.snapshot);
986
+ }
987
+ if (message.added !== undefined) {
988
+ obj.added = MetricAttribute.toJSON(message.added);
1917
989
  }
1918
990
  return obj;
1919
991
  },
1920
992
 
1921
- create<I extends Exact<DeepPartial<SumQuerySpec>, I>>(base?: I): SumQuerySpec {
1922
- return SumQuerySpec.fromPartial(base ?? ({} as any));
993
+ create<I extends Exact<DeepPartial<MetricAttributeEnvelope>, I>>(base?: I): MetricAttributeEnvelope {
994
+ return MetricAttributeEnvelope.fromPartial(base ?? ({} as any));
1923
995
  },
1924
- fromPartial<I extends Exact<DeepPartial<SumQuerySpec>, I>>(object: I): SumQuerySpec {
1925
- const message = createBaseSumQuerySpec();
1926
- message.aggregation = object.aggregation ?? 0;
996
+ fromPartial<I extends Exact<DeepPartial<MetricAttributeEnvelope>, I>>(object: I): MetricAttributeEnvelope {
997
+ const message = createBaseMetricAttributeEnvelope();
998
+ message.snapshot = (object.snapshot !== undefined && object.snapshot !== null)
999
+ ? MetricAttributeSnapshot.fromPartial(object.snapshot)
1000
+ : undefined;
1001
+ message.added = (object.added !== undefined && object.added !== null)
1002
+ ? MetricAttribute.fromPartial(object.added)
1003
+ : undefined;
1927
1004
  return message;
1928
1005
  },
1929
1006
  };
1930
1007
 
1931
- function createBaseHistogramQuerySpec(): HistogramQuerySpec {
1932
- return { aggregation: 0, quantile: 0 };
1008
+ function createBaseMetricAttributeSnapshot(): MetricAttributeSnapshot {
1009
+ return { attributes: [] };
1933
1010
  }
1934
1011
 
1935
- export const HistogramQuerySpec: MessageFns<HistogramQuerySpec> = {
1936
- encode(message: HistogramQuerySpec, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1937
- if (message.aggregation !== 0) {
1938
- writer.uint32(8).int32(message.aggregation);
1939
- }
1940
- if (message.quantile !== 0) {
1941
- writer.uint32(17).double(message.quantile);
1012
+ export const MetricAttributeSnapshot: MessageFns<MetricAttributeSnapshot> = {
1013
+ encode(message: MetricAttributeSnapshot, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1014
+ for (const v of message.attributes) {
1015
+ MetricAttribute.encode(v!, writer.uint32(10).fork()).join();
1942
1016
  }
1943
1017
  return writer;
1944
1018
  },
1945
1019
 
1946
- decode(input: BinaryReader | Uint8Array, length?: number): HistogramQuerySpec {
1020
+ decode(input: BinaryReader | Uint8Array, length?: number): MetricAttributeSnapshot {
1947
1021
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1948
1022
  const end = length === undefined ? reader.len : reader.pos + length;
1949
- const message = createBaseHistogramQuerySpec();
1023
+ const message = createBaseMetricAttributeSnapshot();
1950
1024
  while (reader.pos < end) {
1951
1025
  const tag = reader.uint32();
1952
1026
  switch (tag >>> 3) {
1953
1027
  case 1: {
1954
- if (tag !== 8) {
1955
- break;
1956
- }
1957
-
1958
- message.aggregation = reader.int32() as any;
1959
- continue;
1960
- }
1961
- case 2: {
1962
- if (tag !== 17) {
1028
+ if (tag !== 10) {
1963
1029
  break;
1964
1030
  }
1965
1031
 
1966
- message.quantile = reader.double();
1032
+ message.attributes.push(MetricAttribute.decode(reader, reader.uint32()));
1967
1033
  continue;
1968
1034
  }
1969
1035
  }
@@ -1975,71 +1041,68 @@ export const HistogramQuerySpec: MessageFns<HistogramQuerySpec> = {
1975
1041
  return message;
1976
1042
  },
1977
1043
 
1978
- fromJSON(object: any): HistogramQuerySpec {
1044
+ fromJSON(object: any): MetricAttributeSnapshot {
1979
1045
  return {
1980
- aggregation: isSet(object.aggregation) ? histogramAggregationFromJSON(object.aggregation) : 0,
1981
- quantile: isSet(object.quantile) ? globalThis.Number(object.quantile) : 0,
1046
+ attributes: globalThis.Array.isArray(object?.attributes)
1047
+ ? object.attributes.map((e: any) => MetricAttribute.fromJSON(e))
1048
+ : [],
1982
1049
  };
1983
1050
  },
1984
1051
 
1985
- toJSON(message: HistogramQuerySpec): unknown {
1052
+ toJSON(message: MetricAttributeSnapshot): unknown {
1986
1053
  const obj: any = {};
1987
- if (message.aggregation !== 0) {
1988
- obj.aggregation = histogramAggregationToJSON(message.aggregation);
1989
- }
1990
- if (message.quantile !== 0) {
1991
- obj.quantile = message.quantile;
1054
+ if (message.attributes?.length) {
1055
+ obj.attributes = message.attributes.map((e) => MetricAttribute.toJSON(e));
1992
1056
  }
1993
1057
  return obj;
1994
1058
  },
1995
1059
 
1996
- create<I extends Exact<DeepPartial<HistogramQuerySpec>, I>>(base?: I): HistogramQuerySpec {
1997
- return HistogramQuerySpec.fromPartial(base ?? ({} as any));
1060
+ create<I extends Exact<DeepPartial<MetricAttributeSnapshot>, I>>(base?: I): MetricAttributeSnapshot {
1061
+ return MetricAttributeSnapshot.fromPartial(base ?? ({} as any));
1998
1062
  },
1999
- fromPartial<I extends Exact<DeepPartial<HistogramQuerySpec>, I>>(object: I): HistogramQuerySpec {
2000
- const message = createBaseHistogramQuerySpec();
2001
- message.aggregation = object.aggregation ?? 0;
2002
- message.quantile = object.quantile ?? 0;
1063
+ fromPartial<I extends Exact<DeepPartial<MetricAttributeSnapshot>, I>>(object: I): MetricAttributeSnapshot {
1064
+ const message = createBaseMetricAttributeSnapshot();
1065
+ message.attributes = object.attributes?.map((e) => MetricAttribute.fromPartial(e)) || [];
2003
1066
  return message;
2004
1067
  },
2005
1068
  };
2006
1069
 
2007
- function createBaseExponentialHistogramQuerySpec(): ExponentialHistogramQuerySpec {
2008
- return { aggregation: 0, quantile: 0 };
1070
+ function createBaseMetricAttribute(): MetricAttribute {
1071
+ return { key: "", values: [] };
2009
1072
  }
2010
1073
 
2011
- export const ExponentialHistogramQuerySpec: MessageFns<ExponentialHistogramQuerySpec> = {
2012
- encode(message: ExponentialHistogramQuerySpec, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2013
- if (message.aggregation !== 0) {
2014
- writer.uint32(8).int32(message.aggregation);
1074
+ export const MetricAttribute: MessageFns<MetricAttribute> = {
1075
+ encode(message: MetricAttribute, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1076
+ if (message.key !== "") {
1077
+ writer.uint32(10).string(message.key);
2015
1078
  }
2016
- if (message.quantile !== 0) {
2017
- writer.uint32(17).double(message.quantile);
1079
+ for (const v of message.values) {
1080
+ writer.uint32(18).string(v!);
2018
1081
  }
2019
1082
  return writer;
2020
1083
  },
2021
1084
 
2022
- decode(input: BinaryReader | Uint8Array, length?: number): ExponentialHistogramQuerySpec {
1085
+ decode(input: BinaryReader | Uint8Array, length?: number): MetricAttribute {
2023
1086
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2024
1087
  const end = length === undefined ? reader.len : reader.pos + length;
2025
- const message = createBaseExponentialHistogramQuerySpec();
1088
+ const message = createBaseMetricAttribute();
2026
1089
  while (reader.pos < end) {
2027
1090
  const tag = reader.uint32();
2028
1091
  switch (tag >>> 3) {
2029
1092
  case 1: {
2030
- if (tag !== 8) {
1093
+ if (tag !== 10) {
2031
1094
  break;
2032
1095
  }
2033
1096
 
2034
- message.aggregation = reader.int32() as any;
1097
+ message.key = reader.string();
2035
1098
  continue;
2036
1099
  }
2037
1100
  case 2: {
2038
- if (tag !== 17) {
1101
+ if (tag !== 18) {
2039
1102
  break;
2040
1103
  }
2041
1104
 
2042
- message.quantile = reader.double();
1105
+ message.values.push(reader.string());
2043
1106
  continue;
2044
1107
  }
2045
1108
  }
@@ -2051,59 +1114,63 @@ export const ExponentialHistogramQuerySpec: MessageFns<ExponentialHistogramQuery
2051
1114
  return message;
2052
1115
  },
2053
1116
 
2054
- fromJSON(object: any): ExponentialHistogramQuerySpec {
1117
+ fromJSON(object: any): MetricAttribute {
2055
1118
  return {
2056
- aggregation: isSet(object.aggregation) ? exponentialHistogramAggregationFromJSON(object.aggregation) : 0,
2057
- quantile: isSet(object.quantile) ? globalThis.Number(object.quantile) : 0,
1119
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
1120
+ values: globalThis.Array.isArray(object?.values) ? object.values.map((e: any) => globalThis.String(e)) : [],
2058
1121
  };
2059
1122
  },
2060
1123
 
2061
- toJSON(message: ExponentialHistogramQuerySpec): unknown {
1124
+ toJSON(message: MetricAttribute): unknown {
2062
1125
  const obj: any = {};
2063
- if (message.aggregation !== 0) {
2064
- obj.aggregation = exponentialHistogramAggregationToJSON(message.aggregation);
1126
+ if (message.key !== "") {
1127
+ obj.key = message.key;
2065
1128
  }
2066
- if (message.quantile !== 0) {
2067
- obj.quantile = message.quantile;
1129
+ if (message.values?.length) {
1130
+ obj.values = message.values;
2068
1131
  }
2069
1132
  return obj;
2070
1133
  },
2071
1134
 
2072
- create<I extends Exact<DeepPartial<ExponentialHistogramQuerySpec>, I>>(base?: I): ExponentialHistogramQuerySpec {
2073
- return ExponentialHistogramQuerySpec.fromPartial(base ?? ({} as any));
1135
+ create<I extends Exact<DeepPartial<MetricAttribute>, I>>(base?: I): MetricAttribute {
1136
+ return MetricAttribute.fromPartial(base ?? ({} as any));
2074
1137
  },
2075
- fromPartial<I extends Exact<DeepPartial<ExponentialHistogramQuerySpec>, I>>(
2076
- object: I,
2077
- ): ExponentialHistogramQuerySpec {
2078
- const message = createBaseExponentialHistogramQuerySpec();
2079
- message.aggregation = object.aggregation ?? 0;
2080
- message.quantile = object.quantile ?? 0;
1138
+ fromPartial<I extends Exact<DeepPartial<MetricAttribute>, I>>(object: I): MetricAttribute {
1139
+ const message = createBaseMetricAttribute();
1140
+ message.key = object.key ?? "";
1141
+ message.values = object.values?.map((e) => e) || [];
2081
1142
  return message;
2082
1143
  },
2083
1144
  };
2084
1145
 
2085
- function createBaseAttributeFilter(): AttributeFilter {
2086
- return { key: "", op: 0, values: [] };
1146
+ function createBaseStreamQueryRequest(): StreamQueryRequest {
1147
+ return { organizationId: "", projectId: "", promql: "", timeRange: undefined, timeInterval: 0 };
2087
1148
  }
2088
1149
 
2089
- export const AttributeFilter: MessageFns<AttributeFilter> = {
2090
- encode(message: AttributeFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2091
- if (message.key !== "") {
2092
- writer.uint32(10).string(message.key);
1150
+ export const StreamQueryRequest: MessageFns<StreamQueryRequest> = {
1151
+ encode(message: StreamQueryRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1152
+ if (message.organizationId !== "") {
1153
+ writer.uint32(10).string(message.organizationId);
1154
+ }
1155
+ if (message.projectId !== "") {
1156
+ writer.uint32(18).string(message.projectId);
2093
1157
  }
2094
- if (message.op !== 0) {
2095
- writer.uint32(16).int32(message.op);
1158
+ if (message.promql !== "") {
1159
+ writer.uint32(26).string(message.promql);
2096
1160
  }
2097
- for (const v of message.values) {
2098
- writer.uint32(26).string(v!);
1161
+ if (message.timeRange !== undefined) {
1162
+ TimeRange.encode(message.timeRange, writer.uint32(34).fork()).join();
1163
+ }
1164
+ if (message.timeInterval !== 0) {
1165
+ writer.uint32(40).int32(message.timeInterval);
2099
1166
  }
2100
1167
  return writer;
2101
1168
  },
2102
1169
 
2103
- decode(input: BinaryReader | Uint8Array, length?: number): AttributeFilter {
1170
+ decode(input: BinaryReader | Uint8Array, length?: number): StreamQueryRequest {
2104
1171
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2105
1172
  const end = length === undefined ? reader.len : reader.pos + length;
2106
- const message = createBaseAttributeFilter();
1173
+ const message = createBaseStreamQueryRequest();
2107
1174
  while (reader.pos < end) {
2108
1175
  const tag = reader.uint32();
2109
1176
  switch (tag >>> 3) {
@@ -2112,15 +1179,15 @@ export const AttributeFilter: MessageFns<AttributeFilter> = {
2112
1179
  break;
2113
1180
  }
2114
1181
 
2115
- message.key = reader.string();
1182
+ message.organizationId = reader.string();
2116
1183
  continue;
2117
1184
  }
2118
1185
  case 2: {
2119
- if (tag !== 16) {
1186
+ if (tag !== 18) {
2120
1187
  break;
2121
1188
  }
2122
1189
 
2123
- message.op = reader.int32() as any;
1190
+ message.projectId = reader.string();
2124
1191
  continue;
2125
1192
  }
2126
1193
  case 3: {
@@ -2128,7 +1195,23 @@ export const AttributeFilter: MessageFns<AttributeFilter> = {
2128
1195
  break;
2129
1196
  }
2130
1197
 
2131
- message.values.push(reader.string());
1198
+ message.promql = reader.string();
1199
+ continue;
1200
+ }
1201
+ case 4: {
1202
+ if (tag !== 34) {
1203
+ break;
1204
+ }
1205
+
1206
+ message.timeRange = TimeRange.decode(reader, reader.uint32());
1207
+ continue;
1208
+ }
1209
+ case 5: {
1210
+ if (tag !== 40) {
1211
+ break;
1212
+ }
1213
+
1214
+ message.timeInterval = reader.int32() as any;
2132
1215
  continue;
2133
1216
  }
2134
1217
  }
@@ -2140,36 +1223,64 @@ export const AttributeFilter: MessageFns<AttributeFilter> = {
2140
1223
  return message;
2141
1224
  },
2142
1225
 
2143
- fromJSON(object: any): AttributeFilter {
1226
+ fromJSON(object: any): StreamQueryRequest {
2144
1227
  return {
2145
- key: isSet(object.key) ? globalThis.String(object.key) : "",
2146
- op: isSet(object.op) ? attributeFilterOpFromJSON(object.op) : 0,
2147
- values: globalThis.Array.isArray(object?.values) ? object.values.map((e: any) => globalThis.String(e)) : [],
1228
+ organizationId: isSet(object.organizationId)
1229
+ ? globalThis.String(object.organizationId)
1230
+ : isSet(object.organization_id)
1231
+ ? globalThis.String(object.organization_id)
1232
+ : "",
1233
+ projectId: isSet(object.projectId)
1234
+ ? globalThis.String(object.projectId)
1235
+ : isSet(object.project_id)
1236
+ ? globalThis.String(object.project_id)
1237
+ : "",
1238
+ promql: isSet(object.promql) ? globalThis.String(object.promql) : "",
1239
+ timeRange: isSet(object.timeRange)
1240
+ ? TimeRange.fromJSON(object.timeRange)
1241
+ : isSet(object.time_range)
1242
+ ? TimeRange.fromJSON(object.time_range)
1243
+ : undefined,
1244
+ timeInterval: isSet(object.timeInterval)
1245
+ ? analyticsTimeIntervalFromJSON(object.timeInterval)
1246
+ : isSet(object.time_interval)
1247
+ ? analyticsTimeIntervalFromJSON(object.time_interval)
1248
+ : 0,
2148
1249
  };
2149
1250
  },
2150
1251
 
2151
- toJSON(message: AttributeFilter): unknown {
1252
+ toJSON(message: StreamQueryRequest): unknown {
2152
1253
  const obj: any = {};
2153
- if (message.key !== "") {
2154
- obj.key = message.key;
1254
+ if (message.organizationId !== "") {
1255
+ obj.organizationId = message.organizationId;
1256
+ }
1257
+ if (message.projectId !== "") {
1258
+ obj.projectId = message.projectId;
2155
1259
  }
2156
- if (message.op !== 0) {
2157
- obj.op = attributeFilterOpToJSON(message.op);
1260
+ if (message.promql !== "") {
1261
+ obj.promql = message.promql;
2158
1262
  }
2159
- if (message.values?.length) {
2160
- obj.values = message.values;
1263
+ if (message.timeRange !== undefined) {
1264
+ obj.timeRange = TimeRange.toJSON(message.timeRange);
1265
+ }
1266
+ if (message.timeInterval !== 0) {
1267
+ obj.timeInterval = analyticsTimeIntervalToJSON(message.timeInterval);
2161
1268
  }
2162
1269
  return obj;
2163
1270
  },
2164
1271
 
2165
- create<I extends Exact<DeepPartial<AttributeFilter>, I>>(base?: I): AttributeFilter {
2166
- return AttributeFilter.fromPartial(base ?? ({} as any));
1272
+ create<I extends Exact<DeepPartial<StreamQueryRequest>, I>>(base?: I): StreamQueryRequest {
1273
+ return StreamQueryRequest.fromPartial(base ?? ({} as any));
2167
1274
  },
2168
- fromPartial<I extends Exact<DeepPartial<AttributeFilter>, I>>(object: I): AttributeFilter {
2169
- const message = createBaseAttributeFilter();
2170
- message.key = object.key ?? "";
2171
- message.op = object.op ?? 0;
2172
- message.values = object.values?.map((e) => e) || [];
1275
+ fromPartial<I extends Exact<DeepPartial<StreamQueryRequest>, I>>(object: I): StreamQueryRequest {
1276
+ const message = createBaseStreamQueryRequest();
1277
+ message.organizationId = object.organizationId ?? "";
1278
+ message.projectId = object.projectId ?? "";
1279
+ message.promql = object.promql ?? "";
1280
+ message.timeRange = (object.timeRange !== undefined && object.timeRange !== null)
1281
+ ? TimeRange.fromPartial(object.timeRange)
1282
+ : undefined;
1283
+ message.timeInterval = object.timeInterval ?? 0;
2173
1284
  return message;
2174
1285
  },
2175
1286
  };
@@ -3258,6 +2369,64 @@ export const Dashboard: MessageFns<Dashboard> = {
3258
2369
  },
3259
2370
  };
3260
2371
 
2372
+ function createBaseWidgetQuery(): WidgetQuery {
2373
+ return { promql: undefined };
2374
+ }
2375
+
2376
+ export const WidgetQuery: MessageFns<WidgetQuery> = {
2377
+ encode(message: WidgetQuery, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2378
+ if (message.promql !== undefined) {
2379
+ writer.uint32(10).string(message.promql);
2380
+ }
2381
+ return writer;
2382
+ },
2383
+
2384
+ decode(input: BinaryReader | Uint8Array, length?: number): WidgetQuery {
2385
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2386
+ const end = length === undefined ? reader.len : reader.pos + length;
2387
+ const message = createBaseWidgetQuery();
2388
+ while (reader.pos < end) {
2389
+ const tag = reader.uint32();
2390
+ switch (tag >>> 3) {
2391
+ case 1: {
2392
+ if (tag !== 10) {
2393
+ break;
2394
+ }
2395
+
2396
+ message.promql = reader.string();
2397
+ continue;
2398
+ }
2399
+ }
2400
+ if ((tag & 7) === 4 || tag === 0) {
2401
+ break;
2402
+ }
2403
+ reader.skip(tag & 7);
2404
+ }
2405
+ return message;
2406
+ },
2407
+
2408
+ fromJSON(object: any): WidgetQuery {
2409
+ return { promql: isSet(object.promql) ? globalThis.String(object.promql) : undefined };
2410
+ },
2411
+
2412
+ toJSON(message: WidgetQuery): unknown {
2413
+ const obj: any = {};
2414
+ if (message.promql !== undefined) {
2415
+ obj.promql = message.promql;
2416
+ }
2417
+ return obj;
2418
+ },
2419
+
2420
+ create<I extends Exact<DeepPartial<WidgetQuery>, I>>(base?: I): WidgetQuery {
2421
+ return WidgetQuery.fromPartial(base ?? ({} as any));
2422
+ },
2423
+ fromPartial<I extends Exact<DeepPartial<WidgetQuery>, I>>(object: I): WidgetQuery {
2424
+ const message = createBaseWidgetQuery();
2425
+ message.promql = object.promql ?? undefined;
2426
+ return message;
2427
+ },
2428
+ };
2429
+
3261
2430
  function createBaseWidget(): Widget {
3262
2431
  return {
3263
2432
  id: "",
@@ -3287,7 +2456,7 @@ export const Widget: MessageFns<Widget> = {
3287
2456
  GridPos.encode(message.gridPos, writer.uint32(34).fork()).join();
3288
2457
  }
3289
2458
  for (const v of message.queries) {
3290
- MetricQuery.encode(v!, writer.uint32(42).fork()).join();
2459
+ WidgetQuery.encode(v!, writer.uint32(42).fork()).join();
3291
2460
  }
3292
2461
  if (message.timeWindow !== 0) {
3293
2462
  writer.uint32(48).int32(message.timeWindow);
@@ -3348,7 +2517,7 @@ export const Widget: MessageFns<Widget> = {
3348
2517
  break;
3349
2518
  }
3350
2519
 
3351
- message.queries.push(MetricQuery.decode(reader, reader.uint32()));
2520
+ message.queries.push(WidgetQuery.decode(reader, reader.uint32()));
3352
2521
  continue;
3353
2522
  }
3354
2523
  case 6: {
@@ -3402,7 +2571,7 @@ export const Widget: MessageFns<Widget> = {
3402
2571
  : isSet(object.grid_pos)
3403
2572
  ? GridPos.fromJSON(object.grid_pos)
3404
2573
  : undefined,
3405
- queries: globalThis.Array.isArray(object?.queries) ? object.queries.map((e: any) => MetricQuery.fromJSON(e)) : [],
2574
+ queries: globalThis.Array.isArray(object?.queries) ? object.queries.map((e: any) => WidgetQuery.fromJSON(e)) : [],
3406
2575
  timeWindow: isSet(object.timeWindow)
3407
2576
  ? analyticsTimeWindowFromJSON(object.timeWindow)
3408
2577
  : isSet(object.time_window)
@@ -3437,7 +2606,7 @@ export const Widget: MessageFns<Widget> = {
3437
2606
  obj.gridPos = GridPos.toJSON(message.gridPos);
3438
2607
  }
3439
2608
  if (message.queries?.length) {
3440
- obj.queries = message.queries.map((e) => MetricQuery.toJSON(e));
2609
+ obj.queries = message.queries.map((e) => WidgetQuery.toJSON(e));
3441
2610
  }
3442
2611
  if (message.timeWindow !== 0) {
3443
2612
  obj.timeWindow = analyticsTimeWindowToJSON(message.timeWindow);
@@ -3465,7 +2634,7 @@ export const Widget: MessageFns<Widget> = {
3465
2634
  message.gridPos = (object.gridPos !== undefined && object.gridPos !== null)
3466
2635
  ? GridPos.fromPartial(object.gridPos)
3467
2636
  : undefined;
3468
- message.queries = object.queries?.map((e) => MetricQuery.fromPartial(e)) || [];
2637
+ message.queries = object.queries?.map((e) => WidgetQuery.fromPartial(e)) || [];
3469
2638
  message.timeWindow = object.timeWindow ?? 0;
3470
2639
  message.timeInterval = object.timeInterval ?? 0;
3471
2640
  message.timeseriesStyle = object.timeseriesStyle ?? 0;
@@ -5105,9 +4274,9 @@ export const WidgetQueryError: MessageFns<WidgetQueryError> = {
5105
4274
  * metric catalog, ad-hoc queries, and Postgres-backed dashboards that compose those
5106
4275
  * queries. Every streaming RPC emits a snapshot first, then live updates.
5107
4276
  *
5108
- * StreamQuery executes one MetricQuery — the same message a dashboard widget
5109
- * stores — so the metrics explorer, the widget editor preview, and a saved
5110
- * dashboard all run through one query path.
4277
+ * StreamQuery evaluates an ad-hoc PromQL expression — the same language saved
4278
+ * dashboard widgets store — so the metrics explorer and the widget editor
4279
+ * preview run through the same query path as the board.
5111
4280
  */
5112
4281
  export interface MetricGatewayService {
5113
4282
  StreamMetrics(request: StreamMetricsRequest, metadata?: Metadata): Observable<MetricCatalogEnvelope>;