You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@elastic/apm-rum

Package Overview
Dependencies
Maintainers
60
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elastic/apm-rum

Elastic APM JavaScript agent


Version published
Weekly downloads
160K
increased by12.8%
Maintainers
60
Install size
3.11 MB
Created
Weekly downloads
 

Package description

What is @elastic/apm-rum?

@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.

What are @elastic/apm-rum's main functionalities?

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);
}

Other packages similar to @elastic/apm-rum

Readme

Source

Elastic APM Real User Monitoring (RUM) JavaScript agent

This is the main package for Elastic APM Real User Monitoring.

Documentation

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.

License

This project is MIT licensed.


Made with ♥️ and ☕️ by Elastic and our community.

FAQs

Package last updated on 27 Dec 2023

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc