Skip to content

Commit e1feb21

Browse files
committed
bug 1657947 - New Glean metric types labeled_{custom|memory|timing}_distribution
1 parent 17722b2 commit e1feb21

File tree

4 files changed

+337
-0
lines changed

4 files changed

+337
-0
lines changed

schemas/glean/glean/glean-min.1.schema.json

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,87 @@
166166
},
167167
"type": "object"
168168
},
169+
"labeled_custom_distribution": {
170+
"additionalProperties": {
171+
"additionalProperties": {
172+
"properties": {
173+
"count": {
174+
"description": "This was accidentally sent in the past and is now deprecated. See https://bugzilla.mozilla.org/show_bug.cgi?id=1799509#c5",
175+
"type": "integer"
176+
},
177+
"sum": {
178+
"type": "integer"
179+
},
180+
"values": {
181+
"additionalProperties": {
182+
"type": "integer"
183+
},
184+
"propertyNames": {
185+
"pattern": "^[0-9]+$"
186+
},
187+
"type": "object"
188+
}
189+
},
190+
"required": [
191+
"sum",
192+
"values"
193+
],
194+
"type": "object"
195+
},
196+
"propertyNames": {
197+
"comment": "This must be at least the length of 'category.name' metric names to support error reporting",
198+
"maxLength": 61,
199+
"type": "string"
200+
},
201+
"type": "object"
202+
},
203+
"propertyNames": {
204+
"maxLength": 111,
205+
"pattern": "^[a-z_][a-z0-9_\\.]+$",
206+
"type": "string"
207+
},
208+
"type": "object"
209+
},
210+
"labeled_memory_distribution": {
211+
"additionalProperties": {
212+
"additionalProperties": {
213+
"properties": {
214+
"count": {
215+
"description": "This was accidentally sent in the past and is now deprecated. See https://bugzilla.mozilla.org/show_bug.cgi?id=1799509#c5",
216+
"type": "integer"
217+
},
218+
"sum": {
219+
"type": "integer"
220+
},
221+
"values": {
222+
"additionalProperties": {
223+
"type": "integer"
224+
},
225+
"propertyNames": {
226+
"pattern": "^[0-9]+$"
227+
},
228+
"type": "object"
229+
}
230+
},
231+
"required": [
232+
"values"
233+
],
234+
"type": "object"
235+
},
236+
"propertyNames": {
237+
"comment": "This must be at least the length of 'category.name' metric names to support error reporting",
238+
"maxLength": 61,
239+
"type": "string"
240+
},
241+
"type": "object"
242+
},
243+
"propertyNames": {
244+
"maxLength": 111,
245+
"pattern": "^[a-z_][a-z0-9_\\.]+$",
246+
"type": "string"
247+
},
248+
"type": "object"
249+
},
169250
"labeled_rate": {
170251
"additionalProperties": {
171252
"additionalProperties": {
@@ -219,6 +300,82 @@
219300
},
220301
"type": "object"
221302
},
303+
"labeled_timing_distribution": {
304+
"additionalProperties": {
305+
"additionalProperties": {
306+
"properties": {
307+
"bucket_count": {
308+
"type": "integer"
309+
},
310+
"count": {
311+
"description": "This was accidentally sent in the past and is now deprecated. See https://bugzilla.mozilla.org/show_bug.cgi?id=1799509#c5",
312+
"type": "integer"
313+
},
314+
"histogram_type": {
315+
"enum": [
316+
"linear",
317+
"exponential"
318+
],
319+
"type": "string"
320+
},
321+
"overflow": {
322+
"type": "integer"
323+
},
324+
"range": {
325+
"items": {
326+
"type": "number"
327+
},
328+
"maxItems": 2,
329+
"minItems": 2,
330+
"type": "array"
331+
},
332+
"sum": {
333+
"type": "integer"
334+
},
335+
"time_unit": {
336+
"enum": [
337+
"nanosecond",
338+
"microsecond",
339+
"millisecond",
340+
"second",
341+
"minute",
342+
"hour",
343+
"day"
344+
],
345+
"type": "string"
346+
},
347+
"underflow": {
348+
"type": "integer"
349+
},
350+
"values": {
351+
"additionalProperties": {
352+
"type": "integer"
353+
},
354+
"propertyNames": {
355+
"pattern": "^[0-9]+$"
356+
},
357+
"type": "object"
358+
}
359+
},
360+
"required": [
361+
"values"
362+
],
363+
"type": "object"
364+
},
365+
"propertyNames": {
366+
"comment": "This must be at least the length of 'category.name' metric names to support error reporting",
367+
"maxLength": 61,
368+
"type": "string"
369+
},
370+
"type": "object"
371+
},
372+
"propertyNames": {
373+
"maxLength": 111,
374+
"pattern": "^[a-z_][a-z0-9_\\.]+$",
375+
"type": "string"
376+
},
377+
"type": "object"
378+
},
222379
"memory_distribution": {
223380
"additionalProperties": {
224381
"properties": {

schemas/glean/glean/glean.1.schema.json

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,87 @@
252252
},
253253
"type": "object"
254254
},
255+
"labeled_custom_distribution": {
256+
"additionalProperties": {
257+
"additionalProperties": {
258+
"properties": {
259+
"count": {
260+
"description": "This was accidentally sent in the past and is now deprecated. See https://bugzilla.mozilla.org/show_bug.cgi?id=1799509#c5",
261+
"type": "integer"
262+
},
263+
"sum": {
264+
"type": "integer"
265+
},
266+
"values": {
267+
"additionalProperties": {
268+
"type": "integer"
269+
},
270+
"propertyNames": {
271+
"pattern": "^[0-9]+$"
272+
},
273+
"type": "object"
274+
}
275+
},
276+
"required": [
277+
"sum",
278+
"values"
279+
],
280+
"type": "object"
281+
},
282+
"propertyNames": {
283+
"comment": "This must be at least the length of 'category.name' metric names to support error reporting",
284+
"maxLength": 61,
285+
"type": "string"
286+
},
287+
"type": "object"
288+
},
289+
"propertyNames": {
290+
"maxLength": 111,
291+
"pattern": "^[a-z_][a-z0-9_\\.]+$",
292+
"type": "string"
293+
},
294+
"type": "object"
295+
},
296+
"labeled_memory_distribution": {
297+
"additionalProperties": {
298+
"additionalProperties": {
299+
"properties": {
300+
"count": {
301+
"description": "This was accidentally sent in the past and is now deprecated. See https://bugzilla.mozilla.org/show_bug.cgi?id=1799509#c5",
302+
"type": "integer"
303+
},
304+
"sum": {
305+
"type": "integer"
306+
},
307+
"values": {
308+
"additionalProperties": {
309+
"type": "integer"
310+
},
311+
"propertyNames": {
312+
"pattern": "^[0-9]+$"
313+
},
314+
"type": "object"
315+
}
316+
},
317+
"required": [
318+
"values"
319+
],
320+
"type": "object"
321+
},
322+
"propertyNames": {
323+
"comment": "This must be at least the length of 'category.name' metric names to support error reporting",
324+
"maxLength": 61,
325+
"type": "string"
326+
},
327+
"type": "object"
328+
},
329+
"propertyNames": {
330+
"maxLength": 111,
331+
"pattern": "^[a-z_][a-z0-9_\\.]+$",
332+
"type": "string"
333+
},
334+
"type": "object"
335+
},
255336
"labeled_rate": {
256337
"additionalProperties": {
257338
"additionalProperties": {
@@ -305,6 +386,82 @@
305386
},
306387
"type": "object"
307388
},
389+
"labeled_timing_distribution": {
390+
"additionalProperties": {
391+
"additionalProperties": {
392+
"properties": {
393+
"bucket_count": {
394+
"type": "integer"
395+
},
396+
"count": {
397+
"description": "This was accidentally sent in the past and is now deprecated. See https://bugzilla.mozilla.org/show_bug.cgi?id=1799509#c5",
398+
"type": "integer"
399+
},
400+
"histogram_type": {
401+
"enum": [
402+
"linear",
403+
"exponential"
404+
],
405+
"type": "string"
406+
},
407+
"overflow": {
408+
"type": "integer"
409+
},
410+
"range": {
411+
"items": {
412+
"type": "number"
413+
},
414+
"maxItems": 2,
415+
"minItems": 2,
416+
"type": "array"
417+
},
418+
"sum": {
419+
"type": "integer"
420+
},
421+
"time_unit": {
422+
"enum": [
423+
"nanosecond",
424+
"microsecond",
425+
"millisecond",
426+
"second",
427+
"minute",
428+
"hour",
429+
"day"
430+
],
431+
"type": "string"
432+
},
433+
"underflow": {
434+
"type": "integer"
435+
},
436+
"values": {
437+
"additionalProperties": {
438+
"type": "integer"
439+
},
440+
"propertyNames": {
441+
"pattern": "^[0-9]+$"
442+
},
443+
"type": "object"
444+
}
445+
},
446+
"required": [
447+
"values"
448+
],
449+
"type": "object"
450+
},
451+
"propertyNames": {
452+
"comment": "This must be at least the length of 'category.name' metric names to support error reporting",
453+
"maxLength": 61,
454+
"type": "string"
455+
},
456+
"type": "object"
457+
},
458+
"propertyNames": {
459+
"maxLength": 111,
460+
"pattern": "^[a-z_][a-z0-9_\\.]+$",
461+
"type": "string"
462+
},
463+
"type": "object"
464+
},
308465
"memory_distribution": {
309466
"additionalProperties": {
310467
"properties": {

templates/include/glean/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Version 1
22

3+
- New metric types `labeled_{custom|memory|timing}_distribution` [bug 1657947](https://bugzilla.mozilla.org/show_bug.cgi?id=1657947).
4+
35
- Added new schema "glean-min" which contains `metrics` and `events` but does not have `*_info` top level properties. Used to support pings that are configured to exclude the standard Glean `info` fields.
46

57
- Added optional `session_id` and optional `session_count` client info field. See [Bug 1862955](https://bugzilla.mozilla.org/show_bug.cgi?id=1862955).

templates/include/glean/metrics.1.schema.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,35 @@
5050
@GLEAN_BASE_OBJECT_1_JSON@,
5151
"additionalProperties": @GLEAN_TIMING_DISTRIBUTION_1_JSON@
5252
},
53+
"labeled_timing_distribution": {
54+
@GLEAN_BASE_OBJECT_1_JSON@,
55+
"additionalProperties": {
56+
@GLEAN_LABELED_GROUP_1_JSON@,
57+
"additionalProperties": @GLEAN_TIMING_DISTRIBUTION_1_JSON@
58+
}
59+
},
5360
"memory_distribution": {
5461
@GLEAN_BASE_OBJECT_1_JSON@,
5562
"additionalProperties": @GLEAN_MEMORY_DISTRIBUTION_1_JSON@
5663
},
64+
"labeled_memory_distribution": {
65+
@GLEAN_BASE_OBJECT_1_JSON@,
66+
"additionalProperties": {
67+
@GLEAN_LABELED_GROUP_1_JSON@,
68+
"additionalProperties": @GLEAN_MEMORY_DISTRIBUTION_1_JSON@
69+
}
70+
},
5771
"custom_distribution": {
5872
@GLEAN_BASE_OBJECT_1_JSON@,
5973
"additionalProperties": @GLEAN_CUSTOM_DISTRIBUTION_1_JSON@
6074
},
75+
"labeled_custom_distribution": {
76+
@GLEAN_BASE_OBJECT_1_JSON@,
77+
"additionalProperties": {
78+
@GLEAN_LABELED_GROUP_1_JSON@,
79+
"additionalProperties": @GLEAN_CUSTOM_DISTRIBUTION_1_JSON@
80+
}
81+
},
6182
"datetime": {
6283
@GLEAN_BASE_OBJECT_1_JSON@,
6384
"additionalProperties": @GLEAN_DATETIME_1_JSON@

0 commit comments

Comments
 (0)