Socket
Book a DemoInstallSign in
Socket

@opentelemetry/host-metrics

Package Overview
Dependencies
Maintainers
3
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/host-metrics

OpenTelemetry Host Metrics for Node.js

0.36.0
latest
Source
npmnpm
Version published
Weekly downloads
144K
-18.03%
Maintainers
3
Weekly downloads
 
Created

What is @opentelemetry/host-metrics?

@opentelemetry/host-metrics is a package that provides metrics related to the host system, such as CPU and memory usage. It is part of the OpenTelemetry project, which is a set of APIs, libraries, agents, and instrumentation to provide observability for cloud-native software.

What are @opentelemetry/host-metrics's main functionalities?

Collect CPU Usage Metrics

This feature allows you to collect CPU usage metrics from the host system. The code sample demonstrates how to initialize the HostMetrics class and start collecting metrics using a MeterProvider.

const { HostMetrics } = require('@opentelemetry/host-metrics');
const { MeterProvider } = require('@opentelemetry/sdk-metrics-base');

const meterProvider = new MeterProvider();
const hostMetrics = new HostMetrics({ meterProvider });

hostMetrics.start();

// The metrics will be collected and can be exported using an exporter.

Collect Memory Usage Metrics

This feature allows you to collect memory usage metrics from the host system. The code sample shows how to set up the HostMetrics to start collecting memory metrics using a MeterProvider.

const { HostMetrics } = require('@opentelemetry/host-metrics');
const { MeterProvider } = require('@opentelemetry/sdk-metrics-base');

const meterProvider = new MeterProvider();
const hostMetrics = new HostMetrics({ meterProvider });

hostMetrics.start();

// Memory usage metrics will be collected and can be exported using an exporter.

Other packages similar to @opentelemetry/host-metrics

Keywords

opentelemetry

FAQs

Package last updated on 18 Mar 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.