JSPM

  • Created
  • Published
  • Downloads 97115
  • Score
    100M100P100Q241505F
  • License Apache-2.0

OpenTelemetry Host Metrics for Node.js

Package Exports

  • @opentelemetry/host-metrics

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@opentelemetry/host-metrics) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

#OpenTelemetry Host Metrics for Node.js Gitter chat NPM Published Version dependencies devDependencies Apache License

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

  • CPU
  • Memory
  • Network

Installation

npm install --save @opentelemetry/host-metrics

Usage

const { MeterProvider } = require('@opentelemetry/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({
  exporter,
  interval: 2000,
});

const hostMetrics = new HostMetrics({ meterProvider, name: 'example-host-metrics' });
hostMetrics.start();

License

APACHE 2.0 - See LICENSE for more information.