Skip to main content
Home

Built and signed on GitHub Actions

This package works with Node.js, Deno, Bun
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score
70%
Published
a year ago (1.0.7)

@pup/telemetry

This package empowers (Node, Deno or Bun) processes run by Pup with telemetry and inter process communication capabilities, providing:

  • Process Metric Reporting: Automatic reporting of crucial process metrics (e.g., memory usage, CPU utilization) back to the main Pup process for enhanced monitoring and insights.
  • Inter-Process Communication (IPC): A flexible IPC mechanism for communication between Pup-managed processes and the Pup main process.

Installation

deno add @pup/telemetry

or

npx jsr install @pup/telemetry

Usage

1. Basic Telemetry (Metric Reporting)

import { PupTelemetry } from "@pup/telemetry";

const telemetry = new PupTelemetry(); // Initializes telemetry

// ... Your application code ...

telemetry.close(); // Allow the process to exit
  1. Inter-Process Communication (IPC)

    import { PupTelemetry } from "@pup/telemetry";
    const telemetry = new PupTelemetry();
    
    // One part of your application:
    
    telemetry.on("my-event", (data) => {
      console.log(`Received 'my-event' with data: ${JSON.stringify(data)}`);
    });
    
    // In another part:
    
    telemetry.emit("another-process-id", "my-event", { data: { to: "send" } });
    
    // Always, to allow the processes to exit:
    telemetry.close();
    

Examples

For detailed usage examples, please refer to the Pup documentation https://pup.56k.guru.

Development and Contributions

The @pup/telemetry package is actively maintained by the Pup development team. If you have suggestions for improvements, bug fixes, or additional features, please open an issue on the GitHub repository.

This library follows semantic versioning. For a detailed history of changes, please refer to the CHANGELOG.md

License

This package is released under the MIT License.

Built and signed on
GitHub Actions

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@pup/telemetry

Import symbol

import * as telemetry from "@pup/telemetry";
or

Import directly with a jsr specifier

import * as telemetry from "jsr:@pup/telemetry";

Add Package

pnpm i jsr:@pup/telemetry
or (using pnpm 10.8 or older)
pnpm dlx jsr add @pup/telemetry

Import symbol

import * as telemetry from "@pup/telemetry";

Add Package

yarn add jsr:@pup/telemetry
or (using Yarn 4.8 or older)
yarn dlx jsr add @pup/telemetry

Import symbol

import * as telemetry from "@pup/telemetry";

Add Package

vlt install jsr:@pup/telemetry

Import symbol

import * as telemetry from "@pup/telemetry";

Add Package

npx jsr add @pup/telemetry

Import symbol

import * as telemetry from "@pup/telemetry";

Add Package

bunx jsr add @pup/telemetry

Import symbol

import * as telemetry from "@pup/telemetry";