Giter VIP home page Giter VIP logo

tinelic's Introduction

Tinelic

Lightweight application performance and error monitoring server for GetSentry (raven.js) and New Relic agents.

Build Status

Live system with demo account (log-in: demo, password: demo): http://tinelic.skilap.org/web

Intro

We are developers. We see a lot of benefits from using of error reporting and app monitoring software. We tried to use many tools and nothing satisfied us. We tried to improve some of them but at the end we built our own. Everybody does the same ;)

Concept

Tinelic is Node.JS application which works as backend for application and error reporting agents and as GUI. In order to simplify things we didn't do any complex data processing and fully rely to MongoDB scalability. It gives us flexibility and enough capacity for midle sized apps.

For data collection Tinelic uses following agents:

  1. NewRelic APM agent (currently tested only Node.JS agent). Agent is used as is and just reports to Tinelic instead of original server. Application performance and error reporting is supported.
  2. GetSentry (Raven.JS) agent for browser error reporting. Agent is used as is and the same report to Tinelic.
  3. GetSentry (Raven.NodeJS) agent for server side error reporting. Useful when you need only error reporting.
  4. Tinelic code for end user browser side monitoring (Ajax & Page load)

Launch

  1. Install mongodb Preferable (but nor required) version 3.0 and above

  2. Get the code Pull this repository code and submodules (git pull & git submodule init & git submodule update)

  3. Install nodejs NodeJS > 0.12 or IO.JS

  4. Run server and access it on http://localhost/web

node app
  1. Use the app You can login into system with default admin user (admin/tinelic). Tinelic monitors itself so you'll immediatelly see some data.

  2. (optional) Add ssl certs and host name

  3. (optional) Compile minified code and launch in production mode

  • Install grunt and build production code grunt build
  • copy config.json to local-config.json and change env property to production

Agent configuration

Tinelic integrates all agents to monitor itself. So you can check its code for more details. Here are some brief details:

  1. NewRelic Add host:'some.server.com' property into newrelic.js configuration file. If your server doesn't have https connection also add port:80 and ssl:false properties. This will enable server side application performance and error reporting and client side real user behavior monitoring if it was already inegrated using newrelic.getBrowserTimingHeader()

  2. GetSentry (serve side) Init agent as follows:

new raven.Client('http://blah:[email protected]/collect/sentry/{project_id});
  1. GetSentry & Tinelic RUM (client side) It's possible to include and use only GetSentry error reporting or Tinelic RUM or both. Approperiate scripts should be referenced. In the example below we use combined version
<script src="//some.server.com/js/build/tinelic.js></script>
<script>
	var _t_page = new Date();
	Tinelic.config({
		url:location.protocol + 'some.server.com',
		project:"some_project",
		route:"some_route",
		_dtp:_t_page,
	});
	Raven.config(location.protocol + '//nah@' + location.hostname + (location.port ? ':' + location.port : '')+'/collect/sentry/{_t_self_id}', {
		dataCallback: function(data) {
			data._dtp = _t_page;
			data._dt = new Date();
			return data;
		}
	}).install();
</script>

MIT License

Copyright (c) PushOk Software

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

tinelic's People

Contributors

akovalyov avatar demetrio62 avatar sergeyksv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

tinelic's Issues

Adding rules fails

When adding a rule to the project, it seems as though trying to save "condition" for the rules required is not successful. I've added a screenshot to document the issue.

screen shot 2017-05-21 at 5 23 52 pm

mongodb support

Hi,

Trying out tinelic with mongo-3.2, I have:

{ MongoError: driver is incompatible with this server version
    at Object.toError (/usr/share/peerio-tinelic/node_modules/mongodb/lib/mongodb/utils.js:114:11)
    at __executeInsertCommand (/usr/share/peerio-tinelic/node_modules/mongodb/lib/mongodb/db.js:1926:27)
    at Db._executeInsertCommand (/usr/share/peerio-tinelic/node_modules/mongodb/lib/mongodb/db.js:2028:5)
    at Db.wrapped [as _executeInsertCommand] (/usr/share/peerio-tinelic/node_modules/newrelic/lib/instrumentation/mongodb.js:177:25)
    at /usr/share/peerio-tinelic/node_modules/mongodb/lib/mongodb/db.js:1348:12
    at /usr/share/peerio-tinelic/node_modules/mongodb/lib/mongodb/db.js:1442:20
    at /usr/share/peerio-tinelic/node_modules/mongodb/lib/mongodb/db.js:1196:16
    at /usr/share/peerio-tinelic/node_modules/mongodb/lib/mongodb/db.js:1905:9
    at Server.Base._callHandler (/usr/share/peerio-tinelic/node_modules/mongodb/lib/mongodb/connection/base.js:453:41)
    at /usr/share/peerio-tinelic/node_modules/mongodb/lib/mongodb/connection/server.js:488:18
    at MongoReply.parseBody (/usr/share/peerio-tinelic/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
    at .<anonymous> (/usr/share/peerio-tinelic/node_modules/mongodb/lib/mongodb/connection/server.js:446:20)
    at emitOne (events.js:96:13)
    at emit (events.js:188:7)
    at .<anonymous> (/usr/share/peerio-tinelic/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:207:13)
    at emitTwo (events.js:106:13)
    at emit (events.js:191:7)
    at Socket.<anonymous> (/usr/share/peerio-tinelic/node_modules/mongodb/lib/mongodb/connection/connection.js:440:22)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at TCP.onread (net.js:548:20) name: 'MongoError' }

Trying to update mongodb node module to the last version available, I have:

TypeError: Cannot read property 'serverConfig' of undefined
    at Object.ensureIndex (/usr/share/peerio-tinelic/node_modules/tinyback/index.js:229:25)
    at /usr/share/peerio-tinelic/modules/usersapi.js:41:37
    at err (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:543:12)
    at _runCatcher (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:360:11)
    at _run (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:392:13)
    at err (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:542:4)
    at fnw (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:629:13)
    at _runCatcher (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:360:11)
    at _run (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:392:13)
    at _run_once (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:404:3)
    at task (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:648:6)
    at /usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:662:6
    at _controlFlow (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:541:3)
    at Object.safe.parallel (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:1596:3)
    at /usr/share/peerio-tinelic/modules/usersapi.js:40:11
    at _fnApply (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:173:22)
    at _catcher (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:349:11)
    at /usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:462:4
    at _wrapArgsSure (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:218:14)
    at Db.collection (/usr/share/peerio-tinelic/node_modules/mongodb/lib/db.js:454:20)
    at Db.wrapped [as collection] (/usr/share/peerio-tinelic/node_modules/newrelic/lib/instrumentation/mongodb.js:177:25)
    at users (/usr/share/peerio-tinelic/modules/usersapi.js:39:8)
    at err (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:543:12)
    at _runCatcher (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:360:11)
    at _run (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:392:13)
    at err (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:542:4)
    at fnw (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:629:13)
    at _runCatcher (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:360:11)
    at _run (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:392:13)
    at _run_once (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:404:3)
    at task (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:648:6)
    at /usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:662:6
    at _controlFlow (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:541:3)
    at Object.safe.series (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:1592:3)
    at /usr/share/peerio-tinelic/modules/usersapi.js:37:8
    at _fnApply (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:173:22)
    at _catcher (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:349:11)
    at /usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:462:4
    at _wrapArgsSure (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:218:14)
    at /usr/share/peerio-tinelic/node_modules/tinyback/index.js:217:12
    at _fnApply (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:173:22)
    at _catcher (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:349:11)
    at /usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:462:4
    at _wrapArgsSure (/usr/share/peerio-tinelic/node_modules/safe/lib/safe.js:218:14)
    at /usr/share/peerio-tinelic/node_modules/mongodb/lib/db.js:236:5
    at Server.connectHandler (/usr/share/peerio-tinelic/node_modules/mongodb/lib/server.js:330:7)
    at Server.g (events.js:291:16)
    at emitOne (events.js:96:13)
    at Server.emit (events.js:188:7)
    at /usr/share/peerio-tinelic/node_modules/mongodb-core/lib/topologies/server.js:280:14
    at /usr/share/peerio-tinelic/node_modules/mongodb-core/lib/connection/pool.js:455:18
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

The readme for this repository tells about mongodb "3.0 and above".
Looks like 3.2 support is broken. Test setup involving 3 config+2 shard servers, using mongodb-org packages, 3.2.11-amd64.

Regards.

State of the project

There are not updates since several years.

Please tell us the state of the project. Do you suggest to use a different project?

Does not appear to support Node 8.x or mongodb 2.x/3.x

macOS 10.13.2

When running Node 8.x, stuck at:

loaded prefixify in 0.002 s
loaded tson in 0.001 s
loaded validate in 0 s
loaded mongo in 0.001 s
loaded obac in 0 s
loaded restapi in 0.001 s

When running Node 5.x with mongodb 2.x/3.x:

loaded prefixify in 0.002 s
loaded tson in 0.001 s
loaded validate in 0 s
loaded mongo in 0.001 s
[TypeError: dbc.open is not a function]

Nodejs App not launching

tinelic@ip-172-31-18-37:~/tinelic$ node app
loaded prefixify in 0.003 s
loaded tson in 0.001 s
loaded validate in 0 s
loaded mongo in 0.002 s
loaded obac in 0 s
loaded restapi in 0.001 s
loaded cache in 0.196 s
loaded stats in 0.196 s
loaded users in 0.205 s
loaded assets in 0.201 s
loaded collect in 0.009 s
[TypeError: Exactly two arguments are required]

Any idea ?

Point agent at tinelic

Did I get this project wrong or can I point, for example, a sentry agent to tinelic? What would be the sentry DSN?

prototype pollution

there is a security issue regarding the /modules/tinybone/base.js function getQueryStringAsObject().
Vulnerability category: client-side prototype pollution.
Potential consequences: attacks such as Cross-Site Scripting, Denial-of-Service, Remote Code Execution or Session Hijacking.
POC:

   <script>
        getQueryStringAsObject = function(q) {
		var b, cv, e, k, ma, sk, v, r = {},
			d = function(v) {
				return decodeURIComponent(v).replace(/\+/g, " ");
			}, //# d(ecode) the v(alue)
			s = /([^&;=]+)=?([^&;]*)/g //# original regex that does not allow for ; as a delimiter:   /([^&=]+)=?([^&]*)/g
		;
		//# ma(make array) out of the v(alue)
		ma = function(v) {
			//# If the passed v(alue) hasn't been setup as an object
			if (typeof v != "object") {
				//# Grab the cv(current value) then setup the v(alue) as an object
				cv = v;
				v = {};
				v.length = 0;

				//# If there was a cv(current value), .push it into the new v(alue)'s array
				//#     NOTE: This may or may not be 100% logical to do... but it's better than loosing the original value
				if (cv) {
					Array.prototype.push.call(v, cv);
				}
			}
			return v;
		};
		//# While we still have key-value e(ntries) from the q(uerystring) via the s(earch regex)...
		while (e = s.exec(q)) { //# while((e = s.exec(q)) !== null) {
			//# Collect the open b(racket) location (if any) then set the d(ecoded) v(alue) from the above split key-value e(ntry)
			b = e[1].indexOf("[");
			v = d(e[2]);
			//# As long as this is NOT a hash[]-style key-value e(ntry)
			if (b < 0) { //# b == "-1"
				//# d(ecode) the simple k(ey)
				k = d(e[1]);
				//# If the k(ey) already exists
				if (r[k]) {
					//# ma(make array) out of the k(ey) then .push the v(alue) into the k(ey)'s array in the r(eturn value)
					r[k] = ma(r[k]);
					Array.prototype.push.call(r[k], v);
				}
				//# Else this is a new k(ey), so just add the k(ey)/v(alue) into the r(eturn value)
				else {
					r[k] = v;
				}
			}
			//# Else we've got ourselves a hash[]-style key-value e(ntry)
			else {
				//# Collect the d(ecoded) k(ey) and the d(ecoded) sk(sub-key) based on the b(racket) locations
				k = d(e[1].slice(0, b));
				sk = d(e[1].slice(b + 1, e[1].indexOf("]", b)));

				//# ma(make array) out of the k(ey)
				r[k] = ma(r[k]);

				//# If we have a sk(sub-key), plug the v(alue) into it
				if (sk) {
					r[k][sk] = v;
				}
				//# Else .push the v(alue) into the k(ey)'s array
				else {
					Array.prototype.push.call(r[k], v);
				}
			}
		}
		//# Return the r(eturn value)
		return r;
	};
    getQueryStringAsObject(window.location.search.substring(1))
    </script>
?__proto__[test]=test

Not receiving data from Ruby newrelic_rpm gem

Two problems with receiving data from the Ruby newrelic_rpm gem.

First problem is that the Ruby gem sends the data specifying version, license and method to call in the URI path instead of as parameters:
/agent_listener/#{PROTOCOL_VERSION}/#{@license_key}/#{method}

If I modify the Ruby gem to instead send this as parameters to the URI "/agent_listener/invoke_raw_method", then tinelic accepts the requests. The problem then being that it can't seem to parse the data.

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.