Closed L3tum closed 2 years ago
Hey @L3tum ππ»
I don't think this is RR related issue because it relates to the roadrunner-worker
.
Since RR start several workers, they are trying to declare the same metrics. To sound metrics only once, you may try to use a server.on_init
feature (to declare metrics in the prometheus). And then you may use it in your app.
EDIT: https://github.com/roadrunner-server/roadrunner/blob/master/.rr.yaml#L28
Hey @rustatian!
Thanks for the info. So this is essentially expected behaviour since we, for example, start 8 workers they'll try to declare the same metrics and fail?
It seems to be a bit weird to me that we haven't triggered this behaviour before when we've been using 2-4 workers, and only now with 8 workers it happens somewhat reliably.
It also seems like the Baldinof Bundle uses it without any synchronization and its docs encourage the use of it that way, so if the case is really that we'd need to use a server.on_init
script then I'd classify that as a bug in the bundle as well.
Thanks for the info. So this is essentially expected behaviour since we, for example, start 8 workers they'll try to declare the same metrics and fail?
I'll check; I might skip these errors on the RR's side (if possible).
It also seems like the Baldinof Bundle uses it without any synchronization and its docs encourage the use of it that way, so if the case is really that we'd need to use a server.on_init script then I'd classify that as a bug in the bundle as well.
Yeah, please, try the on_init
. We will update the docs to include that note if it would be fine.
I'll check; I might skip these errors on the RR's side (if possible).
Thanks!
It seems to be possible to declare the metrics without the on_init
via the rr-config, right?
I'll check; I might skip these errors on the RR's side (if possible).
Thanks!
It seems to be possible to declare the metrics without the
on_init
via the rr-config, right?
Yeah, sure. I guessed that you needed to declare them from the PHP, but if not, feel free to use the config π
Cool, thank you for your help! π
My pleasure. Feel free to close the bug if that wouldn't be an issue with declaring via configuration.
Seems to be working well and the duplicate metric
errors are also gone. Thanks again, I'll close the issue
No duplicates π₯².
What happened?
Expected: RR starts π
Actual: On start we get a multitude of errors logged such as "metric with provided name already exist". As far as I know this seems to be "intended" or at least okay behaviour. However, sometimes, often multiple times, we get the error
"Error 'metrics_plugin_declare: duplicate metrics collector registration attempted' on tcp://127.0.0.1:6001"
and RR crashes hard.This seems to have been tried to suppres in roadrunner-metrics but doesn't seem to work?
I do not think this was an issue in earlier versions, but we made quiet the jump recently in versions so I can't quite tell which one wasn't affected (or if we just didn't trigger this problem).
In case it makes a difference, we're using the Baldinof Bundle for the Symfony Integration.
Version (rr --version)
2.10.7
Relevant log output