Socket
Book a DemoInstallSign in
Socket

@opentelemetry/instrumentation-document-load

Package Overview
Dependencies
Maintainers
2
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/instrumentation-document-load

OpenTelemetry instrumentation for document load operations in browser applications

latest
Source
npmnpm
Version
0.50.0
Version published
Weekly downloads
315K
6.12%
Maintainers
2
Weekly downloads
 
Created

What is @opentelemetry/instrumentation-document-load?

@opentelemetry/instrumentation-document-load is an npm package that provides automatic instrumentation for document load events in web applications. It helps in capturing and reporting performance metrics related to the loading of web pages, which can be useful for monitoring and optimizing the performance of web applications.

What are @opentelemetry/instrumentation-document-load's main functionalities?

Automatic Instrumentation of Document Load

This feature allows you to automatically instrument document load events. The code sample demonstrates how to set up the instrumentation using the `DocumentLoadInstrumentation` class and `registerInstrumentations` function.

const { DocumentLoadInstrumentation } = require('@opentelemetry/instrumentation-document-load');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');

registerInstrumentations({
  instrumentations: [
    new DocumentLoadInstrumentation(),
  ],
});

Custom Span Attributes

This feature allows you to add custom attributes to the spans created during document load events. The code sample shows how to use the `applyCustomAttributesOnSpan` option to set a custom attribute on the span.

const { DocumentLoadInstrumentation } = require('@opentelemetry/instrumentation-document-load');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');

const documentLoadInstrumentation = new DocumentLoadInstrumentation({
  applyCustomAttributesOnSpan: (span) => {
    span.setAttribute('custom_attribute', 'value');
  },
});

registerInstrumentations({
  instrumentations: [documentLoadInstrumentation],
});

Other packages similar to @opentelemetry/instrumentation-document-load

Keywords

opentelemetry

FAQs

Package last updated on 10 Sep 2025

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.