Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@elastic/apm-rum
Advanced tools
@elastic/apm-rum is an Elastic APM Real User Monitoring (RUM) agent for JavaScript applications. It helps you monitor the performance of your web applications by collecting and sending performance metrics and errors to the Elastic APM server.
Initialize APM
This code initializes the APM agent with the specified service name, server URL, and environment. It sets up the agent to start collecting performance metrics and errors.
const apm = require('@elastic/apm-rum').init({
serviceName: 'my-service',
serverUrl: 'http://localhost:8200',
environment: 'production'
});
Capture Page Load Metrics
This code starts a transaction for capturing page load metrics. It helps in measuring the time taken for the page to load completely.
apm.startTransaction('page-load', 'page-load');
Capture Custom Transactions
This code demonstrates how to capture custom transactions. You can start a transaction, perform some operations, and then end the transaction to measure the time taken for those operations.
const transaction = apm.startTransaction('custom-transaction', 'custom');
// Perform some operations
transaction.end();
Capture Errors
This code captures errors and sends them to the APM server. It helps in monitoring and debugging issues in your application.
try {
// Some code that might throw an error
} catch (error) {
apm.captureError(error);
}
New Relic is a comprehensive monitoring tool that provides performance monitoring for web and mobile applications. It offers similar functionalities to @elastic/apm-rum, such as capturing performance metrics and errors, but also includes additional features like infrastructure monitoring and synthetic monitoring.
Datadog RUM (Real User Monitoring) is a part of the Datadog monitoring suite. It provides similar functionalities to @elastic/apm-rum, including capturing performance metrics and errors. Datadog RUM integrates seamlessly with other Datadog products, offering a unified monitoring solution.
Sentry is an error tracking and performance monitoring tool. It provides functionalities similar to @elastic/apm-rum, such as capturing errors and performance metrics. Sentry is known for its robust error tracking capabilities and detailed performance insights.
This is the main package for Elastic APM Real User Monitoring.
You can find our documentation on our website.
If you are interested in contributing to Elastic APM JavaScript agent, please see our contributing guide.
We'd love to hear your feedback, please take a minute to fill out our survey.
This project is MIT licensed.
Made with ♥️ and ☕️ by Elastic and our community.
FAQs
Elastic APM JavaScript agent
The npm package @elastic/apm-rum receives a total of 115,581 weekly downloads. As such, @elastic/apm-rum popularity was classified as popular.
We found that @elastic/apm-rum demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 60 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.