Skip to content
Meteor Elastic APM integration
Branch: master
Clone or download
kschingiz Merge pull request #32 from kschingiz/fix_null_span
Fixed all null span or transaction bugs
Latest commit 97653ae Aug 20, 2019


Build Status codecov

Performance Monitoring for Meteor based on Elastic APM

Meteor Elastic APM screenshot

Getting started

  1. Install and configure elasticsearch -
  2. Install and configure Kibana -
  3. Install and configure elastic APM server -

Then in your Meteor project

meteor add kschingiz:meteor-elastic-apm

Maybe you will need to also install

meteor add http mongo-livequery

Then somewhere in your server code, Elastic documentation says 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';

const options = {
  serviceName: 'meteor-demo-app'

Complete list of Agent options

What it monitors

  1. Meteor methods: method params, result, exceptions, stack trace
  2. Meteor pub/sub: tracks publications response time, params, exceptions, result
  3. Meteor collection methods(find, insert, etc...): params, result, execution time
  4. MongoDB cursor method(fetch, map, etc...): params, result, execution time
  5. Trace async execution
  6. All Incoming and outgoing HTTP requests, useful if you have REST API
  7. Exception handling


From version 2.2.0 the package collects and sends meteor specific metrics to the apm-server. You can learn how it works and how to use it in Metrics docs


Kibana APM with Meteor with MUP

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.

  1. mup ssh
  2. wget && cp apm-server.yml /etc/apm-server/apm-server.yml
  3. 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
  4. 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: [
        'RUN apt-get install wget -y',
        'RUN wget -qO - | apt-key add -',
        'RUN apt-get install apt-transport-https',
        'RUN echo "deb 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(
        'docker exec development service apm-server start'

demo app


Agent is based on elastic/apm-agent-nodejs and fully supports all of it's features


All contributions are welcome, Let's make the better APM together!

You can’t perform that action at this time.