File tree Expand file tree Collapse file tree 2 files changed +22
-9
lines changed Expand file tree Collapse file tree 2 files changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -177,11 +177,21 @@ export function _callOnClient(method: string, ...args: any[]): void {
177
177
}
178
178
179
179
/**
180
- * Starts a Transaction. This is the entry point to do manual tracing. You can
181
- * add child spans to transactions. Spans themselves can have children, building
182
- * a tree structure. This function returns a Transaction and you need to keep
183
- * track of the instance yourself. When you call `.finish()` on the transaction
184
- * it will be sent to Sentry.
180
+ * Starts a new `Transaction` and returns it. This is the entry point to manual
181
+ * tracing instrumentation.
182
+ *
183
+ * A tree structure can be built by adding child spans to the transaction, and
184
+ * child spans to other spans. To start a new child span within the transaction
185
+ * or any span, call the respective `.startChild()` method.
186
+ *
187
+ * Every child span must be finished before the transaction is finished,
188
+ * otherwise the unfinished spans are discarded.
189
+ *
190
+ * The transaction must be finished with a call to its `.finish()` method, at
191
+ * which point the transaction with all its finished child spans will be sent to
192
+ * Sentry.
193
+ *
194
+ * @param context Properties of the new `Transaction`.
185
195
*/
186
196
export function startTransaction ( context : TransactionContext ) : Transaction {
187
197
return callOnHub ( 'startTransaction' , { ...context } ) ;
Original file line number Diff line number Diff line change @@ -174,14 +174,15 @@ export interface Hub {
174
174
traceHeaders ( ) : { [ key : string ] : string } ;
175
175
176
176
/**
177
- * This function starts a span. If there is already a `Span` on the Scope,
178
- * the created Span with the SpanContext will have a reference to it and become it's child.
179
- * Otherwise it'll create a new `Span`.
177
+ * Starts a new `Span` and returns it. If there is a `Span` on the `Scope`,
178
+ * the new `Span` will be a child of the existing `Span`.
179
+ *
180
+ * @param context Properties of the new `Span`.
180
181
*/
181
182
startSpan ( context : SpanContext ) : Span ;
182
183
183
184
/**
184
- * Starts a new transaction and returns it. This is the entry point to manual
185
+ * Starts a new `Transaction` and returns it. This is the entry point to manual
185
186
* tracing instrumentation.
186
187
*
187
188
* A tree structure can be built by adding child spans to the transaction, and
@@ -194,6 +195,8 @@ export interface Hub {
194
195
* The transaction must be finished with a call to its `.finish()` method, at
195
196
* which point the transaction with all its finished child spans will be sent to
196
197
* Sentry.
198
+ *
199
+ * @param context Properties of the new `Transaction`.
197
200
*/
198
201
startTransaction ( context : TransactionContext ) : Transaction ;
199
202
}
You can’t perform that action at this time.
0 commit comments