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
Library | Plugin Name |
---|---|
built-in http and https module | http / https |
Express | express |
Axios | axios |
MySQL | mysql |
MySQL | mysql2 |
PostgreSQL | pg |
pg-cursor | pg-cursor |
MongoDB | mongodb |
Mongoose | mongoose |
RabbitMQ | amqplib |
Redis | ioredis |
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:
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:
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. . . .
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。