Client to query historical logging data and live logging data.

interface LoggingDataClient {
    destroy(): void;
    query(
        query: LoggingDataQuery,
        listener: (result: LoggingDataMetric[]) => any,
    ): () => void;
    query(
        queries: LoggingDataQuery[],
        listener: (results: LoggingDataMetric[][]) => any,
    ): () => void;
    query<T extends LoggingDataQueryOptions>(
        queryOptions: T,
        listener: (
            results: T extends { format: "csv" }
                ? LoggingDataBlob
                : LoggingDataMetric[][],
        ) => void,
    ): () => void;
}

Methods

Methods

  • Destroy the client. Always call this when the client is not used anymore. When the context is destroyed, this is called automatically

    Returns void

  • Starts a query for logging data. Results are delivered through the listener callback. This method can be used for historic and live data depending on the selector. The listener may be called multiple times in multiple cases, including but not limited to:

    • when new live data comes in
    • when a different time period is selected
    • when an auto-refresh is active

    Parameters

    Returns () => void

    Returns a deregistration function for the listener. Until this function is called, or the client is destroyed, the listener callback will continue to get called.

  • Parameters

    Returns () => void

  • Type Parameters

    Parameters

    • queryOptions: T
    • listener: (
          results: T extends { format: "csv" }
              ? LoggingDataBlob
              : LoggingDataMetric[][],
      ) => void

      Depending on the format in the query options, the query listener result has a specific type.

      • If format is 'csv', the result type is LoggingDataBlob
      • Otherwise, the result type is LoggingDataMetric[][]

      If the once field is set to true, the query listener will be called at most once.

    Returns () => void