Performance Monitoring for Meteor based on Elastic APM
- Meteor methods execution - it tracks their execution time with detailed information of what db queries was executed
- Meteor pub/sub, tracks publications response time
- Meteor pub/sub - operations, how much documents was added, updated, removed
- Async ops inside methods and pubs, for example http requests
- Incoming and outcoming HTTP requests
- Errors - with detailed information and stack traces
- CPU usage
- Memory usage
- Session count
https://github.com/kschingiz/meteor-elastic-apm/blob/master/assets/
- Install and configure elasticsearch - https://www.elastic.co/downloads/elasticsearch
- Install and configure Kibana - https://www.elastic.co/downloads/kibana
- Install and configure elastic APM server - https://www.elastic.co/downloads/apm
Then
meteor add kschingiz:meteor-elastic-apm
Then somewhere in your server code, Elastic documentation stays that Agent.start should be executed before anything else, and should be at the very top of your code
import Agent from 'meteor/kschingiz:meteor-elastic-apm';
Agent.start(options);
Meteor Up is a production quality Meteor app deployment tool. We expect you already has up and running Meteor app on server deployed with MUP.
mup ssh
wget https://raw.githubusercontent.com/elastic/apm-server/master/apm-server.yml && cp apm-server.yml /etc/apm-server/apm-server.yml
- Now you need to edit /etc/apm-server/apm-server.yml, at least you need to add you elastic search url under
output.elasticsearch
. When you finish just close this terminal - Now we need to update mup.js file to: a) Install apm-server in app container b) Pass apm-server config file into our app container c) Start it everytime after deploy
{
app: {
...
volumes: {
'/etc/apm-server/apm-server.yml': '/etc/apm-server/apm-server.yml'
},
docker: {
...
buildInstructions: [
// https://www.elastic.co/guide/en/apm/server/current/setup-repositories.html
'RUN apt-get install wget -y',
'RUN wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -',
'RUN apt-get install apt-transport-https',
'RUN echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-6.x.list',
'RUN apt-get update && apt-get install apm-server -y',
'RUN update-rc.d apm-server defaults 95 10'
]
}
...
},
...
hooks: {
// Run apm-server
'post.deploy'(api) {
return api.runSSHCommand(
api.getConfig().servers.one,
'docker exec development service apm-server start'
);
}
},
}
https://github.com/kschingiz/demo-meteor-elastic-apm
Agent is based on elastic/apm-agent-nodejs
and fully supports all of it's features https://github.com/elastic/apm-agent-nodejs
All contributions are welcome, Let's make the better APM together!