@sesamecare-oss/opentelemetry-node-metrics
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

opentelemetry-node-metrics

A modernized set of node metrics for OpenTelemetry. Based on two excellent modules:

Usage:

yarn add @sesamecare-oss/opentelemetry-node-metrics

Wire up OTEL as normal - using node auto instrumentations or manual setup as you wish. Then, at an appropriate place, include something like the below:

import { metrics } from '@opentelemetry/api';
import { setupNodeMetrics } from '@sesamecare-oss/opentelemetry-node-metrics';

const meter = metrics.getMeterProvider().getMeter('node-metrics');
setupNodeMetrics(meter);

Now your Prometheus-exported metrics should be included along with whatever other metrics you ahve selected. See openapi-typescript-infra/service for a more complete example of metrics integrated with an express service host.

One notable change from the existing libraries - they divide active handles and active 'requests' using deprecated Node APIs. I've chosed to merge these into 'resources' using the new getActiveResourcesInfo API, which is Node17+. It should fail gracefully if that function is not available.

Readme

Keywords

Package Sidebar

Install

npm i @sesamecare-oss/opentelemetry-node-metrics

Weekly Downloads

7,165

Version

1.0.1

License

UNLICENSED

Unpacked Size

132 kB

Total Files

89

Last publish

Collaborators

  • djmax