Skip to content

Commit a47a604

Browse files
committed
Update trace boundary documentation
1 parent 90317db commit a47a604

File tree

1 file changed

+4
-2
lines changed
  • platform-includes/performance/add-spans-example

1 file changed

+4
-2
lines changed

platform-includes/performance/add-spans-example/native.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,15 @@ void perform_checkout() {
3939
This example will send a transaction named `checkout` to Sentry. The transaction will contain a `validation` span that measures how long `validate_shopping_cart()` took and a `process` span that measures `process_shopping_cart()`. Finally, the call to `sentry_transaction_finish()` will finish the transaction and send it to Sentry.
4040

4141
## Trace Boundaries
42-
By default, events, transactions, and spans will inherit the `trace_id` from the `propagation_context` as generated during SDK initialization. These values can be overridden by a downstream SDK that calls `sentry_set_trace(trace_id, parent_span_id)`, or by a user who can manually create a trace boundary using `sentry_generate_trace()`:
42+
By default, events will inherit the `trace_id` from the `propagation_context` as generated during SDK initialization. Finishing a transaction will generate a new trace, which will be stored on the `propagation_context` again for future events. Scoping a transaction with `sentry_set_transaction_object` will already use the new trace for events during the transaction lifetime.
43+
44+
The `propagation_context` can be overridden by a downstream SDK that calls `sentry_set_trace(trace_id, parent_span_id)`, or by a user who can manually create a trace boundary using `sentry_regenerate_trace()`. Both will stop future transactions from creating new traces:
4345

4446
```c
4547
// Upon init, generates a random trace_id and span_id in the propagation_context
4648
sentry_options_t *options = sentry_options_new();
4749
sentry_init(options);
48-
// Events, transactions and spans will inherit the trace data from this propagation_context
50+
// Events will inherit the trace data from this propagation_context
4951
initialize_store();
5052

5153
// trace_id and parent_span_id usually originate from a downstream SDK

0 commit comments

Comments
 (0)