Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@opentelemetry/host-metrics

Package Overview
Dependencies
Maintainers
3
Versions
35
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.35.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
102K
increased by5.52%
Maintainers
3
Weekly downloads
 
Created
Source

OpenTelemetry Host Metrics for Node.js

NPM Published Version Apache License

This module provides automatic collection of Host Metrics which includes metrics for:

  • CPU
  • Memory
  • Network

Compatible with OpenTelemetry JS API and SDK 1.0+.

Installation

npm install --save @opentelemetry/host-metrics

Usage

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

const exporter = new PrometheusExporter(
  {
    startServer: true
  }, () => {
    console.log('prometheus scrape endpoint: http://localhost:9464/metrics')
  }
);

const meterProvider = new MeterProvider({
  readers: [reader],
});

const hostMetrics = new HostMetrics({ meterProvider });
hostMetrics.start();

Semantic Conventions

This package uses Semantic Conventions Version 1.25.0. As for now the Semantic Conventions are bundled in this package but eventually will be imported from @opentelemetry/semantic-conventions package when it is updated to latest version. Ref: opentelemetry-js/issues/4235

Metrics collected:

MetricShort Description
system.cpu.timeSeconds each logical CPU spent on each mode
system.cpu.utilizationCPU usage time (0-1)
system.memory.usageReports memory in use by state
system.memory.utilizationMemory usage (0-1)
system.network.droppedCount of packets that are dropped
system.network.errorsCount of network errors detected
system.network.ioNetwork flow direction
process.cpu.timeTotal CPU seconds
process.cpu.utilizationDifference in process.cpu.time since the last measurement
process.memory.usageThe amount of physical memory in use

Attributes collected:

MetricShort Description
system.cpu.logical_numberThe logical CPU number
system.cpu.stateThe state of the CPU
system.memory.stateThe memory state
system.deviceThe device identifier
network.io.directionThe network IO operation direction
system.network.stateThe network state
process.cpu.stateThe CPU state

License

APACHE 2.0 - See LICENSE for more information.

Keywords

FAQs

Package last updated on 08 Oct 2024

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