MetricsAggregator class manages all the metrics for this artifact, integrating with Prometheus for metrics collection and aggregation.

Constructors

  • Create a new instance of MetricsAggregator

    Parameters

    • logger: LoggerInstance

      Instance for logging

    • Optionalport: AggregatorRegistry<"text/plain; version=0.0.4; charset=utf-8">

      Optional AggregatorRegistry for cluster metrics

    Returns Aggregator

Accessors

  • get registry(): Registry<"text/plain; version=0.0.4; charset=utf-8">
  • Return the registry used by the aggregator

    Returns Registry<"text/plain; version=0.0.4; charset=utf-8">

Methods

  • Clear the registry

    Returns void

  • Retrieves a single metric by name from the registry.

    Parameters

    • name: string

      The name of the metric to retrieve

    Returns undefined | Metric

  • Retrieves a single metric value in JSON format by name.

    Parameters

    • name: string

      The name of the metric to retrieve

    Returns Promise<undefined | MetricObjectWithValues<MetricValue<string>>>

  • Retrieves a single metric value in Prometheus format by name.

    Parameters

    • name: string

      The name of the metric to retrieve

    Returns Promise<string>

  • Return the actual metrics in JSON format

    Returns Promise<Response>

  • Return the metrics in text/plain format

    Returns Promise<Response>