Function exceptionToSpan

Logs an exception to a span and sets exception-related attributes.

  • Parameters

    • error: Error

      The error object to be logged.

    • span: undefined | Span = ...

      The span to log the exception to. If not provided, the active span is used. If no active span is available, the error is logged to the console.

    Returns void