Moves metrics into its own pkg to be able to instrument other services

- With the Metrics module inside nylas-core, and bc of our current lerna
setup, we required other modules like sequelize and redis before requiring
newrelic, thus preventing them from being properly instrumented
This commit is contained in:
Juan Tejada 2016-07-14 11:20:58 -07:00
parent 592b2af986
commit b58c11605c
12 changed files with 22 additions and 9 deletions

View file

@ -12,14 +12,12 @@
"imap": "0.8.x",
"lerna": "2.0.0-beta.23",
"mysql": "^2.11.1",
"newrelic": "^1.28.1",
"pm2": "^1.1.3",
"promise-props": "^1.0.0",
"promise.prototype.finally": "^1.0.1",
"redis": "2.x.x",
"rx": "4.x.x",
"sequelize": "3.x.x",
"signalfx": "^3.0.1",
"underscore": "1.x.x",
"utf7": "https://github.com/truebit/utf7/archive/1f753bac59b99d93b17a5ef11681e232465e2558.tar.gz"
},

View file

@ -1,4 +1,4 @@
const {Metrics} = require(`nylas-core`)
const Metrics = require(`nylas-metrics`)
Metrics.startCapturing('nylas-k2-api')
const Hapi = require('hapi');

View file

@ -17,6 +17,7 @@
"joi": "8.4.2",
"nylas-core": "0.x.x",
"nylas-sync": "0.x.x",
"nylas-metrics": "0.x.x",
"vision": "4.1.0"
}
}

View file

@ -11,6 +11,5 @@ module.exports = {
MessageTypes: require('./message-types'),
Logger: require('./logger'),
Errors: require('./imap-errors'),
Metrics: require('./metrics'),
PromiseUtils: require('./promise-utils'),
}

View file

@ -1,4 +1,4 @@
const {Metrics} = require(`nylas-core`)
const Metrics = require(`nylas-metrics`)
Metrics.startCapturing('nylas-k2-dashboard')
const fs = require('fs');

View file

@ -12,6 +12,7 @@
"hapi": "13.4.1",
"hapi-plugin-websocket": "0.9.2",
"inert": "4.0.0",
"nylas-core": "0.x.x"
"nylas-core": "0.x.x",
"nylas-metrics": "0.x.x"
}
}

View file

@ -1,4 +1,4 @@
const {Metrics} = require(`nylas-core`)
const Metrics = require(`nylas-metrics`)
Metrics.startCapturing('nylas-k2-message-processor')
const {PubsubConnector, DatabaseConnector, Logger} = require(`nylas-core`)

View file

@ -14,7 +14,8 @@
"jasmine": "2.4.1",
"mailparser": "0.6.0",
"mimelib": "0.2.19",
"nylas-core": "0.x.x"
"nylas-core": "0.x.x",
"nylas-metrics": "0.x.x"
},
"devDependencies": {
"babel-cli": "^6.10.1",

View file

@ -0,0 +1,12 @@
{
"name": "nylas-metrics",
"version": "0.0.1",
"description": "Metrics package",
"main": "index.js",
"dependencies": {
"newrelic": "^1.28.1",
"signalfx": "^3.0.1"
},
"author": "Nylas",
"license": "ISC"
}

View file

@ -1,4 +1,4 @@
const {Metrics} = require(`nylas-core`)
const Metrics = require(`nylas-metrics`)
Metrics.startCapturing('nylas-k2-sync')
const {DatabaseConnector, Logger} = require('nylas-core')

View file

@ -5,6 +5,7 @@
"dependencies": {
"nylas-core": "0.x.x",
"nylas-message-processor": "0.x.x",
"nylas-metrics": "0.x.x",
"xoauth2": "1.1.0"
},
"scripts": {