自定义添加额外的数据 TAG¶ 初始化 RUM 后,使用 addRumGlobalContext(key:string,value:any) API 向从应用程序收集的所有 RUM 事件添加额外的 TAG。 添加 TAG¶ CDNNPM 下载文件本地方式引入 const { datafluxRum } = require('./lib/dataflux-rum-miniapp.js') datafluxRum.addRumGlobalContext('<CONTEXT_KEY>', '<CONTEXT_VALUE>'); // Code example datafluxRum.addRumGlobalContext('isvip', 'xxxx'); datafluxRum.addRumGlobalContext('activity', { hasPaid: true, amount: 23.42 }); 引入 const { datafluxRum } = require('@cloudcare/rum-miniapp') datafluxRum.addRumGlobalContext('<CONTEXT_KEY>', '<CONTEXT_VALUE>'); // Code example datafluxRum.addRumGlobalContext('isvip', 'xxxx'); datafluxRum.addRumGlobalContext('activity', { hasPaid: true, amount: 23.42 }); 替换 TAG(覆盖)¶ CDNNPM 下载文件本地方式引入 const { datafluxRum } = require('./lib/dataflux-rum-miniapp.js') datafluxRum.setRumGlobalContext({ '<CONTEXT_KEY>': '<CONTEXT_VALUE>' }); // Code example datafluxRum.setRumGlobalContext({ codeVersion: 34, }); 引入 const { datafluxRum } = require('@cloudcare/rum-miniapp') datafluxRum.setRumGlobalContext({ '<CONTEXT_KEY>': '<CONTEXT_VALUE>' }); // Code example datafluxRum.setRumGlobalContext({ codeVersion: 34, }); 获取所有设置的自定义 TAG¶ CDNNPM 下载文件本地方式引入 const { datafluxRum } = require('./lib/dataflux-rum-miniapp.js') const context = datafluxRum.getRumGlobalContext(); 引入 const { datafluxRum } = require('@cloudcare/rum-miniapp') const context = datafluxRum.getRumGlobalContext(); 移除特定 key 对应的自定义 TAG¶ CDNNPM 下载文件本地方式引入 const { datafluxRum } = require('./lib/dataflux-rum-miniapp.js'); const context = datafluxRum.removeRumGlobalContext('<CONTEXT_KEY>'); 引入 const { datafluxRum } = require('@cloudcare/rum-miniapp') const context = datafluxRum.removeRumGlobalContext('<CONTEXT_KEY>'); 清除所有自定义 TAG¶ CDNNPM 下载文件本地方式引入 const { datafluxRum } = require('./lib/dataflux-rum-miniapp.js'); const context = datafluxRum.clearRumGlobalContext(); 引入 const { datafluxRum } = require('@cloudcare/rum-miniapp') const context = datafluxRum.clearRumGlobalContext();