Skip to content

Commit 6d9e389

Browse files
committed
Add Container Environments page
1 parent d2e1741 commit 6d9e389

File tree

1 file changed

+32
-0
lines changed
  • docs/platforms/native/advanced-usage/container-environments

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: Container Environments
3+
description: "How to use the Sentry Native SDK in container environments."
4+
sidebar_order: 2000
5+
---
6+
7+
## Database-path on a mounted volume
8+
The Sentry Native SDK uses a [database path](https://docs.sentry.io/platforms/native/configuration/options/#database-path) to store events and crash reports. When you are using a containerized environment, you may want to mount a volume to persist the database across container restarts to avoid losing this data.
9+
10+
## Waiting for `Crashpad` to Finish
11+
Since SDK version [0.8.3](https://github.com/getsentry/sentry-native/releases/tag/0.8.3) the [option `crashpad_wait_for_upload`](https://docs.sentry.io/platforms/native/configuration/options/#crashpad-wait-for-upload) enables waiting for the `crashpad_handler` (on Linux) to finish its work before a shutdown-after-crash.
12+
13+
14+
In SDK versions before 0.8.3, one could use a script similar to the example below to tie container shutdown to the `crashpad_handler` process.
15+
```bash
16+
#!/bin/bash
17+
18+
# ./execute-main-app
19+
20+
crashpad_timeout_s=10
21+
crashpad_process_name=crashpad_handler
22+
crashpad_pid=$(pgrep -n -f $crashpad_process_name)
23+
if [ -n "$crashpad_pid" ]; then
24+
echo "Waiting for crashpad to finish..."
25+
timeout $crashpad_timeout_s tail --pid=$crashpad_pid -f /dev/null
26+
if [ $? -eq 124 ]; then
27+
echo "The crashpad process did not finish within $crashpad_timeout_s seconds"
28+
else
29+
echo "The crashpad process finished successfully"
30+
fi
31+
fi
32+
```

0 commit comments

Comments
 (0)