Skip to content

Commit 32096cb

Browse files
add grandchild span to example (#13328)
1 parent ed7269a commit 32096cb

File tree

1 file changed

+11
-3
lines changed
  • platform-includes/performance/enable-manual-instrumentation

1 file changed

+11
-3
lines changed

platform-includes/performance/enable-manual-instrumentation/native.mdx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,24 @@ sentry_transaction_context_t *tx_ctx = sentry_transaction_context_new(
1717
sentry_transaction_t *tx = sentry_transaction_start(tx_ctx, sentry_value_new_null());
1818

1919
// Transactions can have child spans (and those spans can have child spans as well)
20-
sentry_span_t *span = sentry_transaction_start_child(
20+
sentry_span_t *child_span = sentry_transaction_start_child(
2121
tx,
2222
"child operation",
2323
"child description"
2424
);
2525

26+
// Starting a child of a span requires the function `sentry_span_start_child` instead
27+
sentry_span_t *grandchild_span = sentry_span_start_child(
28+
child_span,
29+
"grandchild operation",
30+
"grandchild description"
31+
);
32+
2633
// ...
27-
// (Perform the operation represented by the span/transaction)
34+
// (Perform the operation represented by the spans/transaction)
2835
// ...
2936

30-
sentry_span_finish(span); // Mark the span as finished
37+
sentry_span_finish(grandchild_span); // Mark the spans as finished
38+
sentry_span_finish(child_span);
3139
sentry_transaction_finish(tx); // Mark the transaction as finished and send it to Sentry
3240
```

0 commit comments

Comments
 (0)