Skip to content

Commit 6b10949

Browse files
committed
docs: startTransaction documentation
1 parent e6961a2 commit 6b10949

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

packages/minimal/src/index.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,21 @@ export function _callOnClient(method: string, ...args: any[]): void {
169169
}
170170

171171
/**
172-
* This starts a Transaction and is considered the entry point to do manual tracing. You can add child spans
173-
* to a transactions. After that more children can be added to created spans to buld a tree structure.
174-
* This function returns a Transaction and you need to keep track of the instance yourself. When you call `.finsh()` on
175-
* a transaction it will be sent to Sentry.
172+
* Starts a new transaction and returns it. This is the entry point to manual
173+
* tracing instrumentation.
174+
*
175+
* A tree structure can be built by adding child spans to the transaction, and
176+
* child spans to other spans. To start a new child span within the transaction
177+
* or any span, call the respective `.startChild()` method.
178+
*
179+
* Every child span must be finished before the transaction is finished,
180+
* otherwise the unfinished spans are discarded.
181+
*
182+
* The transaction must be finished with a call to its `.finish()` method, at
183+
* which point the transaction with all its finished child spans will be sent to
184+
* Sentry.
185+
*
186+
* @param context Properties with which the Transaction should be created.
176187
*/
177188
export function startTransaction(transactionContext: TransactionContext): Transaction {
178189
return callOnHub<Transaction>('startSpan', {

0 commit comments

Comments
 (0)