Coder Social home page Coder Social logo

monti-apm-agent's Introduction

Travis

Monti APM - Performance Monitoring for Meteor

This package is based on meteorhacks/kadira.

Getting started

  1. Create an account at https://montiapm.com
  2. From the UI, create an app. You'll get an AppId and an AppSecret.
  3. Run meteor add montiapm:agent in your project
  4. Configure your Meteor app with the AppId and AppSecret by adding the following code snippet to a server/monti.js file:
Meteor.startup(function() {
  Monti.connect('<AppId>', '<AppSecret>');
});

Now you can deploy your application and it will send information to Monti APM. Wait up to one minute and you'll see data appearing in the Monti APM Dashboard.

Auto Connect

Your app can connect to Monti APM using environment variables or Meteor.settings.

Using Meteor.settings

Use the followng settings.json file with your app:

{
  ...
  "monti": {
    "appId": "<appId>",
    "appSecret": "<appSecret>"
  }
  ...
}

The run your app with meteor --settings=settings.json.

Using Environment Variables

Export the following environment variables before running or deploying your app:

export MONTI_APP_ID=<appId>
export MONTI_APP_SECRET=<appSecret>

Error Tracking

Monti APM comes with built in error tracking solution for Meteor apps. It has been enabled by default. For more information, please visit our docs on error tracking.

Options

The Monti APM agent can be configured by

  • environment variables, prefixed with either MONTI_ or KADIRA_
  • settings.json in the monti or kadira object. Options other than appId and appSecret should be in monti.options or kadira.options.
  • code with Monti.connect('app id', 'app secret', options)

You should use the same method that you used to give the agent the app id and secret.

List of Options

name env variable default description
appId APP_ID none
appSecret APP_SECRET none
enableErrorTracking OPTIONS_ENABLE_ERROR_TRACKING true enable sending errors to Monti APM
endpoint OPTIONS_ENDPOINT https://engine.montiapm.com Monti / Kadira engine url
hostname OPTIONS_HOSTNAME Server's hostname What the instance is named in Monti APM
uploadSourceMaps UPLOAD_SOURCE_MAPS true Enables sending source maps to Monti APM to improve error stack traces
recordIPAddress RECORD_IP_ADDRESS 'full' Set to 'full' to record IP Address, 'anonymized' to anonymize last octet of address, or 'none' to not record an IP Address for client errors
eventStackTrace EVENT_STACK_TRACE false If true, records a stack trace when an event starts. Slightly decreases server performance.

Traces

The agent collects traces of methods and publish functions. Every minute, it sends the outlier traces to Monti APM for you to view.

By default, it tracks events for:

  • method/pubsub start
  • wait time
  • uncaught errors
  • db
  • http
  • email
  • async (time between the fiber yielding and running again)
  • method/pubsub complete

Time between an event ending and the next event starting becomes a compute event.

The agent records up to one level of nested events.

You can add custom events to the traces to time specific code or events, or to provide more details to the trace.

const event = Monti.startEvent('event name', {
  details: true
});

// After code runs or event happens
Monti.endEvent(event, {
  additionalDetails: true
});

You can use any name you want. The second parameter is an object with data that is shown to you in the Monti APM UI. The data objects from starting and ending the event are merged together.

Please note that the total size of all traces uploaded each minute is limited (usually around 5mb), and if it is too large the traces and metrics are not stored. Avoid having 1,000's of custom events per trace or adding very large data objects.

monti-apm-agent's People

Contributors

arunoda avatar thani-sh avatar zodern avatar roonyh avatar pahans avatar gaetandezeiraud avatar dandv avatar abernix avatar sebakerckhof avatar gbhrdt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.