File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,18 @@ function traceHeaders(this: Hub): { [key: string]: string } {
27
27
* @param context Properties with which the span should be created
28
28
*/
29
29
function startSpan ( this : Hub , context : SpanContext | TransactionContext ) : Transaction | Span {
30
+ /**
31
+ * @deprecated
32
+ * We have this here as a fallback to not break users upgrading to the new API
33
+ */
34
+ if ( ( context as any ) . transaction ) {
35
+ logger . warn (
36
+ `Please use \`Sentry.startTransaction({name: ${ ( context as any ) . transaction } })\` to start a Transaction.` ,
37
+ ) ;
38
+ ( context as TransactionContext ) . name = ( context as any ) . transaction as string ;
39
+ ( context as TransactionContext ) . _isTransaction = true ;
40
+ }
41
+
30
42
// This is our safeguard so people always get a Transaction in return.
31
43
// We set `_isTransaction: true` in {@link Sentry.startTransaction} to have a runtime check
32
44
// if the user really wanted to create a Transaction.
You can’t perform that action at this time.
0 commit comments