Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
dbea10a
Breadcrumbs support: before database operations cleanup
konraddysput May 4, 2021
b5873c6
Breadcrumbs improvements
konraddysput May 5, 2021
b30b700
Database adjustements
konraddysput May 5, 2021
3aad6c6
Adjusted database code
konraddysput May 5, 2021
487472c
Removed try/catch block from function that handles exception and prev…
konraddysput May 5, 2021
c1b629a
Allow nullable record in SendData method
konraddysput May 5, 2021
108c76d
Squashed commit of the following:
konraddysput May 5, 2021
a550120
Undo session aggregation changes
konraddysput May 5, 2021
fb40142
Create attribute provider dynamically
konraddysput May 6, 2021
91eb2f8
Merge branch 'feature/event-aggregation' into feature/breadcrumbs
konraddysput May 8, 2021
e9affc0
Undo maximum number of events
konraddysput May 8, 2021
16acd9c
Undo attribute provider management
konraddysput May 8, 2021
fcbbd95
Fixed labels
konraddysput May 8, 2021
fe410d9
Expose enableBreadcrumbs API
konraddysput May 9, 2021
e6ae26c
Merge branch 'feature/event-aggregation' into feature/breadcrumbs
konraddysput May 9, 2021
9b5b50c
Fixed name
konraddysput May 9, 2021
4b923ae
breadcrumbs tests
konraddysput May 9, 2021
f3bb906
Breadcrumbs unit tests - breadcrumb file tests
konraddysput May 10, 2021
326b1ce
Renamed enums
konraddysput May 10, 2021
3fbf5d7
Log cleanup tests
konraddysput May 10, 2021
34be484
Size consistency test
konraddysput May 10, 2021
0edf4d5
Add stack trace attribute only to error/exception logs
konraddysput May 10, 2021
4d8389b
Adjusted native build
konraddysput May 10, 2021
6be6210
Safe native attributes
konraddysput May 10, 2021
56c5a25
Safe native attribute ios
konraddysput May 10, 2021
cf74483
Merge branch 'feature/event-aggregation' into feature/breadcrumbs
konraddysput May 11, 2021
735e385
Fixed timestamp comparision
konraddysput May 11, 2021
40509de
Merge branch 'feature/event-aggregation' into feature/breadcrumbs
konraddysput May 12, 2021
cabadc0
Fixed missing namespace + line endings
konraddysput May 12, 2021
e6455f0
API update + removed two low memory warnings
konraddysput May 12, 2021
316afb2
breadcrumbs adjustements
konraddysput May 12, 2021
b60f2d0
Unit tests that validates navigation and logs events
konraddysput May 12, 2021
4db7194
Merge branch 'release/3.5.0' into feature/breadcrumbs
konraddysput May 12, 2021
b046da6
Renamed AddBreadcrumb to Log
konraddysput May 13, 2021
e2e1ead
Send unique attachments (or include (#n) to attachment name)
konraddysput May 13, 2021
837e015
Fixed condition + handling empty nullable files
konraddysput May 13, 2021
28e92c0
Order beadcrumbs
konraddysput May 14, 2021
daf0608
Merge branch 'feature/breadcrumbs' of https://github.com/backtrace-la…
konraddysput May 14, 2021
32aeb3c
breadcrumbs support - fixed ios side (delay breadcrumbs startup)
konraddysput May 17, 2021
7f11ffa
Removed database checks
konraddysput May 17, 2021
0722733
added breadcrumbs.lastId + offline db support
konraddysput May 18, 2021
6ddbcc8
removed early access flag
konraddysput May 18, 2021
696c59e
Fixed breadcrumb structure + unit tests
konraddysput May 19, 2021
d6ec25e
typos + new lines updates
konraddysput May 20, 2021
ff5562d
Adjusted formating
konraddysput May 20, 2021
842823f
Adjusted if statement
konraddysput May 20, 2021
3e3022b
Removed extra line
konraddysput May 20, 2021
be1ed28
COde cleanup - adjustemenets after CR
konraddysput May 20, 2021
4d2a6ce
Merge branch 'release/3.5.0' into feature/breadcrumbs
konraddysput May 21, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 47 additions & 29 deletions Editor/BacktraceConfigurationEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace Backtrace.Unity.Editor
[CustomEditor(typeof(BacktraceConfiguration))]
public class BacktraceConfigurationEditor : UnityEditor.Editor
{
protected static bool showBreadcrumbsSettings = false;
protected static bool showEventAggregationSettings = false;
protected static bool showClientAdvancedSettings = false;
protected static bool showDatabaseSettings = false;
Expand Down Expand Up @@ -70,10 +71,6 @@ public override void OnInspectorGUI()
serializedObject.FindProperty("ReportFilterType"),
new GUIContent(BacktraceConfigurationLabels.LABEL_REPORT_FILTER));

EditorGUILayout.PropertyField(
serializedObject.FindProperty("NumberOfLogs"),
new GUIContent(BacktraceConfigurationLabels.LABEL_NUMBER_OF_LOGS));

EditorGUILayout.PropertyField(
serializedObject.FindProperty("PerformanceStatistics"),
new GUIContent(BacktraceConfigurationLabels.LABEL_PERFORMANCE_STATISTICS));
Expand Down Expand Up @@ -155,43 +152,64 @@ public override void OnInspectorGUI()
new GUIContent(BacktraceConfigurationLabels.LABEL_ADD_UNITY_LOG));

#endif
}

#if UNITY_ANDROID || UNITY_IOS
GUIStyle breadcrumbsSupportFoldout = new GUIStyle(EditorStyles.foldout);
showBreadcrumbsSettings = EditorGUILayout.Foldout(showBreadcrumbsSettings, BacktraceConfigurationLabels.LABEL_BREADCRUMBS_SECTION, breadcrumbsSupportFoldout);
if (showBreadcrumbsSettings)
{
var enableBreadcrumbsSupport = serializedObject.FindProperty("EnableBreadcrumbsSupport");
EditorGUILayout.PropertyField(
serializedObject.FindProperty("CaptureNativeCrashes"),
new GUIContent(BacktraceConfigurationLabels.CAPTURE_NATIVE_CRASHES));
enableBreadcrumbsSupport,
new GUIContent(BacktraceConfigurationLabels.LABEL_ENABLE_BREADCRUMBS));

if (enableBreadcrumbsSupport.boolValue)
{
EditorGUILayout.PropertyField(
serializedObject.FindProperty("BacktraceBreadcrumbsLevel"),
new GUIContent(BacktraceConfigurationLabels.LABEL_BREADCRUMBS_EVENTS));

EditorGUILayout.PropertyField(
serializedObject.FindProperty("LogLevel"),
new GUIContent(BacktraceConfigurationLabels.LABEL_BREADCRUMNS_LOG_LEVEL));
}
}

#if UNITY_ANDROID || UNITY_IOS
EditorGUILayout.PropertyField(
serializedObject.FindProperty("CaptureNativeCrashes"),
new GUIContent(BacktraceConfigurationLabels.CAPTURE_NATIVE_CRASHES));
#endif
EditorGUILayout.PropertyField(
serializedObject.FindProperty("AutoSendMode"),
new GUIContent(BacktraceConfigurationLabels.LABEL_AUTO_SEND_MODE));
EditorGUILayout.PropertyField(
serializedObject.FindProperty("AutoSendMode"),
new GUIContent(BacktraceConfigurationLabels.LABEL_AUTO_SEND_MODE));

EditorGUILayout.PropertyField(
serializedObject.FindProperty("CreateDatabase"),
new GUIContent(BacktraceConfigurationLabels.LABEL_CREATE_DATABASE_DIRECTORY));
EditorGUILayout.PropertyField(
serializedObject.FindProperty("CreateDatabase"),
new GUIContent(BacktraceConfigurationLabels.LABEL_CREATE_DATABASE_DIRECTORY));

EditorGUILayout.PropertyField(
serializedObject.FindProperty("GenerateScreenshotOnException"),
new GUIContent(BacktraceConfigurationLabels.LABEL_GENERATE_SCREENSHOT_ON_EXCEPTION));
EditorGUILayout.PropertyField(
serializedObject.FindProperty("GenerateScreenshotOnException"),
new GUIContent(BacktraceConfigurationLabels.LABEL_GENERATE_SCREENSHOT_ON_EXCEPTION));

SerializedProperty maxRecordCount = serializedObject.FindProperty("MaxRecordCount");
EditorGUILayout.PropertyField(maxRecordCount, new GUIContent(BacktraceConfigurationLabels.LABEL_MAX_REPORT_COUNT));
SerializedProperty maxRecordCount = serializedObject.FindProperty("MaxRecordCount");
EditorGUILayout.PropertyField(maxRecordCount, new GUIContent(BacktraceConfigurationLabels.LABEL_MAX_REPORT_COUNT));

SerializedProperty maxDatabaseSize = serializedObject.FindProperty("MaxDatabaseSize");
EditorGUILayout.PropertyField(maxDatabaseSize, new GUIContent(BacktraceConfigurationLabels.LABEL_MAX_DATABASE_SIZE));
SerializedProperty maxDatabaseSize = serializedObject.FindProperty("MaxDatabaseSize");
EditorGUILayout.PropertyField(maxDatabaseSize, new GUIContent(BacktraceConfigurationLabels.LABEL_MAX_DATABASE_SIZE));

SerializedProperty retryInterval = serializedObject.FindProperty("RetryInterval");
EditorGUILayout.PropertyField(retryInterval, new GUIContent(BacktraceConfigurationLabels.LABEL_RETRY_INTERVAL));
SerializedProperty retryInterval = serializedObject.FindProperty("RetryInterval");
EditorGUILayout.PropertyField(retryInterval, new GUIContent(BacktraceConfigurationLabels.LABEL_RETRY_INTERVAL));

EditorGUILayout.LabelField("Backtrace database require at least one retry.");
SerializedProperty retryLimit = serializedObject.FindProperty("RetryLimit");
EditorGUILayout.PropertyField(retryLimit, new GUIContent(BacktraceConfigurationLabels.LABEL_RETRY_LIMIT));
EditorGUILayout.LabelField("Backtrace database require at least one retry.");
SerializedProperty retryLimit = serializedObject.FindProperty("RetryLimit");
EditorGUILayout.PropertyField(retryLimit, new GUIContent(BacktraceConfigurationLabels.LABEL_RETRY_LIMIT));

SerializedProperty retryOrder = serializedObject.FindProperty("RetryOrder");
EditorGUILayout.PropertyField(retryOrder, new GUIContent(BacktraceConfigurationLabels.LABEL_RETRY_ORDER));
}
SerializedProperty retryOrder = serializedObject.FindProperty("RetryOrder");
EditorGUILayout.PropertyField(retryOrder, new GUIContent(BacktraceConfigurationLabels.LABEL_RETRY_ORDER));
}

serializedObject.ApplyModifiedProperties();
}
}

}
15 changes: 7 additions & 8 deletions Editor/BacktraceConfigurationLabels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,21 @@ internal static class BacktraceConfigurationLabels
internal static string LABEL_SAMPLING = "Log random sampling rate";
internal static string LABEL_HANDLE_ANR = "Handle ANR (Application not responding)";
#if UNITY_ANDROID || UNITY_IOS
internal static string LABEL_HANDLE_OOM =
#if UNITY_ANDROID
"(Early access) Send Low memory warnings to Backtrace";
#elif UNITY_IOS
"(Early access) Send Out of memory exceptions to Backtrace";
#endif
internal static string LABEL_HANDLE_OOM = "Send Out of Memory exceptions to Backtrace";
#endif

internal const string LABEL_ENABLE_EVENT_AGGREGATION = "Enable crash free metrics reporting";
internal const string LABEL_EVENT_AGGREGATION_TIME_INTERVAL = "Auto send interval in sec";
internal const string LABEL_CRASH_FREE_SECTION = "Crash Free Metrics Reporting";

internal const string LABEL_BREADCRUMBS_SECTION = "Breadcrumbs support";
internal const string LABEL_ENABLE_BREADCRUMBS = "Enable breadcrumbs support";
internal const string LABEL_BREADCRUMBS_EVENTS = "Breadcrumbs events type";
internal const string LABEL_BREADCRUMNS_LOG_LEVEL = "Breadcrumbs log level";

