()
| 432 | * Returns the currently active span. |
| 433 | */ |
| 434 | export function getActiveSpan(): Span | undefined { |
| 435 | const carrier = getMainCarrier(); |
| 436 | const acs = getAsyncContextStrategy(carrier); |
| 437 | if (acs.getActiveSpan) { |
| 438 | return acs.getActiveSpan(); |
| 439 | } |
| 440 | |
| 441 | return _getSpanForScope(getCurrentScope()); |
| 442 | } |
| 443 | |
| 444 | /** |
| 445 | * Logs a warning once if `beforeSendSpan` is used to drop spans. |