diff --git a/Makefile b/Makefile index 0272798..0c66c4e 100644 --- a/Makefile +++ b/Makefile @@ -44,3 +44,8 @@ clean_db: run_app: SENTRY_DSN=https://b5ceabee4e4a4cd6b21afe3bd2cbbed4@sentry.io/1720457 bin/example + +curl_minidump: + cd ./sentry-db/completed; curl -X POST \ + 'https://sentry.io/api/1720457/minidump/?sentry_key=b5ceabee4e4a4cd6b21afe3bd2cbbed4' \ + -F upload_file_minidump=@`ls` \ No newline at end of file diff --git a/README.md b/README.md index 23f80cb..b52efbe 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +# sentry-native ## Setup 1. `git clone --recurse-submodules git@github.com:sentry-demos/sentry-native.git` 2. install `sentry-cli 1.49.0z` from https://github.com/getsentry/sentry-cli/releases/ and https://docs.sentry.io/cli/installation/. You can run `yarn global add @sentry/cli` @@ -22,17 +23,7 @@ This project makes use of **sentry-native** in its packaged release form. It is `make clean` only needs to be run if you're trying to re-run `make bin/example` ## Windows -Do everything in Visual Studio Code and set the DSN first. -1. download Premake5.exe -2. cd premake5 and -premake5.exe vs2017 <---creates a solution, a wrapper around projects that ref each other -3. open the .sln in VS -4. click 'ok' for accepting the upgrade by VS. -5. rt-click 'example-crashpad' project and click Build -6. can 'Set as Default Project' for when you click Run Button at the top -7. rt-click 'crashpad-handler' project and click Build -8. the builds go into /sentry-native/premake/bin -9. sentry-native/premake, spwan a cmd, bin\Debug\example_crashpad.exe +[*These instructions are still under development*](./windows.txt) ## Event Examples [Symbolicated stacktrace of a native crash](screenshots/native-crash-stacktrace.png) @@ -52,3 +43,60 @@ sentry-native in the news https://blog.sentry.io/2019/09/26/fixing-native-apps-w ## Gif ![gif](screenshots/sentry-native-2-events-150.gif) + +# Minidumps + +You can `curl` your .dmp files directly to the Sentry API. + +[Additional documentation - docs.sentry.io native/minidumps](https://docs.sentry.io/platforms/native/minidump/#minidump-additional) + +## Setup +First you need to obtain your own Minidumps Endpoint for your Sentry Project +1. Project Settings > DSN Keys, click 'Expand' > Minidump Endpoint is given +2. You will use this api endpoint as the basis for your curl command in the next steps +``` +curl -X POST \ + \ +``` +3. Produce your .dmp's by running a Mac [sentry-native](#sentry-native) crash. They will get stored in `./sentry-db/completed` +``` +-F upload_file_minidump=@.dmp +``` + +## Run +1. `cd ./sentry-db/completed` +2. +``` +curl -X POST \ + 'https://sentry.io/api/1720457/minidump/?sentry_key=b5ceabee4e4a4cd6b21afe3bd2cbbed4' \ + -F upload_file_minidump=@b066e1b0-68ef-4d7a-8f59-e59ad0e63d8d.dmp +``` +3. try with JSON for release + tags +``` +curl -X POST \ + 'https://sentry.io/api/1720457/minidump/?sentry_key=b5ceabee4e4a4cd6b21afe3bd2cbbed4' \ + -F upload_file_minidump=@40467503-6652-4dd5-8c7b-d63c7e29a649.dmp \ + -F 'sentry={"release":"1.2.3","tags":{"myotag":"value"}}' +``` +4. try with Line-separated ("flattened") for release + tags + +#### What Native Crash Looks Like? +- the 'myotag' tag appeared under heatmap, but not under TAGS section +- 'release' appeared on rt-side sidebar and heatmap, but not under TAGS section <-- could be a general upload problem +- the 'histag' did same, but 'myotag' is still there? + +#### What Capture Message Looks Like? +It is a .dmp sent with the Capture Message? Does Capture Message return an exit status to the C/C++ function? +- no tag and no release shown + +#### This curl dmp is producing 1 or 2? +Looks like it's producing 2, interesting. + +#### We did for 'release' and 'tags' - try for other things? +- breadcrumbs (a lot of work, formatting-wise), etc. +- are release+tags sufficient for the time being? that's what our documentation covers + +#### Note +- mention that you can do it with your own .dmp? any .dmp will work? +- Event time and Processing time may differ, depending on how long you wait between generating the event (native crash) and curl'ing it to sentry.io/api. +![event-latency](screenshots/event-time-vs-processing-time.png) diff --git a/screenshots/event-time-vs-processing-time.png b/screenshots/event-time-vs-processing-time.png new file mode 100644 index 0000000..366a798 Binary files /dev/null and b/screenshots/event-time-vs-processing-time.png differ diff --git a/windows.txt b/windows.txt index 7d5b258..d2d32c7 100644 --- a/windows.txt +++ b/windows.txt @@ -1,11 +1,5 @@ - -VM with WIndows, mounting into Mac - WINDOWS -no makefile like on mac -use VIsual STudio. VS solution - - +Do everything in Visual Studio Code and set the DSN first <-- TODO `make configure fetch` not on windows so run: Windows steps 1. download Premake5.exe @@ -19,7 +13,6 @@ premake5.exe vs2017 <---creates a solution, a wrapper around projects that ref e 8. the builds go into /sentry-native/premake/bin 9. sentry-native/premake, spwan a cmd, bin\Debug\example_crashpad.exe -TODO set DSN -------------------------------- + we distribute 2017 .sln opens in VisualStudio \ No newline at end of file