Skip to content

Commit 68c0ced

Browse files
chore(native): add example of global fingerprint setting (#14524)
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ### Link to updated example [vercel preview](https://sentry-docs-git-joshua-nativefingerprinting.sentry.dev/platforms/native/usage/sdk-fingerprinting/#basic-example) ## DESCRIBE YOUR PR This came up in a Discord thread, and we didn't really have this documented anywhere. For manual event captures, we already provide a simple `sentry_value_set_by_key(event, "fingerprint", fp);` example, but this does not help with fingerprinting crashes. Hence I added an example of using `sentry_set_fingerprint("myFingerPrint", NULL);` which sets the global fingerprint list to `["myFingerPrint"]`. ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [x] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [x] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) --------- Co-authored-by: Karl Heinz Struggl <[email protected]>
1 parent 4e14398 commit 68c0ced

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

platform-includes/set-fingerprint/basic/native.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
You can set a fingerprint to be added to **all future events and errors**:
2+
```c
3+
#include <sentry.h>
4+
5+
sentry_set_fingerprint("myFingerPrint", NULL); // overwrites existing fingerprints
6+
my_fingerprinted_function(); // events are grouped on "myFingerPrint"
7+
8+
sentry_clear_fingerprint(); // clears all fingerprints
9+
```
10+
11+
For specific, manually captured events, fingerprints can be added to the `fingerprint` key of the event. This will be prioritized over the globally set fingerprint:
12+
113
```cpp
214
#include <sentry.h>
315

0 commit comments

Comments
 (0)