Trace an action with message.

  • Start tracing an event.

    This will log the start of a trace and open a trace session, which is returned. Use the returned session to end the trace when the traced event is over. The traced event will be logged and also written to the Google Cloud StackDriver Trace agent.

    Note that if startTraceAgent was never called, this will still log but the StackDriver trace span creation will not actually happen.

    Type Parameters

    • TReq extends RequestWithLog<
          Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>,
      >

    Parameters

    • action: string

      The name of the action being traced.

    • message: string

      A message to be logged along side the action

    • Optionalrequest: TReq

      The request being fulfilled. This is used to determine if a request-scoped logger can be used.

    Returns ITraceSession

    The new trace session that was created and is to be used to end the session.

  • Start tracing an event.

    This will log the start of a trace and open a trace session, which is returned. Use the returned session to end the trace when the traced event is over. The traced event will be logged and also written to the Google Cloud StackDriver Trace agent.

    Note that if startTraceAgent was never called, this will still log but the StackDriver trace span creation will not actually happen.

    Parameters

    • action: string

      The name of the action being traced.

    • message: string

      A message to be logged along side the action

    • logger: Logger

      The logger to be used for the trace.

    Returns ITraceSession

    The new trace session that was created and is to be used to end the session.