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

@sesamecare-oss/opentelemetry-node-metrics

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sesamecare-oss/opentelemetry-node-metrics

A modernized set of node metrics for OpenTelemetry

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

opentelemetry-node-metrics

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

  • Marc Bachmann's opentelemetry-node-metrics
  • Simon Nyberg's prom-client

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.

Keywords

FAQs

Package last updated on 21 Sep 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