Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion platform-includes/capture-message/native.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ To create and capture a manual event, follow these steps:
3. Send the event to Sentry by invoking `sentry_capture_event`.

In a more complex example, it looks like this:

```c
sentry_value_t event = sentry_value_new_event();
sentry_value_set_by_key(event, "message", sentry_value_new_string("Hello!"));
Expand Down
37 changes: 27 additions & 10 deletions platform-includes/performance/improving-data/native.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
You can add Data Attributes to both Spans and Transactions. This data is visible in the trace explorer in Sentry.
The data must be of type `sentry_value_t`, which can store:
* 32-bit signed integers,
* 64-bit signed and unsigned integers,
Copy link
Member Author

@JoshuaMoelans JoshuaMoelans Jul 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we mention that 64-bit unsigned values get sent as Strings until further notice? For context, see getsentry/sentry-native#1326 (comment) . Not sure how relevant this is for most users.

e.g. add something like

<Alert level="warning">

Currently, 64-bit unsigned integers are sent as strings, since they can't be processed as numerical values yet.

</Alert>

Copy link
Member

@kahest kahest Jul 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a good idea to mention it (see below why), but I'd probably rephrase it:

* 64-bit signed integers,
* 64-bit unsigned integers (due to a current limitation, these will be converted to strings before sending),

wdyt?

why mention it at all: as we just discussed offline, data properties can be searched, and (un)signed int64 values will show up as both number (int64) and string (uint64) keys, this means that the actual user experience differs for unsigned int64 values

* double-precision floating-points,
* null-terminated strings, as well as
* lists and string-keyed maps containing `sentry_value_t` entries
Expand All @@ -21,25 +22,33 @@ sentry_transaction_set_data(tx, "my-data-attribute-1",
sentry_transaction_set_data(tx, "my-data-attribute-2",
sentry_value_new_int32(42));
sentry_transaction_set_data(tx, "my-data-attribute-3",
sentry_value_new_double(3.14));
sentry_value_new_int64(-9223372036854775808));
sentry_transaction_set_data(tx, "my-data-attribute-4",
sentry_value_new_uint64(18446744073709551615));
sentry_transaction_set_data(tx, "my-data-attribute-5",
sentry_value_new_double(3.14));
sentry_transaction_set_data(tx, "my-data-attribute-6",
sentry_value_new_bool(true));

sentry_value_t value_list = sentry_value_new_list();
sentry_value_append(value_list, sentry_value_new_string("value1"));
sentry_value_append(value_list, sentry_value_new_int32(42));
sentry_value_append(value_list, sentry_value_new_int64(-5123456789));
sentry_value_append(value_list, sentry_value_new_uint64(18446744073709551615));
sentry_value_append(value_list, sentry_value_new_double(3.14));
sentry_value_append(value_list, sentry_value_new_bool(true));

sentry_transaction_set_data(tx, "my-data-attribute-5", value_list);
sentry_transaction_set_data(tx, "my-data-attribute-7", value_list);

sentry_value_t value_object = sentry_value_new_object();
sentry_value_set_by_key(value_object, "key_1", sentry_value_new_string("value1"));
sentry_value_set_by_key(value_object, "key_2", sentry_value_new_int32(42));
sentry_value_set_by_key(value_object, "key_3", sentry_value_new_double(3.14));
sentry_value_set_by_key(value_object, "key_4", sentry_value_new_bool(true));
sentry_value_set_by_key(value_object, "key_3", sentry_value_new_int64(-5123456789));
sentry_value_set_by_key(value_object, "key_4", sentry_value_new_uint64(18446744073709551615));
sentry_value_set_by_key(value_object, "key_5", sentry_value_new_double(3.14));
sentry_value_set_by_key(value_object, "key_6", sentry_value_new_bool(true));

sentry_transaction_set_data(tx, "my-data-attribute-6", value_object);
sentry_transaction_set_data(tx, "my-data-attribute-8", value_object);
```

### Adding Data Attributes to Spans
Expand All @@ -59,23 +68,31 @@ sentry_span_set_data(span, "my-data-attribute-1",
sentry_span_set_data(span, "my-data-attribute-2",
sentry_value_new_int32(42));
sentry_span_set_data(span, "my-data-attribute-3",
sentry_value_new_double(3.14));
sentry_value_new_int64(-9223372036854775808));
sentry_span_set_data(span, "my-data-attribute-4",
sentry_value_new_uint64(18446744073709551615));
sentry_span_set_data(span, "my-data-attribute-5",
sentry_value_new_double(3.14));
sentry_span_set_data(span, "my-data-attribute-6",
sentry_value_new_bool(true));

sentry_value_t value_list = sentry_value_new_list();
sentry_value_append(value_list, sentry_value_new_string("value1"));
sentry_value_append(value_list, sentry_value_new_int32(42));
sentry_value_append(value_list, sentry_value_new_int64(-5123456789));
sentry_value_append(value_list, sentry_value_new_uint64(18446744073709551615));
sentry_value_append(value_list, sentry_value_new_double(3.14));
sentry_value_append(value_list, sentry_value_new_bool(true));

sentry_span_set_data(span, "my-data-attribute-5", value_list);
sentry_span_set_data(span, "my-data-attribute-7", value_list);

sentry_value_t value_object = sentry_value_new_object();
sentry_value_set_by_key(value_object, "key_1", sentry_value_new_string("value1"));
sentry_value_set_by_key(value_object, "key_2", sentry_value_new_int32(42));
sentry_value_set_by_key(value_object, "key_3", sentry_value_new_double(3.14));
sentry_value_set_by_key(value_object, "key_4", sentry_value_new_bool(true));
sentry_value_set_by_key(value_object, "key_3", sentry_value_new_int64(-5123456789));
sentry_value_set_by_key(value_object, "key_4", sentry_value_new_uint64(18446744073709551615));
sentry_value_set_by_key(value_object, "key_5", sentry_value_new_double(3.14));
sentry_value_set_by_key(value_object, "key_6", sentry_value_new_bool(true));

sentry_span_set_data(span, "my-data-attribute-6", value_object);
sentry_span_set_data(span, "my-data-attribute-8", value_object);
```