1

Node.js application access Skywalking achieve APM monitoring

1: I use windows , please install itself started Skywalking , Download: , the download is complete, start the decompression Skywalking after visiting HTTP: // localhost: 8080 / (default configuration), this installation start Skywalking success .

2: Node.js application access, Skywalking officially provides a new library to access, the original module is SkyAPM-nodejs , the official requirement SkyWalking backend (OAP) 8.0+ and NodeJS >= 10. support the framework and modules, see README

LibraryPlugin Name
built-in http and https modulehttp / https
Expressexpress
Axiosaxios
MySQLmysql
MySQLmysql2
PostgreSQLpg
pg-cursorpg-cursor
MongoDBmongodb
Mongoosemongoose
RabbitMQamqplib
Redisioredis

3: Example of access code: complete code address :

require('make-promises-safe')
const {default: agent} = require('skywalking-backend-js');
agent.start({              //引用
    serviceName: 'my-service-name',
    serviceInstance: 'my-service-instance-name',
    // collectorAddress: 'http://localhost:8080',
})

var express = require('express')
var app = express();
var port = process.env.PORT || 3001;

var routes = require('./api/routes');
routes(app);
app.listen(port, function() {
    console.log('Server started on port: ' + port);
});

4:
Two routes are defined in the sample code:

  1. http://localhost:3001/about
  2. http://localhost:3001/distance/:zipcode1/:zipcode2

Run and start, the browser visits your service route, you can visit it a few more times, there will be more data, and then refresh http://localhost:8080/ , the data may be delayed, wait a little bit [PS: If you wait There is still no data for a long time, check whether the time interval you are viewing is correct]

The normal is as follows:

1637912085(1).jpg

1637912201(1).jpg

As you can see from the above figure: the application has been connected to skywalking monitoring, click each option to view each function, link tracking, performance monitoring analysis, etc., redis,mysql,http links are available, you can clearly see the Node.js application links The time spent on the road can better monitor and troubleshoot problems. skywalking More functions users have explored by themselves.

Follow-up: websocket , kafka, rpc , GraphQL etc. Node.js probe support remains to be explored.
skywalking-backend-js also planning the V0.4.0 version. At present, we have seen that several PR have been merged. The content of the bug and some small details have been changed, but no new features have been seen. Looking forward to new features. . . .


神话
1.6k 声望37 粉丝

编程使我快乐!Node.js excel处理库 @zurmokeeper/exceljs 支持读取加密excel和导出加密excel,支持多表头excel快捷导出