-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix cluster metrics when AggregatorReg isn't created on workers #464
base: master
Are you sure you want to change the base?
Conversation
When using the cluster module, you must now call `promclient.setupClusterWorker()` from each cluster worker. v13.2.0 introduced a change from v13.1.0 that broke cluster metrics if an `AggregatorRegistry` was not instantiated on each cluster worker. The example in `examples/cluster.js` shows instantiation of an `AggregatorRegistry` in the workers, so users following that example were not affected by this change. However, the example was not written as intended: `new AggregatorRegistry()` should only be called on the cluster master. `examples/cluster.js` has been updated to show the full, correct usage.
Desperated need this fix! I'm getting some errors running metrics on nodejs cluster. The metrics are not being aggregated, it´s simply does not work on cluster. Is this a fix for it? Any plans on release this fix? |
- When using the cluster module, you must now call | ||
`promclient.setupClusterWorker()` from each cluster worker. | ||
|
||
Long explanation: v13.2.0 introduced a change from v13.1.0 that broke cluster |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds like we should revert that change, release a patch, then a new major with that and this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea, I can release a v13.2.1 with it reverted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like v13.2.1 was never released so would it be possible to get this MR merged? The cleaner API is nice.
I figured out master cluster process metrics are not being aggregated with worker process metrics on clusterMetrics() call. Should it be? Or I'm guessing wrong? I did a change pushing master cluster metrics and it works... please check below.
|
@lucianodltec check out #280. That PR just needs tests. If you're willing to work on them, that would be awesome! |
Wondering if there are plans to merge this PR? It looks super helpful! |
Hi @zbjornson! Thanks for making this fix. Do you know if there is any plan to merge it? |
Hi thank you !! |
@zbjornson could you target |
@SimenB will do shortly. I want to revisit this PR to see if I can make both patterns work so it's not a breaking change in either direction. |
This would be great to unblock some work, looking forward to this being merged! |
👋 👋 Hey team!! Any movement on this issue? We are in need of this fix, hoping it's landing soon 🤞 |
@zbjornson I landed |
Bumping this! Would love to have this merged. |
@zbjornson Any update on this one? We are stuck with |
@zbjornson I plan to release a stable v15 this week. Will you be able to work on the two issues in https://github.com/siimon/prom-client/issues?q=is:open+label:semver-major? If yes, I'll hold off - if not I'll just roll it out 🙂 Been more than half a year since exemplars landed without a release 😅 |
When using the cluster module, you must now call
promclient.setupClusterWorker()
from each cluster worker.v13.2.0 introduced a change from v13.1.0 (#449) that broke cluster metrics if an
AggregatorRegistry
was not instantiated on each cluster worker. The example inexamples/cluster.js
shows instantiation of anAggregatorRegistry
in the workers, so users following that example were not affected by this change. However, the example was not written as intended:new AggregatorRegistry()
should only be called on the cluster master.examples/cluster.js
has been updated to show the full, correct usage.This also unblocks a new approach to #182.