| 1 | # Sentry.io Cash Reporting |
| 2 | |
| 3 | FlightGear can optionally report crashes and serious errors to Sentry.io. We have a sponsored |
| 4 | account provided gratis by Sentry; for access to this, ask on the developer list. |
| 5 | |
| 6 | ## Error conditions |
| 7 | |
| 8 | If FlightGear crashes, Sentry will automatically submit a report. For non-crash errors, |
| 9 | we manually submit an exception report. At present this is done whenever we trigger the |
| 10 | `fatalMessageBox`, and in other serious situations. Deciding where is appropriate (or not) |
| 11 | to report the error to Sentry is a key challenge of the system, since we don't want to |
| 12 | report user misconfiguration problems, but we do want to detect recurring and |
| 13 | systematic failures, eg broken aircraft. |
| 14 | |
| 15 | In general since we have (almost) unlimited event limits on our sponsored plan, it's |
| 16 | better to send errors and filter them on the server side, but this needs to be done |
| 17 | with some intelligence; for example we do not (at present) report Nasal runtime |
| 18 | errors, since this might overload the system. |
| 19 | |
| 20 | ## Data Protection |
| 21 | |
| 22 | We explicitly do not include any personal information in the reports, and disable IP address |
| 23 | collection. This avoids any GPDR obligations for us. |
| 24 | Since this makes it hard to cluster reports by user, we instead generate a UUID |
| 25 | corresponding to a FlightGear installation. This gives us a way to anonymously cluster reports |
| 26 | by computer, without any personal data disclosure. (So we can determine if a hundred reports of a |
| 27 | crash come from fifty discrete users, or just one) |
| 28 | |
| 29 | ## Supplementatal Data |
| 30 | |
| 31 | We record various pieces of configuration state as 'tags': such as the OS, graphics card, |
| 32 | major settings (eg, is multi-player enabled, which aircraft is being flown) as _tags_ in |
| 33 | Sentry terminology. This allows grouping of reports by similar tags; for example we can |
| 34 | identify that a particular crash only occurs with Intel Graphics, or when flying the |
| 35 | C172. |
| 36 | |
| 37 | Additionally we record 'breadcrumbs'; these are included with an error report if one |
| 38 | is sent, and give an idea of the path of the user through the application, prior to the |
| 39 | crash. We have breadcrumbs for key events such as the splash-screen completing, the |
| 40 | user changing position, or scenery being reloaded. |
| 41 | |
| 42 | `WARN` and `ALERT` level `SG_LOG` messages are currently included as breadcrumbs automatically; |
| 43 | this means it's important not to casually add messages at the levels for non-serious conditions. |
| 44 | The integration code has a list of commonly occurring but non-useful messages which are |
| 45 | skipped from sending; especially some OSG ones related to PNG and AC3D data issues. |
| 46 | |
| 47 | Adding new tags or breadcrumbs should be done with care, but is generally useful, and |
| 48 | suggestions in this area are appreciated. |
| 49 | |
| 50 | ## API |
| 51 | |
| 52 | All the API is contained in `sentryIntegration.hxx`, inside the `flightgear` namespace. |
| 53 | The methods are no-ops if the Sentry SDK was not available at CMake time, and are also |
| 54 | no-ops if the user has disabled sentry reporting. |
| 55 | |
| 56 | ## Building |
| 57 | |
| 58 | The API requires the injection of a private API key to report to our account; this |
| 59 | must be kept private of course, so it's injected into official builds at CMake time |
| 60 | on Jenkins, via the environment variable `FLIGHTGEAR_SENTRY_API_KEY`. |
| 61 | |
| 62 | The build must be configured to produce debug symbols, which are uploaded to Sentry |
| 63 | via the `sentry-cli` tool as part of our build scripts. |