@squidcloud/client 1.0.281 → 1.0.282
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1,39 @@
|
|
|
1
|
-
|
|
1
|
+
import { QueryMetricsRequest, QueryMetricsResponse } from '../../internal-common/src/public-types/metric.public-types';
|
|
2
|
+
/** A client for reporting user metrics and querying both application-related Squid and user metrics. */
|
|
3
|
+
export declare class ObservabilityClient {
|
|
4
|
+
private readonly rpcManager;
|
|
5
|
+
private pendingPromises;
|
|
6
|
+
private isReporting;
|
|
7
|
+
/**
|
|
8
|
+
* Reports metrics to the metric submission queue.
|
|
9
|
+
* The metric can be sent immediately or with some (several seconds) delay
|
|
10
|
+
* due to optimizations applied by Squid client.
|
|
11
|
+
* If no tags are provided tags are set to an empty record ({}).
|
|
12
|
+
* If no timestamp is provided the timestamp is set to now().
|
|
13
|
+
*/
|
|
14
|
+
reportMetric<MetricNameType = string>(metric: MetricReport<MetricNameType>): void;
|
|
15
|
+
/**
|
|
16
|
+
* Flushes all pending (unsent) metrics.
|
|
17
|
+
* Note: Even after flushing, it may take some time for these metrics to become visible via 'queryMetrics' due to the
|
|
18
|
+
* eventual consistency of the metrics storage.
|
|
19
|
+
*/
|
|
20
|
+
flush(): Promise<void>;
|
|
21
|
+
/** Queries a batch of metric values. */
|
|
22
|
+
queryMetrics<MetricName extends string = string>(metricRequest: QueryMetricsRequest<MetricName>): Promise<QueryMetricsResponse<MetricName>>;
|
|
23
|
+
}
|
|
24
|
+
/** A single metric event. */
|
|
25
|
+
export interface Metric<MetricNameType = string> {
|
|
26
|
+
/** Name of the metric. */
|
|
27
|
+
name: MetricNameType;
|
|
28
|
+
/** Value of the metric. */
|
|
29
|
+
value: number;
|
|
30
|
+
/** Time associated with the metric. Milliseconds since UNIX epoch. */
|
|
31
|
+
timestamp: number;
|
|
32
|
+
/** Set of tags for the metric. */
|
|
33
|
+
tags: Record<string, string>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* MetricReport represents a single metric event with some optional fields.
|
|
37
|
+
* These optional fields are automatically populated by Squid with default values.
|
|
38
|
+
*/
|
|
39
|
+
export type MetricReport<MetricNameType = string> = Omit<Metric<MetricNameType>, 'tags' | 'timestamp'> & Partial<Pick<Metric, 'tags' | 'timestamp'>>;
|
|
@@ -8,6 +8,7 @@ import { QueueManager } from './queue.manager';
|
|
|
8
8
|
import { SecretClient } from './secret.client';
|
|
9
9
|
import { StorageClient } from './storage-client';
|
|
10
10
|
import { TransactionId } from './types';
|
|
11
|
+
import { ObservabilityClient } from './observability-client';
|
|
11
12
|
import { ExtractionClient } from './extraction-client';
|
|
12
13
|
import { PersonalStorageClient } from './personal-storage-client';
|
|
13
14
|
import { SchedulerClient } from './scheduler-client';
|
|
@@ -207,6 +208,7 @@ export declare class Squid {
|
|
|
207
208
|
personalStorage(integrationId: IntegrationId): PersonalStorageClient;
|
|
208
209
|
extraction(): ExtractionClient;
|
|
209
210
|
get secrets(): SecretClient;
|
|
211
|
+
get observability(): ObservabilityClient;
|
|
210
212
|
get schedulers(): SchedulerClient;
|
|
211
213
|
/**
|
|
212
214
|
* Returns a distributed lock for the given mutex. The lock can be used to synchronize access to a shared resource.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.
|
|
1
|
+
export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.282";
|