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
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();
Useful links
- For more information on OpenTelemetry, visit: https://opentelemetry.io/
- For more about OpenTelemetry JavaScript: https://github.com/open-telemetry/opentelemetry-js
- For help or feedback on this project, join us in GitHub Discussions
License
APACHE 2.0 - See LICENSE for more information.