1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
|
.. _buildtelemetry:
===============
Build Telemetry
===============
The build system (specifically, all the build tooling hooked
up to ``./mach``) has been configured to collect metrics data
points and errors for various build system actions. This data
helps drive team planning for the build team and ensure that
resources are applied to build processes that need them most.
You can opt-in to send telemetry to Mozilla during
``./mach bootstrap`` or by editing your ``.mozbuild/machrc``
file.
Telemetry
=========
The build telemetry schema can be found in-tree under
``python/mozbuild/mozbuild/telemetry.py`` in Voluptuous schema
format. You can use the ``export_telemetry_schema.py`` script in
that same directory to get the schema in JSON-schema format.
Details of the schema are specified below:
.. _telemetry.json#/:
:type: ``object``
:Required: :ref:`telemetry.json#/properties/argv`, :ref:`telemetry.json#/properties/build_opts`, :ref:`telemetry.json#/properties/client_id`, :ref:`telemetry.json#/properties/command`, :ref:`telemetry.json#/properties/duration_ms`, :ref:`telemetry.json#/properties/success`, :ref:`telemetry.json#/properties/system`, :ref:`telemetry.json#/properties/time`
**Properties:** :ref:`telemetry.json#/properties/argv`, :ref:`telemetry.json#/properties/build_opts`, :ref:`telemetry.json#/properties/client_id`, :ref:`telemetry.json#/properties/command`, :ref:`telemetry.json#/properties/duration_ms`, :ref:`telemetry.json#/properties/exception`, :ref:`telemetry.json#/properties/file_types_changed`, :ref:`telemetry.json#/properties/success`, :ref:`telemetry.json#/properties/system`, :ref:`telemetry.json#/properties/time`
.. _telemetry.json#/properties/argv:
argv
++++
Full mach commandline. If the commandline contains absolute paths they will be sanitized.
:type: ``array``
.. container:: sub-title
Every element of **argv** is:
:type: ``string``
.. _telemetry.json#/properties/build_opts:
build_opts
++++++++++
Selected build options
:type: ``object``
**Properties:** :ref:`telemetry.json#/properties/build_opts/properties/artifact`, :ref:`telemetry.json#/properties/build_opts/properties/ccache`, :ref:`telemetry.json#/properties/build_opts/properties/compiler`, :ref:`telemetry.json#/properties/build_opts/properties/debug`, :ref:`telemetry.json#/properties/build_opts/properties/icecream`, :ref:`telemetry.json#/properties/build_opts/properties/opt`, :ref:`telemetry.json#/properties/build_opts/properties/sccache`
.. _telemetry.json#/properties/build_opts/properties/artifact:
artifact
########
true if --enable-artifact-builds
:type: ``boolean``
.. _telemetry.json#/properties/build_opts/properties/ccache:
ccache
######
true if ccache is in use (--with-ccache)
:type: ``boolean``
.. _telemetry.json#/properties/build_opts/properties/compiler:
compiler
########
The compiler type in use (CC_TYPE)
**Allowed values:**
- clang
- clang-cl
- gcc
- msvc
.. _telemetry.json#/properties/build_opts/properties/debug:
debug
#####
true if build is debug (--enable-debug)
:type: ``boolean``
.. _telemetry.json#/properties/build_opts/properties/icecream:
icecream
########
true if icecream in use
:type: ``boolean``
.. _telemetry.json#/properties/build_opts/properties/opt:
opt
###
true if build is optimized (--enable-optimize)
:type: ``boolean``
.. _telemetry.json#/properties/build_opts/properties/sccache:
sccache
#######
true if ccache in use is sccache
:type: ``boolean``
.. _telemetry.json#/properties/build_attrs:
build_attrs
+++++++++++
Selected runtime attributes of the build
:type: ``object``
**Properties:** :ref:`telemetry.json#/properties/build_attrs/properties/cpu_percent`, :ref:`telemetry.json#/properties/build_attrs/properties/clobber`
.. _telemetry.json#/properties/build_attrs/properties/cpu_percent:
cpu_percent
###########
cpu utilization observed during the build
:type: ``number``
.. _telemetry.json#/properties/build_attrs/properties/clobber:
clobber
#######
true if the build was a clobber/full build
:type: ``boolean``
.. _telemetry.json#/properties/client_id:
client_id
+++++++++
A UUID to uniquely identify a client
:type: ``string``
.. _telemetry.json#/properties/command:
command
+++++++
The mach command that was invoked
:type: ``string``
.. _telemetry.json#/properties/duration_ms:
duration_ms
+++++++++++
Command duration in milliseconds
:type: ``number``
.. _telemetry.json#/properties/exception:
exception
+++++++++
If a Python exception was encountered during the execution of the command, this value contains the result of calling `repr` on the exception object.
:type: ``string``
.. _telemetry.json#/properties/file_types_changed:
file_types_changed
++++++++++++++++++
This array contains a list of objects with {ext, count} properties giving the count of files changed since the last invocation grouped by file type
:type: ``array``
.. container:: sub-title
Every element of **file_types_changed** is:
:type: ``object``
:Required: :ref:`telemetry.json#/properties/file_types_changed/items/properties/count`, :ref:`telemetry.json#/properties/file_types_changed/items/properties/ext`
**Properties:** :ref:`telemetry.json#/properties/file_types_changed/items/properties/count`, :ref:`telemetry.json#/properties/file_types_changed/items/properties/ext`
.. _telemetry.json#/properties/file_types_changed/items/properties/count:
count
#####
Count of changed files with this extension
:type: ``number``
.. _telemetry.json#/properties/file_types_changed/items/properties/ext:
ext
###
File extension
:type: ``string``
.. _telemetry.json#/properties/success:
success
+++++++
true if the command succeeded
:type: ``boolean``
.. _telemetry.json#/properties/system:
system
++++++
:type: ``object``
:Required: :ref:`telemetry.json#/properties/system/properties/os`
**Properties:** :ref:`telemetry.json#/properties/system/properties/cpu_brand`, :ref:`telemetry.json#/properties/system/properties/drive_is_ssd`, :ref:`telemetry.json#/properties/system/properties/logical_cores`, :ref:`telemetry.json#/properties/system/properties/memory_gb`, :ref:`telemetry.json#/properties/system/properties/os`, :ref:`telemetry.json#/properties/system/properties/physical_cores`, :ref:`telemetry.json#/properties/system/properties/virtual_machine`
.. _telemetry.json#/properties/system/properties/cpu_brand:
cpu_brand
#########
CPU brand string from CPUID
:type: ``string``
.. _telemetry.json#/properties/system/properties/drive_is_ssd:
drive_is_ssd
############
true if the source directory is on a solid-state disk
:type: ``boolean``
.. _telemetry.json#/properties/system/properties/logical_cores:
logical_cores
#############
Number of logical CPU cores present
:type: ``number``
.. _telemetry.json#/properties/system/properties/memory_gb:
memory_gb
#########
System memory in GB
:type: ``number``
.. _telemetry.json#/properties/system/properties/os:
os
##
Operating system
**Allowed values:**
- windows
- macos
- linux
- other
.. _telemetry.json#/properties/system/properties/physical_cores:
physical_cores
##############
Number of physical CPU cores present
:type: ``number``
.. _telemetry.json#/properties/system/properties/virtual_machine:
virtual_machine
###############
true if the OS appears to be running in a virtual machine
:type: ``boolean``
.. _telemetry.json#/properties/time:
time
++++
Time at which this event happened
:type: ``string``
:format: ``date-time``
Glean Telemetry
===============
In addition to the existing build-specific telemetry, Mozbuild is also reporting data using
`Glean <https://mozilla.github.io/glean/>`_ via :ref:`mach_telemetry`.
The metrics collected are documented :ref:`here<metrics>`.
As Python 2 is phased out, the old telemetry will be replaced by the new Glean implementation.
Error Reporting
===============
``./mach`` uses `Sentry <https://sentry.io/welcome/>`_
to automatically report errors to `our issue-tracking dashboard
<https://sentry.prod.mozaws.net/operations/mach/>`_.
Information captured
++++++++++++++++++++
Sentry automatically collects useful information surrounding
the error to help the build team discover what caused the
issue and how to reproduce it. This information includes:
* Environmental information, such as the computer name, timestamp, Python runtime and Python module versions
* Process arguments
* The stack trace of the error, including contextual information:
* The data contained in the exception
* Functions and their respective source file names, line numbers
* Variables in each frame
* `Sentry "Breadcrumbs" <https://docs.sentry.io/platforms/python/default-integrations/>`_,
which are important events that have happened which help contextualize the error, such as:
* An HTTP request has occurred
* A subprocess has been spawned
* Logging has occurred
Note that file paths may be captured, which include absolute paths (potentially including usernames).
|