Class: ObservabilityClient
A client for reporting user metrics and querying both application-related Squid and user metrics.
Constructors
constructor
• new ObservabilityClient(rpcManager
)
@internal.
Parameters
Name | Type |
---|---|
rpcManager | RpcManager |
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
Name | Type |
---|---|
MetricName | extends string = string |
Parameters
Name | Type |
---|---|
metricRequest | QueryMetricsRequest <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
Name | Type |
---|---|
MetricNameType | string |
Parameters
Name | Type |
---|---|
metric | MetricReport <MetricNameType > |
Returns
void