@lark-apaas/observable-web 1.0.0-alpha.1 → 1.0.0-alpha.2

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.
@@ -197,7 +197,8 @@ class CustomWebMetricExporter {
197
197
  fetch(this.url, {
198
198
  method: "POST",
199
199
  headers: __spreadValues({
200
- "Content-Type": "application/json"
200
+ "Content-Type": "application/json",
201
+ "X-Suda-Csrf-Token": window.csrfToken || ""
201
202
  }, this.headers),
202
203
  body,
203
204
  keepalive: true
@@ -83,10 +83,11 @@ const _WebObservableSdk = class _WebObservableSdk {
83
83
  }
84
84
  // --- 初始化日志模块 ---
85
85
  initLogs() {
86
- var _a;
86
+ var _a, _b;
87
87
  if (!((_a = this.config) == null ? void 0 : _a.collectorUrl.log)) return;
88
88
  const exporter = new import_exporter_logs_otlp_http.OTLPLogExporter({
89
- url: this.config.collectorUrl.log
89
+ url: this.config.collectorUrl.log,
90
+ headers: ((_b = this.config) == null ? void 0 : _b.headers) || {}
90
91
  });
91
92
  this.loggerProvider = new import_sdk_logs.LoggerProvider({
92
93
  resource: this.resource,
@@ -101,10 +102,11 @@ const _WebObservableSdk = class _WebObservableSdk {
101
102
  }
102
103
  // --- 初始化指标模块 ---
103
104
  initMetrics() {
104
- var _a, _b;
105
+ var _a, _b, _c;
105
106
  if (!((_a = this.config) == null ? void 0 : _a.collectorUrl.metric)) return;
106
107
  const exporter = new import_metric_exporter.CustomWebMetricExporter({
107
- url: (_b = this.config) == null ? void 0 : _b.collectorUrl.metric
108
+ url: (_b = this.config) == null ? void 0 : _b.collectorUrl.metric,
109
+ headers: ((_c = this.config) == null ? void 0 : _c.headers) || {}
108
110
  });
109
111
  this.meterProvider = new import_sdk_metrics.MeterProvider({
110
112
  resource: this.resource,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/observable-web",
3
- "version": "1.0.0-alpha.1",
3
+ "version": "1.0.0-alpha.2",
4
4
  "description": "Observable SDK For Web",
5
5
  "main": "./dist/lib/index.js",
6
6
  "files": [