Custom Instrumentation
  • Updated on 11 Apr 2019
  • 1 minute to read
  • Contributors
  • Print
  • Share
  • Dark
    Light

Custom Instrumentation

  • Print
  • Share
  • Dark
    Light

Configuration

Custom Instrumentation allows you to track classes and functions not natively supported in our NodeJS Profiler. This requires adding an instrumentation section to your stackify.js configuration file.

Example:

/**
 * Stackify Node APM Configuration
 */
exports.config = {
  /**
   * Your application name.
   */
  application_name: 'Node Application',
  /**
   * Your environment name.
   */
  environment_name: 'Production',
  /**
   * Your custom instrumentation.
   */
  instrumentations: [
    // custom instrumentation on a local class file
    {
      module: './other.js',
      class: 'Other',
      method: 'execute'
    },
    // custom instrumentation on a 3rd party module class
    {
      module: 'random',
      class: 'Random',
      method: 'boolean'
    }
  ]
}

Tracked Functions

Tracked Functions allows you to track a specific method call across requests, data will show up in your application dashboard under the Tracked Functions tab.

Example:

{
    module: 'random',
    class: 'Random',
    method: 'boolean',
    trackedFunction: true,
}
Was this article helpful?