Skip to content

Commit 2342093

Browse files
committed
add example to SDK usage page
1 parent 20c84bf commit 2342093

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

platform-includes/capture-message/native.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ To create and capture a manual event, follow these steps:
2020
2. Add custom attributes to the event, like a `message` or an `exception`.
2121
3. Send the event to Sentry by invoking `sentry_capture_event`.
2222
23+
The custom attribute data must be of type `sentry_value_t`, which can store:
24+
* 32-bit signed integers,
25+
* 64-bit signed and unsigned integers,
26+
* double-precision floating-points,
27+
* null-terminated strings, as well as
28+
* lists and string-keyed maps containing `sentry_value_t` entries
29+
2330
In a more complex example, it looks like this:
2431
2532
```c
@@ -29,9 +36,15 @@ sentry_value_set_by_key(event, "message", sentry_value_new_string("Hello!"));
2936
sentry_value_t screen = sentry_value_new_object();
3037
sentry_value_set_by_key(screen, "width", sentry_value_new_int32(1920));
3138
sentry_value_set_by_key(screen, "height", sentry_value_new_int32(1080));
39+
sentry_value_set_by_key(screen, "refresh_rate", sentry_value_new_double(29.97));
40+
41+
sentry_value_t processed_files = sentry_value_new_list();
42+
sentry_value_append(processed_files, sentry_value_new_uint64(1073741824ULL));
43+
sentry_value_append(processed_files, sentry_value_new_uint64(2147483648ULL));
3244
3345
sentry_value_t contexts = sentry_value_new_object();
3446
sentry_value_set_by_key(contexts, "screen_size", screen);
47+
sentry_value_set_by_key(contexts, "processed_files", processed_files);
3548
3649
sentry_value_set_by_key(event, "contexts", contexts);
3750
sentry_capture_event(event);

platform-includes/performance/improving-data/native.mdx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ The data must be of type `sentry_value_t`, which can store:
77
* null-terminated strings, as well as
88
* lists and string-keyed maps containing `sentry_value_t` entries
99

10-
<Alert level="warning">
11-
12-
Currently, 64-bit unsigned integers are sent as strings, since they can't be processed as numerical values yet.
13-
14-
</Alert>
15-
1610
### Adding Data Attributes to Transactions
1711

1812
You can add data attributes to your transactions using the following API:

0 commit comments

Comments
 (0)