Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Variables

pingUploader: default
preInitDebugViewTag: string | undefined
preInitLogPings: boolean | undefined
preInitSourceTags: string[] | undefined

Functions

  • Initialize This method should only be called once, subsequent calls will be no-op.

    throws
    • If config.serverEndpoint is an invalid URL;
    • If the application if is an empty string.

    Parameters

    • applicationId: string

      The application ID (will be sanitized during initialization).

    • uploadEnabled: boolean

      Determines whether telemetry is enabled. If disabled, all persisted metrics, events and queued pings (except first_run_date) are cleared.

    • Optional config: ConfigurationInterface

      Glean configuration options.

    Returns void

  • setDebugViewTag(value: string): void
  • Sets the debugViewTag debug option.

    When this property is set, all subsequent outgoing pings will include the X-Debug-ID header which will redirect them to the "Ping Debug Viewer".

    Parameters

    • value: string

      The value of the header. This value must satify the regex ^[a-zA-Z0-9-]{1,20}$ otherwise it will be ignored.

    Returns void

  • setLogPings(flag: boolean): void
  • Sets the logPings debug option.

    When this flag is true pings will be logged to the console right before they are collected.

    Parameters

    • flag: boolean

      Whether or not to log pings.

    Returns void

  • setPlatform(platform: default): void
  • Sets the current environment.

    This function must be called before initialize.

    Parameters

    • platform: default

      The environment to set. Please check out the available environments in the platform/ module.

    Returns void

  • setSourceTags(value: string[]): void
  • Sets the sourceTags debug option.

    Ping tags will show in the destination datasets, after ingestion.

    Note: Setting sourceTags will override all previously set tags.

    Parameters

    • value: string[]

      A vector of at most 5 valid HTTP header values. Individual tags must match the regex: "[a-zA-Z0-9-]{1,20}".

    Returns void

  • setUploadEnabled(flag: boolean): void
  • Sets whether upload is enabled or not.

    When uploading is disabled, metrics aren't recorded at all and no data is uploaded.

    When disabling, all pending metrics, events and queued pings are cleared.

    When enabling, the core Glean metrics are recreated.

    If the value of this flag is not actually changed, this is a no-op.

    Parameters

    • flag: boolean

      When true, enable metric collection.

    Returns void

  • shutdown(): Promise<void>
  • Finishes executing all pending tasks and shuts down both Glean's dispatcher and the ping uploader.

    If Glean is not initialized this is a no-op.

    Important

    This is irreversible. Only a restart will return Glean back to an idle state.

    Returns Promise<void>

    A promise which resolves once the shutdown is complete.

Generated using TypeDoc