@lark-apaas/observable-web 1.0.0-alpha.7 → 1.0.0-alpha.8
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.
package/dist/lib/const.js
CHANGED
|
@@ -24,8 +24,8 @@ __export(const_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(const_exports);
|
|
25
25
|
const defaultResourceAttr = {
|
|
26
26
|
sdk_version: "1.0.1-alpha.18",
|
|
27
|
-
sdk_lang: "
|
|
28
|
-
sdk_type: "client-
|
|
27
|
+
sdk_lang: "javascript",
|
|
28
|
+
sdk_type: "client-frontend"
|
|
29
29
|
};
|
|
30
30
|
var AppEnv = /* @__PURE__ */ ((AppEnv2) => {
|
|
31
31
|
AppEnv2["Dev"] = "preview";
|
|
@@ -61,6 +61,7 @@ var import_types = require("../types");
|
|
|
61
61
|
var import_convertAllAttrIntoString = require("../utils/convertAllAttrIntoString");
|
|
62
62
|
var import_hrTimeToNanoNumber = require("../utils/hrTimeToNanoNumber");
|
|
63
63
|
var import_getDefaultAttr = require("../utils/getDefaultAttr");
|
|
64
|
+
var import_const = require("../const");
|
|
64
65
|
class CustomWebMetricExporter {
|
|
65
66
|
constructor(config) {
|
|
66
67
|
this._shutdown = false;
|
|
@@ -124,7 +125,7 @@ class CustomWebMetricExporter {
|
|
|
124
125
|
}
|
|
125
126
|
return {
|
|
126
127
|
resource: {
|
|
127
|
-
attributes: (0, import_convertAllAttrIntoString.convertAttributesToString)(resourceMetrics.resource.attributes)
|
|
128
|
+
attributes: (0, import_convertAllAttrIntoString.convertAttributesToString)(__spreadValues(__spreadValues({}, resourceMetrics.resource.attributes), import_const.defaultResourceAttr))
|
|
128
129
|
},
|
|
129
130
|
metrics: targetMetrics
|
|
130
131
|
};
|
|
@@ -29,6 +29,7 @@ const getDefaultAttr = () => ({
|
|
|
29
29
|
tenant_id: window.tenantId || "",
|
|
30
30
|
user_id: window.userId || "",
|
|
31
31
|
did: (0, import_getDeviceID.getDeviceId)(),
|
|
32
|
+
module: "app_web",
|
|
32
33
|
// 默认为 Prod 环境,preview 环境不上报
|
|
33
34
|
app_env: import_const.AppEnv.Prod,
|
|
34
35
|
device_type: (0, import_getDeviceTypeByAgent.getDeviceTypeByAgent)(navigator.userAgent)
|