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

@platformatic/watt-plugin-kafka-health

v0.1.0

Published

Watt health plugin for @platformatic/kafka

Downloads

5

Readme

@platformatic/watt-plugin-kafka-health

A plugin for monitoring @platformatic/kafka consumers lag in Watt applications.

Overview

This plugin monitors consumers lag and sends health signals when consumers are lagging behind the acceptable threshold.

It integrates with Watt's health monitoring system to provide real-time alerts when Kafka consumers cannot keep up with message production.

Features

  • Consumer Lag Monitoring: Tracks lag for all Kafka consumers in your application
  • Configurable Thresholds: Set global and per-topic maximum allowed lag values
  • Smart Health Signals: Only sends alerts when lag is excessive AND there are available consumers to scale
  • Grace Period: Configurable delay before monitoring begins to avoid false positives during startup
  • Auto-discovery: Automatically monitors all Kafka consumers created in the application

Installation

npm install @platformatic/watt-plugin-kafka-health

Usage

Basic Usage

import { create } from '@platformatic/watt-plugin-kafka-health'

// Create the health plugin with basic configuration
const healthPlugin = create({
  maxAllowedLag: 1000, // Global max lag threshold
  interval: 60000, // Check interval in milliseconds
  gracePeriod: 5000, // Wait before starting monitoring
  topics: {
    'high-priority': 500, // Custom lag threshold for specific topics
    'low-priority': 2000
  }
})

Configuration Options

| Option | Type | Default | Description | | --------------- | ---------------------- | ------- | -------------------------------------------------- | | maxAllowedLag | number | 1000 | Global maximum allowed consumer lag | | interval | number | 60000 | Interval for lag monitoring checks in milliseconds | | gracePeriod | number | 1000 | Delay before monitoring starts in milliseconds | | topics | Record<string, number> | {} | Per-topic lag thresholds |

Health Signals

When lag exceeds thresholds, the plugin emits health signals with the following structure:

{
  type: 'kafka:topics:lag',
  value: 1500,  // Current lag value
  description: 'Member consumer-123 of consumers group my-group is lagging for topic my-topic and there are available consumers in the group.'
}

Requirements

  • Node.js >= 22.19.0
  • @platformatic/kafka ^1.20.0 as peer dependency

License

Apache-2.0 - See LICENSE for more information.

Contributing

Contributions are welcome! Please check the issues page for known issues and feature requests.

Support