Backtrace allows the submission of file attachments along side crash and error reports to provide more context into a fault. There are various methods that can be used depending on how you are integrating your applications into Backtrace. This article will provide an overview of the supported ways to upload file attachments.

HTTP Submission of Minidumps and File Attachments

Backtrace provides a generic mechanism to accept crash reports and error submissions over HTTP(S). Most minidump generators have a built-in mechanism to upload minidumps and optional attachments to a specified HTTP(S) endpoint, but not all. 

If your integration path to Backtrace does not provide a way to upload minidump files and attachments to Backtrace, you can use our generic HTTP submission methods. You have two options

1. Multipart POST submission where the config.json attachment is included with the initial crash submission 

curl -v -F "upload_file=@example_minidump.dmp" -F "attachment_config.json=@config.json; type=application/json" 'https://testing.company.com:6098/post?format=minidump&token=ttttt'

2. After the crash is submitted, a subsequent call can be made to attach additional files. In the following example, we attach the config.json to object 5 that already exists in Backtrace.

curl -v --data-binary @config.json -H "Content-Type:application/json" 'https://testing.company.com:6098/post?token=ttttt&object=5&attachment_name=config.json'

Please review our HTTP Submission of Minidump article for more details on how to attach files.

Breakpad

Breakpad is an open source library initially developed by Google for cross platform C/C++ crash reporting. It is a popular choice for Windows, Mac and Linux environments, including servers, desktop apps, and embedded devices. For customers who use Breakpad with Backtrace, you can leverage the library's files parameter to specify the set of file paths to be uploaded. 

files["upload_file_minidump"] = descriptor.path();
files["attachment_log"] = "/var/log/myApp.log";
files["attachment_cpuinfo"] = "/proc/cpuinfo";

See the Breakpad Integration Guide for more details on how to use the files parameter to upload attachments with your crash reports.

Crashpad

Crashpad is another open source library initially developed by Google as a successor to the Breakpad library. While Crashpad is generally seen as having a robust architecture that offers a high degree of stability and customization, it does not yet offer out of the box support for file attachments. 

Customers who wish to use Crashpad and upload file attachments have a few options available to them today:

  1. Modify their crashpad_handler to add additional parts for the files they want to attach.
  2. Implement their own handler that calls the crashpad_handler and then their own code to upload additional assets or file attachments.

As we move forward, Backtrace plans to work with the upstream Crashpad team to implement file attachment support. 

C#

Backtrace supports crash and exception reporting from applications written in C# using our C# reporting library. Using our BacktraceReport object, developers can specify a list of attachmentPaths to submit alongside the crash or exception report.

var report = new BacktraceReport(
  exception: exception,
  attributes: new Dictionary<string, object>() { { "key", "value" } },
  attachmentPaths: new List<string>() { @"file_path_1", @"file_path_2"}
);

Find more details, please see the C# reporting library readme file here.

Questions?

Feel free to reach out if you have additional questions.

Did this answer your question?