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

@logbrew/amqplib

v0.1.2

Published

RabbitMQ amqplib tracing helpers for the public LogBrew JavaScript SDK.

Readme

@logbrew/amqplib

Explicit RabbitMQ amqplib tracing helpers for the public LogBrew JavaScript SDK.

This package is source-only until its first npm release. The npm and pnpm commands below require the package to be available on npm; use a local checkout when evaluating it before release.

npm install @logbrew/sdk @logbrew/node @logbrew/amqplib amqplib
pnpm add @logbrew/sdk @logbrew/node @logbrew/amqplib amqplib

Use a project-scoped server ingest key from your LogBrew project settings:

import amqp from "amqplib";
import { LogBrewClient } from "@logbrew/sdk";
import {
  amqplibSendToQueueWithLogBrewSpan,
  withLogBrewAmqplibConsumer
} from "@logbrew/amqplib";

const client = LogBrewClient.create({
  apiKey: process.env.LOGBREW_SERVER_API_KEY ?? "LOGBREW_SERVER_API_KEY",
  release: "[email protected]",
  environment: "production",
  sdkName: "checkout-worker",
  sdkVersion: "1.0.0"
});

const connection = await amqp.connect(process.env.AMQP_URL ?? "amqp://localhost");
const channel = await connection.createChannel();

await amqplibSendToQueueWithLogBrewSpan(
  channel,
  "checkout.created",
  Buffer.from(JSON.stringify({ event: "checkout.created" })),
  { contentType: "application/json" },
  { client }
);

await channel.consume(
  "checkout.created",
  withLogBrewAmqplibConsumer(async (message) => {
    if (!message) {
      return;
    }
    // Process your app-owned message. LogBrew does not capture message bytes.
    await handleCheckoutMessage(message);
    channel.ack(message);
  }, { client, queueName: "checkout.created" })
);

For exchange publishing, wrap publish:

import { amqplibPublishWithLogBrewSpan } from "@logbrew/amqplib";

await amqplibPublishWithLogBrewSpan(
  channel,
  "checkout.exchange",
  "created",
  Buffer.from(JSON.stringify({ event: "checkout.created" })),
  { contentType: "application/json" },
  { client }
);

Behavior

  • Producer helpers clone the amqplib publish options and headers, write exactly one normalized W3C traceparent, and then call your channel.
  • Consumer helpers continue from a valid traceparent in message.properties.headers; malformed propagation is ignored without failing the message.
  • null consumer-cancel notifications are passed through without creating telemetry.
  • Spans use safe metadata such as messaging.system=rabbitmq, messaging.destination.name, messaging.operation.name, messaging.operation.type, amqpExchange, and amqpRoutingKey.
  • The package keeps connections, channels, acknowledgement, nack/reject, retry, confirms, and shutdown behavior app-owned.

Privacy Boundary

The helpers do not patch amqplib globally, do not capture message bodies, arbitrary headers, broker URLs, host names, ports, consumer tags, message IDs, correlation IDs, payload sizes, baggage, tracestate, stack traces, exception messages, or support tickets.

Use @logbrew/amqplib when you want explicit trace correlation for selected RabbitMQ calls. Use lower-level @logbrew/node queue helpers when your app needs a custom queue abstraction.