New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

skywalking-mointor

Package Overview
Dependencies
Maintainers
0
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

skywalking-mointor

use skywakling-client-js and add resource ua

latest
npmnpm
Version
1.0.75
Version published
Maintainers
0
Created
Source

skywalking-mointor

​ 基于skywalking-client-js的加工封装,旨在于将skywalking一些没集成进上报内容的内容进行加工封装,集中到上报请求中,比如:ua信息、用户信息、自定义参数等。

使用

npm 下载

npm install skywalking-mointor

config参数:

config = {
  collector: 'http://127.0.0.1:8080', // 上报的skywalking地址
  serviceName: '管理系统', // 应用名称
  serviceVersion: '2.0.0', // 应用的版本
  userId: '19920938', // 用户id
  sessionId: '883938103', // 会话Id
  vueInstance: app, // vue实例
}

main.js使用

import skywalkingMointor from "skywalking-mointor"; //引入
const skywalingMonitor = new skywalkingMointor(config);
skywalingMonitor.initMointorSky();// 初始化

捕获错误上报,在vue提供的框架层面的捕获错误函数app.config.errorHandler

基于vue的框架
app.config.errorHandler = (error) => {
  console.log(error)
  skywalingMonitor.handleErrorSky(error)
}
如果是其他框架,
skywalking-client-js原生提供了方法,可以使用
const handleError =  skywalingMonitor.clientNativeMethod();
... 处理错误的方式
see:https://github.com/apache/skywalking-client-js

页面性能上报方法

skywalingMonitors.handlePerformanceSky();

后续功能继续补充

FAQs

Package last updated on 19 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts