@blueking/open-telemetry 0.0.16 → 0.0.18

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.
@@ -63,7 +63,9 @@ export interface BkOTOptions {
63
63
  export interface BkOTPrivacyConfig {
64
64
  /** 初始化时的采集授权状态;运行期可通过 setTrackingConsent 更新。 */
65
65
  trackingConsent?: BkOTTrackingConsent;
66
+ /** 在所有 RUM 自定义插件 emit 前统一过滤属性。 */
66
67
  redactAttributes?: (attributes: Attributes) => Attributes;
68
+ /** 所有写入 attribute 的 URL 都会先经过此函数。 */
67
69
  redactUrl?: (url: string) => string;
68
70
  }
69
71
  export interface BkOTRequestBodyConfig {
@@ -0,0 +1,2 @@
1
+ export declare const CLS_HISTOGRAM_BOUNDARIES: number[];
2
+ export declare const DURATION_HISTOGRAM_BOUNDARIES: number[];
@@ -18,6 +18,10 @@ export interface BkOTInstance extends Omit<BkOTRuntimeContext, 'notifyActivity'
18
18
  use: (plugin: BkOTPlugin) => BkOTInstance;
19
19
  useInstrumentation: (instrumentation: Instrumentation) => BkOTInstance;
20
20
  }
21
+ /**
22
+ * 浏览器 RUM SDK 的生命周期入口。Provider 在构造时创建,插件和全局 patch 则随 start、授权变更和
23
+ * shutdown 安装或卸载;Session 决定统一作用于 trace、metric、log 三类信号。
24
+ */
21
25
  export declare class BkOpenTelemetry implements BkOTInstance {
22
26
  private readonly activityObserver;
23
27
  private readonly flushProviders;
@@ -0,0 +1,3 @@
1
+ import type { BkOTRuntimeContext } from './plugin';
2
+ export type BkOTSignal = 'logs' | 'metrics' | 'traces';
3
+ export declare const shouldRecordSignal: (context: BkOTRuntimeContext, signal: BkOTSignal) => boolean;
@@ -1,3 +1,4 @@
1
1
  import type { Attributes } from '@opentelemetry/api';
2
+ export declare const normalizeMetricPathGroup: (pathGroup: string) => string;
2
3
  export declare const getMetricViewAttributes: (runtimeAttributes: Attributes) => Attributes;
3
4
  export declare const getInstrumentationSpanRuntimeAttributes: (runtimeAttributes: Attributes, fallbackViewPathGroup?: string) => Attributes;
@@ -6,12 +6,12 @@ export declare const hashString: (input: string) => string;
6
6
  export interface ThrottleResult {
7
7
  /** 是否允许本次上报 */
8
8
  allowed: boolean;
9
- /** 当前窗口内同 fingerprint 的总触发次数(含本次,含被丢弃次数),便于下游感知是否被节流 */
9
+ /** 当前窗口内同 fingerprint 的触发序号(含本次) */
10
10
  count: number;
11
11
  }
12
12
  /**
13
13
  * 时间窗节流:同一 key 在 windowMs 窗口内最多允许 maxPerWindow 次通过;
14
- * 超出则被拦截,但 `count` 仍累加,便于下游感知风暴规模。
14
+ * 超出则被拦截,但 `count` 仍累加,供调用方维护内部统计。
15
15
  *
16
16
  * 长会话场景下避免 records 无限累积——按窗口长度节奏轻量清理一次过期 entry。
17
17
  */