Session public interface

Hierarchy

  • Session

Methods

  • Ends the session and sends all remaining data.

    Returns void

  • Enter a new rootAction

    Parameters

    • actionName: string

    Returns Action

  • Identify a user

    Parameters

    • userTag: string

      The tag to identify the user.

    Returns void

  • Reports the name of the cellular network carrier. Use undefined to clear the value again and it will not be sent.

    The given value will be truncated to 250 characters.

    Parameters

    • Optional carrier: string

      the cellular network carrier

    Returns void

  • Reports the type of connection with which the device is connected to the network. Use undefined to clear the value again and it will not be sent.

    Parameters

    • Optional connectionType: ConnectionType

      the type of connection

    Returns void

  • Report a crash to Dynatrace. If the stacktrace is longer than 128.000 characters, it is truncated according to the last line break. If the message is longer than 1000 characters, it is truncated to this value.

    Parameters

    • name: string

      The name of the crash.

    • message: string

      Why the crash occurred.

    • stacktrace: string

      The stacktrace of the crash.

    Returns void

  • Reports an error with a specified name, error code and reason to Dynatrace. If the message is longer than 1000 characters, it is truncated to this value.

    Parameters

    • name: string

      The name of the error.

    • code: number

      The error code.

    Returns void

  • Reports the network technology in use (e.g. 2G, 3G, 802.11x, offline, ...) Use undefined to clear the value again and it will not be sent.

    Parameters

    • Optional technology: string

      the used network technology

    Returns void

  • Send a Business Event

    With sendBizEvent, you can report a business event. These standalone events are being sent detached from user actions or sessions.

    Note: The 'dt' key, as well as all 'dt.' prefixed keys are considered reserved by Dynatrace and will be stripped from the passed in attributes.

    Note: Business events are only supported on Dynatrace SaaS deployments currently.

    Parameters

    • type: string

      Mandatory event type

    • attributes: JSONObject

      Must be a valid JSON object and cannot contain functions, undefined, Infinity, or NaN as values, otherwise they will be removed. Attributes need to be serializable using JSON.stringify. The resulting event will be populated with the 'attributes'-parameter and enriched with additional properties. Therefore, even empty objects are valid.

    Returns void

  • Allows tracing and timing of a web request handled by any HTTP Client (e.g. XmlHttpRequest, fetch, 'http'-module, ...). In this case the Dynatrace HTTP header (webRequestTagHeader) has to be set manually to the tag value of this WebRequestTracer.
    If the web request is continued on a server-side Agent (e.g. Java, .NET, ...) this Session will be correlated to the resulting server-side PurePath.

    See

    webRequestTagHeader

    Returns

    a WebRequestTracer which allows getting the tag value and adding timing information

    Parameters

    • url: string

      the URL of the web request to be tagged and timed

    Returns WebRequestTracer

Generated using TypeDoc