Skip to main content

Set configuration information

Set basic configuration information. This interface needs to be called in the app.js header.

monitor.config(data)

parameter:

  • data: object parameters, set basic parameters.
{
beacon: '...', // data upload server
key: '', //TINGYUN applet application key
id: '', //TINGYUN applet account id
sampleRate: 1 //Initial sampling rate
}

Example:

const monitor = require('./agent/tingyun-mp-agent.js');
monitor.config({
beacon: 'https://beacon-mp.tingyun.com',
key: '4gA5HRiCw8g',
id: 'QpKfzsx-PGQ',
sampleRate: 1
})