Skip to main content

Class: ObservabilityClient

A client for reporting user metrics and querying both application-related Squid and user metrics.

Constructors

constructor

new ObservabilityClient(rpcManager)

@internal.

Parameters

NameType
rpcManagerRpcManager

Methods

flush

flush(): Promise<void>

Flushes all pending (unsent) metrics. Note: Even after flushing, it may take some time for these metrics to become visible via 'queryMetrics' due to the eventual consistency of the metrics storage.

Returns

Promise<void>


queryMetrics

queryMetrics<MetricName>(metricRequest): Promise<QueryMetricsResponse<MetricName>>

Queries a batch of metric values.

Type parameters

NameType
MetricNameextends string = string

Parameters

NameType
metricRequestQueryMetricsRequest<MetricName>

Returns

Promise<QueryMetricsResponse<MetricName>>


reportMetric

reportMetric<MetricNameType>(metric): void

Reports metrics to the metric submission queue. The metric can be sent immediately or with some (several seconds) delay due to optimizations applied by Squid client. If no tags are provided tags are set to an empty record ({}). If no timestamp is provided the timestamp is set to now().

Type parameters

NameType
MetricNameTypestring

Parameters

NameType
metricMetricReport<MetricNameType>

Returns

void