@blueking/open-telemetry 0.0.4 → 0.0.5

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.
@@ -0,0 +1,3 @@
1
+ import type { BkOTRumConfig } from '../core/config';
2
+ import type { BkOTPlugin } from '../core/plugin';
3
+ export declare const createBlankScreenPlugin: (option: BkOTRumConfig["blankScreen"]) => BkOTPlugin;
@@ -0,0 +1,3 @@
1
+ import type { BkOTInstrumentationsConfig } from '../core/config';
2
+ import type { BkOTPlugin } from '../core/plugin';
3
+ export declare const createCommonInstrumentationsPlugin: (option: BkOTInstrumentationsConfig) => BkOTPlugin;
@@ -0,0 +1,6 @@
1
+ import type { BkOTRumConfig } from '../core/config';
2
+ import type { BkOTPlugin } from '../core/plugin';
3
+ /**
4
+ * 监听 CSP 违规事件并以 log 形式上报,便于排查脚本/资源被 CSP 拦截的问题。
5
+ */
6
+ export declare const createCspViolationPlugin: (enabled: BkOTRumConfig["cspViolation"]) => BkOTPlugin;
@@ -0,0 +1,7 @@
1
+ import type { BkOTRumConfig } from '../core/config';
2
+ import type { BkOTPlugin } from '../core/plugin';
3
+ /**
4
+ * 设备级永久标识 + 视口 / 网络元数据。
5
+ * 与 session 插件区分:device 跨会话持久,session 有过期与续期。
6
+ */
7
+ export declare const createDevicePlugin: (option: BkOTRumConfig["device"]) => BkOTPlugin;
@@ -0,0 +1,3 @@
1
+ import type { BkOTRumConfig } from '../core/config';
2
+ import type { BkOTPlugin } from '../core/plugin';
3
+ export declare const createErrorPlugin: (option: BkOTRumConfig["error"]) => BkOTPlugin;
@@ -0,0 +1,20 @@
1
+ import type { BkOTHttpBodyConfig } from '../core/config';
2
+ import type { BkOTPlugin } from '../core/plugin';
3
+ interface BodySnapshot {
4
+ body: string;
5
+ contentType?: string;
6
+ truncated: boolean;
7
+ }
8
+ export declare const createHttpBodyPlugin: (option: false | Required<BkOTHttpBodyConfig>) => BkOTPlugin;
9
+ declare global {
10
+ interface XMLHttpRequest {
11
+ __bkOtHttpBodyRequest__?: BodySnapshot;
12
+ __bkOtHttpBodyRequestHeaders__?: Record<string, string>;
13
+ __bkOtHttpBodyMeta__?: {
14
+ method: string;
15
+ startTime: number;
16
+ url: string;
17
+ };
18
+ }
19
+ }
20
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { BkOTRumConfig } from '../core/config';
2
+ import type { BkOTPlugin } from '../core/plugin';
3
+ /**
4
+ * Long Task 监控:通过 PerformanceObserver type=longtask 捕获 >= threshold 的主线程长任务。
5
+ * 默认关闭,建议在性能敏感模块按需开启。
6
+ */
7
+ export declare const createLongTaskPlugin: (option: BkOTRumConfig["longTask"]) => BkOTPlugin;
@@ -0,0 +1,3 @@
1
+ import type { BkOTRumConfig } from '../core/config';
2
+ import type { BkOTPlugin } from '../core/plugin';
3
+ export declare const createPageViewPlugin: (enabled: BkOTRumConfig["pageView"]) => BkOTPlugin;
@@ -0,0 +1,7 @@
1
+ import type { BkOTRumConfig } from '../core/config';
2
+ import type { BkOTPlugin } from '../core/plugin';
3
+ /**
4
+ * 估算 SPA 路由切换耗时:路由变更 → 双 raf + 一个宏任务后视为"渲染完成"。
5
+ * 不依赖具体框架,但仅是粗粒度估算;如需精确,业务可走自定义 plugin 在框架钩子内 startSpan/end。
6
+ */
7
+ export declare const createRouteTimingPlugin: (enabled: BkOTRumConfig["routeTiming"]) => BkOTPlugin;
@@ -0,0 +1,7 @@
1
+ import type { BkOTRumConfig } from '../core/config';
2
+ import type { BkOTPlugin } from '../core/plugin';
3
+ /**
4
+ * 会话级标识:带不活跃过期时间,超过 inactivityMs 视为新会话。
5
+ * 与 device 插件互补:device 是设备终身标识,session 反映"用户连续访问"语义。
6
+ */
7
+ export declare const createSessionPlugin: (option: BkOTRumConfig["session"]) => BkOTPlugin;
@@ -0,0 +1,3 @@
1
+ import type { BkOTRumConfig } from '../core/config';
2
+ import type { BkOTPlugin } from '../core/plugin';
3
+ export declare const createWebVitalsPlugin: (enabled: BkOTRumConfig["webVitals"]) => BkOTPlugin;
@@ -0,0 +1,3 @@
1
+ import type { BkOTRumConfig } from '../core/config';
2
+ import type { BkOTPlugin } from '../core/plugin';
3
+ export declare const createWebSocketPlugin: (enabled: BkOTRumConfig["websocket"]) => BkOTPlugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueking/open-telemetry",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "OpenTelemetry browser SDK for BK RUM",
5
5
  "author": "TencentCloud Real User Monitoring",
6
6
  "main": "dist/index.js",
@@ -11,10 +11,12 @@
11
11
  "dist"
12
12
  ],
13
13
  "scripts": {
14
+ "prepublishOnly": "pnpm build && pnpm dts",
14
15
  "build": "vite build && vite build --mode cdn",
15
16
  "build:cdn": "vite build --mode cdn",
16
17
  "build:esm": "vite build",
17
- "dev": "vite dev"
18
+ "dev": "vite dev",
19
+ "dts": "vue-tsc --project tsconfig.dts.json"
18
20
  },
19
21
  "dependencies": {
20
22
  "@opentelemetry/api": "^1.9.1",