Code Monkey home page Code Monkey logo

pm2-messages's People

Contributors

chrislahaye avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

yulheon

pm2-messages's Issues

Cannot read property 'writable' of undefined

Not a pm2-messages issue, but significant enough to mention here. pm2-messages is vulnerable to pm2 bug 4627.

We've had to disable pm2-messages because pm2 keeps crashing/restarting when being scraped by multiple prometheus servers.

@ChrisLahaye I'd would love to know your thoughts on this issue or if you have ideas for a solution.

memory leak

@ChrisLahaye hello again. For a little context, your pm2-messages is being used in CoStar Group's flagship product CoStar Suite.

We ended up having to disable prometheus scraping in production because of a memory leak.
image

This leak was traced back to pm2-messages. The leak is of an object containing pendingBusTargets, resolverBusTargets, and messages as you can see in this screenshot. A thorough memory analysis was performed to discover and confirm these findings.
image

A thorough analysis of the code confirmed that the leak is of the myBus Listener (myBus.on).

The following PR suggests a remedy by allowing the bus listeners to be destroyed after use.
#8

Update dependencies

The project hasn't been updated in a while, is it possible to update dependencies to cover the vulnerabilities of the older dependency versions?

Additional documentation/examples

This appears to me like the best solution I've encountered so far for gathering prom-metrics from a clustered app in pm2. Unfortunately I can't get it to work. Could additional documentation/examples please be provided?

I run the following code against 4 clustered instances of an app hosted in pm2 4.4.0

import pm2mes from "pm2-messages";
import * as prom from "prom-client";

prom.collectDefaultMetrics();
pm2mes.onMessage("get_prom_register", () => prom.register.getMetricsAsJSON());

const foo = async (callback) => {
  const metricsArr = await pm2mes.getMessages("get_prom_register");
  console.log(metricsArr);
  callback(prom.AggregatorRegistry.aggregate(metricsArr).metrics());
};

foo((o) => console.log(o));

the result is ....

> [email protected] start /work/csgp/pm2-prom-client
> node ./dist/index.js

[]

Any hints as to why metricsArr is empty?

Regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.