Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • PrometheusMetrics

Index

Constructors

constructor

Properties

Static AgeCounters

AgeCounters: typeof AgeCounters = ...

Methods

addAppServicePath

  • addAppServicePath(bridge: Bridge): void

addCollector

  • addCollector(func: CollectorFunction): void
  • Adds a new collector function. These collector functions are run whenever the /metrics page is about to be generated, allowing code to update values of gauges.

    Parameters

    • func: CollectorFunction

      A new collector function. This function is passed no arguments and is not expected to return anything. It runs purely to have a side-effect on previously registered gauges.

    Returns void

addCounter

  • addCounter(opts: CounterOpts): Counter<string>

addGauge

  • addGauge(opts: GagueOpts): Gauge<string>

addTimer

  • addTimer(opts: CounterOpts): Histogram<string>
  • Adds a new timer metric, represented by a prometheus Histogram.

    Parameters

    • opts: CounterOpts

      Options

    Returns Histogram<string>

    A histogram metric. Once created, the value of this metric can be incremented with the startTimer method.

incCounter

  • incCounter(name: string, labels: {}): void
  • Increments the value of a counter metric

    param{string}

    name The name the metric was previously registered as.

    param{object}

    labels Optional object containing additional label values.

    Parameters

    • name: string
    • labels: {}
      • [label: string]: string

    Returns void

refresh

  • refresh(): Promise<void>

registerBridgeGauges

registerMatrixSdkMetrics

  • registerMatrixSdkMetrics(): void
  • Registers some exported metrics that relate to operations of the embedded matrix-js-sdk. In particular, a metric is added that counts the number of calls to client API endpoints made by the client library.

    Returns void

startTimer

  • startTimer(name: string, labels: {}): (labels?: Partial<Record<string, string | number>>) => number
  • Begins a new timer observation for a timer metric.

    param{string}

    name The name the metric was previously registered as.

    param{object}

    labels Optional object containing additional label values.

    Parameters

    • name: string
    • labels: {}
      • [label: string]: string

    Returns (labels?: Partial<Record<string, string | number>>) => number

    A function to be called to end the timer and report the observation.

      • (labels?: Partial<Record<string, string | number>>): number
      • Parameters

        • Optional labels: Partial<Record<string, string | number>>

        Returns number

Generated using TypeDoc