UNPKG

1.74 kBTypeScriptView Raw
1import type { ClientOptions, MeasurementUnit, Primitive } from '@sentry/types';
2interface MetricData {
3 unit?: MeasurementUnit;
4 tags?: Record<string, Primitive>;
5 timestamp?: number;
6}
7/**
8 * Adds a value to a counter metric
9 *
10 * @experimental This API is experimental and might have breaking changes in the future.
11 */
12export declare function increment(name: string, value?: number, data?: MetricData): void;
13/**
14 * Adds a value to a distribution metric
15 *
16 * @experimental This API is experimental and might have breaking changes in the future.
17 */
18export declare function distribution(name: string, value: number, data?: MetricData): void;
19/**
20 * Adds a value to a set metric. Value must be a string or integer.
21 *
22 * @experimental This API is experimental and might have breaking changes in the future.
23 */
24export declare function set(name: string, value: number | string, data?: MetricData): void;
25/**
26 * Adds a value to a gauge metric
27 *
28 * @experimental This API is experimental and might have breaking changes in the future.
29 */
30export declare function gauge(name: string, value: number, data?: MetricData): void;
31export declare const metrics: {
32 increment: typeof increment;
33 distribution: typeof distribution;
34 set: typeof set;
35 gauge: typeof gauge;
36 /** @deprecated Use `metrics.metricsAggregratorIntegration()` instead. */
37 MetricsAggregator: import("@sentry/types").IntegrationClass<import("@sentry/types").Integration & {
38 setup: (client: import("@sentry/types").Client<ClientOptions<import("@sentry/types").BaseTransportOptions>>) => void;
39 }>;
40 metricsAggregatorIntegration: () => import("@sentry/types").IntegrationFnResult;
41};
42export {};
43//# sourceMappingURL=exports.d.ts.map
\No newline at end of file