@sentry/types
Advanced tools
Comparing version 7.87.0 to 7.88.0
{ | ||
"name": "@sentry/types", | ||
"version": "7.87.0", | ||
"version": "7.88.0", | ||
"description": "Types for all Sentry JavaScript SDKs", | ||
@@ -5,0 +5,0 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", |
@@ -11,2 +11,3 @@ import { Breadcrumb, BreadcrumbHint } from './breadcrumb'; | ||
import { Integration, IntegrationClass } from './integration'; | ||
import { MetricBucketItem } from './metrics'; | ||
import { ClientOptions } from './options'; | ||
@@ -150,2 +151,8 @@ import { Scope } from './scope'; | ||
/** | ||
* Captures serialized metrics and sends them to Sentry. | ||
* | ||
* @experimental This API is experimental and might experience breaking changes | ||
*/ | ||
captureAggregateMetrics?(metricBucketItems: Array<MetricBucketItem>): void; | ||
/** | ||
* Register a callback for transaction start. | ||
@@ -152,0 +159,0 @@ * Receives the transaction as argument. |
@@ -79,2 +79,3 @@ import { SerializedCheckIn } from './checkin'; | ||
type: 'statsd'; | ||
length: number; | ||
}; | ||
@@ -81,0 +82,0 @@ type ProfileItemHeaders = { |
@@ -48,3 +48,3 @@ export { Attachment } from './attachment'; | ||
export { CheckIn, MonitorConfig, FinishedCheckIn, InProgressCheckIn, SerializedCheckIn } from './checkin'; | ||
export { Metric, CounterMetric, GaugeMetric, DistributionMetric, SetMetric } from './metrics'; | ||
export { MetricsAggregator, MetricBucketItem, MetricInstance } from './metrics'; | ||
//# sourceMappingURL=index.d.ts.map |
import { MeasurementUnit } from './measurement'; | ||
import { Primitive } from './misc'; | ||
export interface BaseMetric { | ||
name: string; | ||
timestamp: number; | ||
unit?: MeasurementUnit; | ||
tags?: { | ||
[key: string]: Primitive; | ||
}; | ||
export interface MetricInstance { | ||
/** | ||
* Adds a value to a metric. | ||
*/ | ||
add(value: number | string): void; | ||
/** | ||
* Serializes the metric into a statsd format string. | ||
*/ | ||
toString(): string; | ||
} | ||
export interface CounterMetric extends BaseMetric { | ||
value: number; | ||
export type MetricBucketItem = [ | ||
/*metric*/ MetricInstance, | ||
/*timestamp*/ number, | ||
/*metricType*/ 'c' | 'g' | 's' | 'd', | ||
/*name*/ string, | ||
/*unit*/ MeasurementUnit, | ||
/*tags*/ { | ||
[key: string]: string; | ||
} | ||
]; | ||
/** | ||
* A metrics aggregator that aggregates metrics in memory and flushes them periodically. | ||
*/ | ||
export interface MetricsAggregator { | ||
/** | ||
* Add a metric to the aggregator. | ||
*/ | ||
add(metricType: 'c' | 'g' | 's' | 'd', name: string, value: number | string, unit?: MeasurementUnit, tags?: Record<string, Primitive>, timestamp?: number): void; | ||
/** | ||
* Flushes the current metrics to the transport via the transport. | ||
*/ | ||
flush(): void; | ||
/** | ||
* Shuts down metrics aggregator and clears all metrics. | ||
*/ | ||
close(): void; | ||
/** | ||
* Returns a string representation of the aggregator. | ||
*/ | ||
toString(): string; | ||
} | ||
export interface GaugeMetric extends BaseMetric { | ||
value: number; | ||
first: number; | ||
min: number; | ||
max: number; | ||
sum: number; | ||
count: number; | ||
} | ||
export interface DistributionMetric extends BaseMetric { | ||
value: number[]; | ||
} | ||
export interface SetMetric extends BaseMetric { | ||
value: Set<number>; | ||
} | ||
export type Metric = CounterMetric | GaugeMetric | DistributionMetric | SetMetric; | ||
//# sourceMappingURL=metrics.d.ts.map |
@@ -11,2 +11,3 @@ import type { Breadcrumb, BreadcrumbHint } from './breadcrumb'; | ||
import type { Integration, IntegrationClass } from './integration'; | ||
import type { MetricBucketItem } from './metrics'; | ||
import type { ClientOptions } from './options'; | ||
@@ -150,2 +151,8 @@ import type { Scope } from './scope'; | ||
/** | ||
* Captures serialized metrics and sends them to Sentry. | ||
* | ||
* @experimental This API is experimental and might experience breaking changes | ||
*/ | ||
captureAggregateMetrics?(metricBucketItems: Array<MetricBucketItem>): void; | ||
/** | ||
* Register a callback for transaction start. | ||
@@ -152,0 +159,0 @@ * Receives the transaction as argument. |
@@ -76,2 +76,3 @@ import type { SerializedCheckIn } from './checkin'; | ||
type: 'statsd'; | ||
length: number; | ||
}; | ||
@@ -78,0 +79,0 @@ type ProfileItemHeaders = { |
@@ -48,3 +48,3 @@ export type { Attachment } from './attachment'; | ||
export type { CheckIn, MonitorConfig, FinishedCheckIn, InProgressCheckIn, SerializedCheckIn } from './checkin'; | ||
export type { Metric, CounterMetric, GaugeMetric, DistributionMetric, SetMetric } from './metrics'; | ||
export type { MetricsAggregator, MetricBucketItem, MetricInstance } from './metrics'; | ||
//# sourceMappingURL=index.d.ts.map |
import type { MeasurementUnit } from './measurement'; | ||
import type { Primitive } from './misc'; | ||
export interface BaseMetric { | ||
name: string; | ||
timestamp: number; | ||
unit?: MeasurementUnit; | ||
tags?: { | ||
[key: string]: Primitive; | ||
}; | ||
export interface MetricInstance { | ||
/** | ||
* Adds a value to a metric. | ||
*/ | ||
add(value: number | string): void; | ||
/** | ||
* Serializes the metric into a statsd format string. | ||
*/ | ||
toString(): string; | ||
} | ||
export interface CounterMetric extends BaseMetric { | ||
value: number; | ||
export type MetricBucketItem = [ | ||
metric: MetricInstance, | ||
timestamp: number, | ||
metricType: 'c' | 'g' | 's' | 'd', | ||
name: string, | ||
unit: MeasurementUnit, | ||
tags: { | ||
[key: string]: string; | ||
} | ||
]; | ||
/** | ||
* A metrics aggregator that aggregates metrics in memory and flushes them periodically. | ||
*/ | ||
export interface MetricsAggregator { | ||
/** | ||
* Add a metric to the aggregator. | ||
*/ | ||
add(metricType: 'c' | 'g' | 's' | 'd', name: string, value: number | string, unit?: MeasurementUnit, tags?: Record<string, Primitive>, timestamp?: number): void; | ||
/** | ||
* Flushes the current metrics to the transport via the transport. | ||
*/ | ||
flush(): void; | ||
/** | ||
* Shuts down metrics aggregator and clears all metrics. | ||
*/ | ||
close(): void; | ||
/** | ||
* Returns a string representation of the aggregator. | ||
*/ | ||
toString(): string; | ||
} | ||
export interface GaugeMetric extends BaseMetric { | ||
value: number; | ||
first: number; | ||
min: number; | ||
max: number; | ||
sum: number; | ||
count: number; | ||
} | ||
export interface DistributionMetric extends BaseMetric { | ||
value: number[]; | ||
} | ||
export interface SetMetric extends BaseMetric { | ||
value: Set<number>; | ||
} | ||
export type Metric = CounterMetric | GaugeMetric | DistributionMetric | SetMetric; | ||
//# sourceMappingURL=metrics.d.ts.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
256218
5304