Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

elastic-apm-node

Package Overview
Dependencies
Maintainers
3
Versions
162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elastic-apm-node

The official Elastic APM agent for Node.js

  • 4.9.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created

What is elastic-apm-node?

The elastic-apm-node package is an official Elastic APM (Application Performance Monitoring) agent for Node.js applications. It allows you to monitor the performance of your Node.js applications by collecting metrics, tracing requests, and capturing errors. This helps in identifying performance bottlenecks and understanding the behavior of your application in production.

What are elastic-apm-node's main functionalities?

Transaction Tracing

This feature allows you to trace transactions in your application. You can start and end transactions to measure the time taken for specific operations.

const apm = require('elastic-apm-node').start({
  serviceName: 'my-service',
  serverUrl: 'http://localhost:8200'
});

// Start a transaction
const transaction = apm.startTransaction('myTransaction');

// Do some work
setTimeout(() => {
  // End the transaction
  transaction.end();
}, 1000);

Error Capturing

This feature allows you to capture and report errors that occur in your application. The captured errors are sent to the APM server for analysis.

const apm = require('elastic-apm-node').start({
  serviceName: 'my-service',
  serverUrl: 'http://localhost:8200'
});

try {
  throw new Error('Something went wrong');
} catch (error) {
  apm.captureError(error);
}

Custom Spans

This feature allows you to create custom spans within a transaction to measure the time taken for specific blocks of code. This helps in identifying performance bottlenecks within a transaction.

const apm = require('elastic-apm-node').start({
  serviceName: 'my-service',
  serverUrl: 'http://localhost:8200'
});

const transaction = apm.startTransaction('myTransaction');
const span = transaction.startSpan('myCustomSpan');

// Do some work
setTimeout(() => {
  span.end();
  transaction.end();
}, 1000);

Other packages similar to elastic-apm-node

Keywords

FAQs

Package last updated on 10 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc