Socket
Socket
Sign inDemoInstall

@bull-monitor/fastify

Package Overview
Dependencies
154
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @bull-monitor/fastify

bull-monitor for fastify


Version published
Weekly downloads
135
increased by136.84%
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

5.4.0 (2023-08-27)

Features

  • stopMetricsCollector and startMetricsCollector public methods (8bd48e7)

Readme

Source

@bull-monitor/fastify

Fastify adapter for bull-monitor

Usage

npm i @bull-monitor/fastify
import Fastify from 'fastify';
import { BullMonitorFastify } from '@bull-monitor/fastify';
import { BullAdapter } from '@bull-monitor/root/dist/bull-adapter';
// for BullMQ users
// import { BullMQAdapter } from "@bull-monitor/root/dist/bullmq-adapter";
import Queue from 'bull';

(async () => {
  const app = Fastify();
  const monitor = new BullMonitorFastify({
    queues: [
      new BullAdapter(new Queue('1', 'REDIS_URI')),
      // readonly queue
      new BullAdapter(new Queue('2', 'REDIS_URI'), { readonly: true }),
    ],
    // enables graphql introspection query. false by default if NODE_ENV == production, true otherwise
    gqlIntrospection: true,
    baseUrl: '/my/url',
    // enable metrics collector. false by default
    // metrics are persisted into redis as a list
    // with keys in format "bull_monitor::metrics::{{queue}}"
    metrics: {
      // collect metrics every X
      // where X is any value supported by https://github.com/kibertoad/toad-scheduler
      collectInterval: { hours: 1 },
      maxMetrics: 100,
      // disable metrics for specific queues
      blacklist: ['1'],
    },
  });
  await monitor.init({ app });
  await app.register(monitor.plugin);
  await app.listen(3000);

  // replace queues
  monitor.setQueues([new BullAdapter(new Queue('3', 'REDIS_URI'))]);
})();

Keywords

FAQs

Last updated on 27 Aug 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc