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

@platform-x/hep-observability

v1.0.2

Published

Platform-X shared OpenTelemetry metrics instrumentation for Node services (HTTP RED, GraphQL, dependency USE, runtime).

Readme

@platform-x/hep-observability

Shared OpenTelemetry metrics instrumentation for the Platform-X Node fleet — HTTP RED, GraphQL operation labeling, dependency (USE) metrics, and Node runtime metrics — exported via OTLP to the OpenTelemetry Collector (→ Prometheus/Mimir → Grafana).

Install

npm install @platform-x/hep-observability

Peer deps: @opentelemetry/api (required), express (optional, for the middleware).

Adopt in a service (~15 lines)

// src/server.ts — top, right AFTER the existing elastic-apm-node .start({...}) block
import { initTelemetry } from '@platform-x/hep-observability';
initTelemetry(); // reads OTEL_SERVICE_NAME / OTEL_EXPORTER_OTLP_ENDPOINT / NODE_ENV
// where the Express app is built — mount FIRST, before auth/cache middleware
import { httpMetricsMiddleware, makeAllowlist } from '@platform-x/hep-observability';
app.use(httpMetricsMiddleware({
  graphqlPath: '/v1/publish/gateway',        // omit for pure-REST services
  knownSites: makeAllowlist(KNOWN_TENANTS),  // bound sitename cardinality
}));
// where ApolloServer is constructed (GraphQL services)
import { apolloMetricsPlugin, makeAllowlist } from '@platform-x/hep-observability';
new ApolloServer({
  /* ... */
  plugins: [ /* ...existing */ apolloMetricsPlugin({ knownOperations: makeAllowlist(ROOT_FIELDS) }) ],
});
// wrap DAO/driver calls at the data-access layer
import { instrumentDependency, registerPoolGauge } from '@platform-x/hep-observability';
await instrumentDependency('mongo', 'roles.findOne', () => Roles.findOne(filter));
registerPoolGauge('mongo', () => ({ in_use: pool.used, idle: pool.available, waiting: pool.pending }));
// service-specific business metrics build on the shared meter
import { getMeter } from '@platform-x/hep-observability';
const authAttempts = getMeter().createCounter('gateway_auth_attempts');

Kubernetes env

env:
  - { name: OTEL_SERVICE_NAME, value: "cx-delivery-gateway" }   # the fleet `service` dimension
  - { name: OTEL_EXPORTER_OTLP_ENDPOINT, value: "http://otel-collector.monitoring:4317" }

Metrics emitted

| Metric | Type | Key labels | |---|---|---| | platx_http_requests_total | counter | service, transport, method, route, operation, status_code, sitename | | platx_http_request_duration_seconds | histogram | service, transport, route, operation, sitename | | platx_http_inflight_requests | up-down counter | service, sitename | | platx_http_errors_total | counter | service, route, operation, type, sitename | | platx_graphql_resolution_total | counter | service, operation, field, outcome | | platx_dependency_request_duration_seconds | histogram | service, dependency, operation, outcome | | platx_dependency_pool_connections | gauge | service, dependency, state | | nodejs_* / v8js_* (runtime) | — | service |

* service comes from the service.name resource attribute (OTEL_SERVICE_NAME), attached by the Collector — not a per-instrument label. Counter _total / histogram unit suffixes are added by the Prometheus-format exporter (so name instruments without them).

Scripts

npm run build   # rimraf dist && tsc → dist/
npm test        # jest
npm run lint    # eslint

Publishing

Set NPM_TOKEN in your environment / CI, then npm publish. .npmrc reads the token from that env var — never commit a token.