Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
elastic-apm-node
Advanced tools
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.
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);
The newrelic package is an APM agent for Node.js applications provided by New Relic. It offers similar functionalities such as transaction tracing, error capturing, and custom instrumentation. New Relic provides a comprehensive monitoring solution with a rich set of features and integrations.
The appdynamics package is an APM agent for Node.js applications provided by AppDynamics. It offers features like transaction tracing, error capturing, and custom metrics. AppDynamics is known for its advanced analytics and machine learning capabilities to provide deep insights into application performance.
This is the official Node.js agent for Elastic APM.
If you are trying out APM and have feedback or questions, please post them on the Discuss forum.
To run Elastic APM for your own applications, make sure you have the prerequisites in place first. This agent is compatible with APM Server v6.2. For details see Getting Started with Elastic APM
Now follow the documentation links below relevant to your framework or stack to get set up
To ease development,
set the environment variable DEBUG_PAYLOAD=1
to have the agent dump the JSON payload sent to the APM Server to a temporary file on your local harddrive.
Please see the testing section in CONTRIBUTING.md for testing instructions.
Made with ♥️ and ☕️ by Elastic and our community.
FAQs
The official Elastic APM agent for Node.js
The npm package elastic-apm-node receives a total of 378,762 weekly downloads. As such, elastic-apm-node popularity was classified as popular.
We found that elastic-apm-node demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.