How to use the elastic-apm-node.setFramework function in elastic-apm-node

To help you get started, we’ve selected a few elastic-apm-node examples, based on popular ways it is used in public projects.

github kschingiz / meteor-elastic-apm / meteor-elastic-apm.js View on Github external
const { Session, Subscription, MongoCursor } = require('./meteorx');

const instrumentMethods = require('./instrumenting/methods');
const instrumentHttp = require('./instrumenting/http');
const instrumentSession = require('./instrumenting/session');
const instrumentSubscription = require('./instrumenting/subscription');
const instrumentAsync = require('./instrumenting/async');
const instrumentDB = require('./instrumenting/db');
const startMetrics = require('./metrics');

const hackDB = require('./hacks');

const [framework, version] = Meteor.release.split('@');

Agent.setFramework({
  name: framework,
  version,
  override: true
});

shimmer.wrap(Agent, 'start', function(startAgent) {
  return function(...args) {
    const config = args[0] || {};

    if (config.active !== false) {
      Meteor.startup(() => {
        try {
          hackDB();

          instrumentMethods(Agent, Meteor);
          instrumentHttp(Agent, WebApp);