Giter VIP home page Giter VIP logo

apm-agent-nodejs's Introduction

Elastic APM Node.js Agent

This is the official Node.js application performance monitoring (APM) agent for the Elastic Observability solution. It is a Node.js package that runs with your Node.js application to automatically capture errors, tracing data, and performance metrics. APM data is sent to your Elastic Observability deployment -- hosted in Elastic's cloud or in your own on-premises deployment -- where you can monitor your application, create alerts, and quick identify root causes of service issues.

If you have any feedback or questions, please post them on the Discuss forum.

npm tests

Installation

npm install --save elastic-apm-node

Getting started

First, you will need an Elastic Stack deployment. This is a deployment of APM Server (which receives APM data from the APM agent running in your application), Elasticsearch (the database that stores all APM data), and Kibana (the application that provides the interface to visualize and analyze the data). If you do not already have an Elastic deployment to use, follow this APM Quick Start guide to create a free trial on Elastic's cloud. From this deployment you will need the APM serverUrl and secretToken (or a configured apiKey) to use for configuring the APM agent.

Next, the best and easiest way to see how to install and start the APM agent is to follow one of the "Get started" guides for the web framework or technology that you are using:

Typically, the quick start steps are:

  1. Install the APM agent package as a dependency:

    npm install --save elastic-apm-node
    
  2. Configure and start the APM agent. For the APM agent's automatic instrumentation of popular modules to work, it must be started before your application imports its other dependencies. For example, if you use CommonJS, then put this at the very top of your main application file:

    require('elastic-apm-node').start({
        serverUrl: '<serverUrl from your Elastic Stack deployment>',
        secretToken: '<secretToken from your Elastic Stack deployment>'
        serviceName: '...', // https://www.elastic.co/guide/en/apm/agent/nodejs/current/configuration.html#service-name
        environment: '...', // https://www.elastic.co/guide/en/apm/agent/nodejs/current/configuration.html#environment
    });

There are other ways to start the APM agent: for example, to support starting the APM agent without having to change application code; or to avoid certain surprises when using TypeScript or other transpilers like Babel or esbuild. See Starting the agent for a reference of all ways to start the agent and for details on gotchas with transpilers and bundlers (like Webpack and esbuild).

If your application is using ES modules, please see ECMAScript module support for the current experimental support.

Documentation

The full Node.js APM agent documentation is here. Some important links:

  • Release notes
  • Supported Technologies describes the supported Node.js versions, which modules (and version ranges) are automatically traced, and other technologies.
  • Configuring the agent describes the different ways to configure the APM agent (via options to apm.start(...), environment variables, or other mechanisms).
  • Configuration options is a full configuration reference.
  • Troubleshooting describes some common issues and a way to get debugging output from the APM agent for bug reports.
  • Upgrading includes a guide for upgrading from each past major version of the APM agent.
  • Metrics describes the metrics that the APM agent automatically collects.
  • The APM agent includes an OpenTelemetry Bridge that allows one to use the vendor-agnostic OpenTelemetry API for manual instrumentation in your application, should you require manual instrumentation.

Active release branches

The following git branches are active:

Contributing

Contributions are very welcome. You can get in touch with us through our Discuss forum. If you have found an issue, you can open an issue at https://github.com/elastic/apm-agent-nodejs/issues.

If you are considering contributing code to the APM agent, please read our contribution guide.

Please see TESTING.md for instructions on how to run the test suite.

License

BSD-2-Clause


Made with ♥️ by Elastic and our community.

apm-agent-nodejs's People

Contributors

watson avatar trentm avatar dependabot[bot] avatar qard avatar mattrobenolt avatar v1v avatar astorm avatar david-luna avatar apmmachine avatar bmorelli25 avatar kuisathaverat avatar azylman avatar greenkeeper[bot] avatar simitt avatar alexanderwert avatar axw avatar adrivanhoudt avatar posquit0 avatar reakaleek avatar vanjacosic avatar vigneshshanmugam avatar yuxizhe avatar cotsog avatar jahtalab avatar mdelapenya avatar marsup avatar ruflin avatar cachedout avatar simonsimcity avatar sibelius 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.