internal static string LABEL_REPORT_ATTACHMENTS = "Report attachment paths";
internal static string CAPTURE_NATIVE_CRASHES = "Capture native crashes";
internal static string LABEL_REPORT_FILTER = "Filter reports";
internal static string LABEL_NUMBER_OF_LOGS = "Collect last n game logs";
internal static string LABEL_GAME_OBJECT_DEPTH = "Game object depth limit";
internal static string LABEL_IGNORE_SSL_VALIDATION = "Ignore SSL validation";
internal static string LABEL_SEND_UNHANDLED_GAME_CRASHES_ON_STARTUP = "Send unhandled native game crashes on startup";
Expand All @@ -47,6 +46,6 @@ internal static class BacktraceConfigurationLabels
internal static string LABEL_MAX_DATABASE_SIZE = "Maximum database size (mb)";
internal static string LABEL_RETRY_INTERVAL = "Retry interval";
internal static string LABEL_RETRY_LIMIT = "Maximum retries";
internal static string LABEL_RETRY_ORDER = "Retry order (FIFO/LIFO)";
internal static string LABEL_RETRY_ORDER = "Retry order (FIFO/LIFO)";
}
}
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ The following is a reference guide to the Backtrace Client fields:
- Enabled performance statistics: Allows `BacktraceClient` to measure execution time and include performance information as report attributes.
- Ignore SSL validation: Unity by default will validate ssl certificates. By using this option you can avoid ssl certificates validation. However, if you don't need to ignore ssl validation, please set this option to false.
- Handle ANR (Application not responding) - this option is available in Android and iOS build only. It allows to catch and report on ANR (application not responding) events happening in your game on mobile platform. See [here](#anr-reporting) for details.
- (Early Access) Send out of memory exceptions to Backtrace - this option is available in Android and iOS build only. See [here](#oom-reporting) for details.
- Send out of memory exceptions to Backtrace - this option is available in Android and iOS build only. See [here](#oom-reporting) for details.
- Enable Database: When this setting is toggled, the backtrace-unity plugin will configure an offline database that will store reports if they can't be submitted do to being offline or not finding a network. When toggled on, there are a number of Database settings to configure.
- Backtrace Database path: This is the path to directory where the Backtrace database will store reports on your game. You can use interpolated strings SUCH AS
`${Application.persistentDataPath}/backtrace/database` to dynamically look up a known directory structure to use. NOTE: Backtrace database will remove all existing files in the database directory upion first initialization.
Expand Down Expand Up @@ -208,7 +208,7 @@ When configuring the backtrace-unity client for an Android deployment, programme

The `error.type` for these reports will be `Hang`.

## (Early Access) Out of Memory Reports <a name="oom-reporting"></a>
## Out of Memory Reports <a name="oom-reporting"></a>

Backtrace can detect and flag low memory conditions for Unity games running on Android devices. When low memory conditions are detected, two attributes will be set:

Expand All @@ -219,8 +219,6 @@ If the games does not recover from low memory conditions and the operating syste

This functionality can be toggled on or off in the Backtrace configuration.

Note that this functionality is released as 'early access' and will be functionally improved in the near future to aid root cause resolution.

## Symbols upload

Unity allows developer to generate symbols archive called `symbols.zip` in the il2cpp build pipeline in the root directory of your game. In this archive you can find generated symbols for your game libraries. When your game crashes due to a native exception, your stack trace will contain only memory addresses instead of function name. Symbols from `symbols.zip` archive allows Backtrace to match function address to function name in your source code.
Expand Down Expand Up @@ -249,7 +247,7 @@ system and vm usage related information including system.memory.free, system.mem

When configuring the backtrace-unity client for an iOS deployment, programmers will have a toggle available in the backtrace-unity GUI in the Unity Editor to enable or disable ANR or Hang reports. This will use the default of 5 seconds. The `error.type` for these reports will be `Hang`.

## Out of Memory Reports (Early access)
## Out of Memory Reports

On iOS devices, when the operation system indicates there's memory pressure, Backtrace take a snapshot of the application state and persists it on the mobile device. When the operating system ends up killing the game, upon restart Backtrace will inspect the state file and deduce if the game was terminated because of memory pressure (for more information on the algorithm, see the [backtrace-cocoa repository](https://github.com/backtrace-labs/backtrace-cocoa#how-does-your-out-of-memory-detection-algorithm-work-)). If so, an error will be sent based on the data that was previously collected and persisted. Note that a snapshot will be taken every 2 minutes at most if low memory conditions persist.

Expand Down
Loading