npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@goopil/clusterkit-otlp-meter

v1.0.2

Published

OpenTelemetry OTLP metrics plugin for @goopil/clusterkit: exports orchestration counters/gauges and per-worker host metrics via OTLP/HTTP or OTLP/gRPC to a collector.

Downloads

770

Readme

@goopil/clusterkit-otlp-meter

OpenTelemetry OTLP metrics plugin for @goopil/clusterkit.

This package exports orchestration metrics and per-worker host metrics via OTLP (OpenTelemetry Protocol) to a collector. It supports both OTLP/HTTP and OTLP/gRPC transports.

Capabilities

| Capability | Details | |------------|---------| | Orchestration metrics | Tracks active workers, restarts, crashes, and circuit-breaker trips from orchestrator events | | Host/process metrics | Optional Node.js process metrics (CPU, memory, GC, event loop) via @opentelemetry/host-metrics | | OTLP/HTTP export | Push metrics to an OTLP/HTTP collector endpoint (default) | | OTLP/gRPC export | Push metrics to an OTLP/gRPC collector endpoint (optional) | | Primary/worker-aware behavior | Event listeners only on primary, host metrics on workers (or primary in single-worker mode) |

Installation

pnpm add @goopil/clusterkit-otlp-meter @opentelemetry/api @opentelemetry/sdk-metrics @opentelemetry/resources @opentelemetry/semantic-conventions @opentelemetry/exporter-metrics-otlp-http

For gRPC transport, also install:

pnpm add @opentelemetry/exporter-metrics-otlp-grpc

For host/process metrics, also install:

pnpm add @opentelemetry/host-metrics

Usage

import { Orchestrator } from "@goopil/clusterkit";
import { createOtlpMeterPlugin } from "@goopil/clusterkit-otlp-meter";

const orchestrator = new Orchestrator({ logger: console });

const otlp = createOtlpMeterPlugin({
  endpoint: "http://otel-collector:4318/v1/metrics",
  protocol: "http",
  serviceName: "my-app",
  instrumentation: true,
  exportIntervalMs: 30_000,
  attributes: { environment: "production" },
});

orchestrator.use(otlp).run(async () => {
  // your app bootstrap
});

Options (OtlpMeterPluginOptions)

| Option | Type | Default | Description | |--------|------|---------|-------------| | endpoint | string | http://localhost:4318/v1/metrics (HTTP) or localhost:4317 (gRPC) | OTLP collector endpoint URL | | protocol | 'http' \| 'grpc' | 'http' | OTLP transport protocol | | instrumentation | boolean | true | Collect Node.js host/process metrics | | prefix | string | 'clusterkit.' | Metric name prefix | | attributes | Record<string, string \| number \| boolean> | {} | Static resource attributes | | exportIntervalMs | number | 60000 | Export interval in milliseconds | | serviceName | string | 'clusterkit' | Service name for the OpenTelemetry Resource |

API (OtlpMeterPlugin)

otlp.meterProvider; // MeterProvider | undefined
await otlp.shutdown(); // flush and close

Custom metrics

The plugin registers its MeterProvider as the OpenTelemetry global, so you can create custom metrics from anywhere in your application without a reference to the plugin instance:

import { metrics } from "@opentelemetry/api";

const meter = metrics.getMeter("my-app");
const httpRequests = meter.createCounter("http.requests", {
  description: "Total HTTP requests",
});

httpRequests.add(1);

This works in both primary and worker processes — each process has its own provider pushing to the same collector endpoint.

Metrics exposed

With the default prefix (clusterkit.):

  • clusterkit.active_workers (ObservableGauge)
  • clusterkit.worker.restarts (Counter)
  • clusterkit.worker.crashes (Counter)
  • clusterkit.circuit_breaker.trips (Counter)

Plus Node.js host/process metrics from @opentelemetry/host-metrics when instrumentation: true.

In single-worker mode (workers: 1), the orchestrator runs the app directly in the primary process without forking. The plugin collects host metrics on the primary since there are no worker processes to collect from.

Security / exposure notes

  • This plugin does not open listening sockets — it pushes to a collector endpoint.
  • Your collector endpoint should be on a private network or behind access controls.
  • Treat metrics as operationally sensitive because they can expose process, topology, runtime, and workload details.

Related docs