Socket
Socket
Sign inDemoInstall

@elastic/apm-rum-core

Package Overview
Dependencies
Maintainers
76
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elastic/apm-rum-core

Elastic apm core


Version published
Weekly downloads
133K
decreased by-1.1%
Maintainers
76
Weekly downloads
 
Created

What is @elastic/apm-rum-core?

@elastic/apm-rum-core is a JavaScript library for Real User Monitoring (RUM) that allows you to measure the performance of your web applications. It helps you capture and analyze user interactions, page load times, and other performance metrics to improve the user experience.

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

Initialize APM

This code initializes the APM agent with the specified service name, server URL, and environment. Initialization is the first step to start monitoring your application.

const { init } = require('@elastic/apm-rum-core');
const apm = init({
  serviceName: 'my-service',
  serverUrl: 'http://localhost:8200',
  environment: 'production'
});

Capture Page Load Metrics

This function captures the page load metrics, including the time it takes for the page to load and other relevant performance data.

apm.capturePageLoad();

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 capture its performance metrics.

const transaction = apm.startTransaction('custom-transaction', 'custom');
// Perform some operations
transaction.end();

Capture Errors

This code captures errors that occur in your application. It helps you track and analyze errors to improve the stability and reliability of your application.

try {
  // Some code that might throw an error
} catch (error) {
  apm.captureError(error);
}

Other packages similar to @elastic/apm-rum-core

FAQs

Package last updated on 10 Jan 2022

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