-
Notifications
You must be signed in to change notification settings - Fork 432
Enable "rabbitmq_prometheus" in RabbitMQ 3.8 by default #422
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
Conversation
Arg, we're butting up against: Lines 225 to 228 in e5da520
I really don't like this script... 🤦 |
I couldn't agree more. I would definitely advocate for its removal and reduce the sprawl of environment variables by requiring users to configure most aspects of RabbitMQ using the sysctl config format. This has built-in validation and many improvements over env vars or the classic config: https://www.rabbitmq.com/configure.html#config-file A relevant improvement that shipped in 3.8.4 is improved support for multiple sysctl config files: rabbitmq/rabbitmq-server#2258 & rabbitmq/rabbitmq-server#2277 . This allows users to specify multiple config files in sysctl format and not mutate a single file. There has never been a better time to put an end to the As extra context, this is exactly what we are doing in the commercial version of RabbitMQ, which ships as an OCI. |
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.
All changes look good to me. The docker-entrypoint.sh is even more complex than it was before, and my previous comment stills stands, but I don't think that we should leave that distract from this.
Let me know if you would like me to QA when the checks are green and it's ready to merge.
This is a fantastic change, I am very excited to see it take shape so quickly. It's great to see you move so fast on this @tianon 👍🏻
The only reason I'm touching
... and that's also why it only supports the SSL-related flags that are supported for the server and for the management plugin. If you think we don't need that (and that if users configure the server to use SSL, we can leave it up to them to configure SSL for prometheus), we can drop all but the change to |
We could also skip the |
Also, I guess moving |
Context: we want to move away from environment variables and use either config files or env files (such as the rabbitmq-env.conf). Since .erlang.cookie is neither, the official RabbitMQ Docker image handles this by writing the value from the RABBITMQ_ERLANG_COOKIE env var into the file if it does not exist. The problem is that if this file exists, and the value is different from the RABBITMQ_ERLANG_COOKIE env var, CLI tools will not be able to communicate with the rabbit node, as described here: rabbitmq/rabbitmq-cli#443 The only gotcha is that this file must be owned by the user, and privileges should not be too open (git should have captured this). If not, RabbitMQ will fail to boot. This is somewhat similar to how OpenSSH reacts when private key permissions are too open. re docker-library/rabbitmq#422 (comment) Signed-off-by: Gerhard Lazu <[email protected]>
How can I configure Thank you for initiating this PR 👍 |
@nesc58 I honestly find joy in the fact that you're asking, because that very variety of question is why I hesitated even adding the configuration bits I did here 😄 -- the end goal is to not provide any custom configuration behavior anymore, so the direct answer to your question is that it should be put in |
For Docker Compose, I would recommend mounting the config file at
For Docker Swarm, I would recommend using a service config to generate that config file. For K8S, I would recommend a ConfigMap to generate that config file. |
Thank you. That was what I am looking for :-) |
I think just your eyeballs to ensure my final (simplified) version is acceptable as a default. 😅 |
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.
Almost there, will keep an eye on this PR until it makes it through 👀
|
Changes: - docker-library/rabbitmq@86a695b: Merge pull request docker-library/rabbitmq#422 from infosiftr/prometheus - docker-library/rabbitmq@8886389: Enable "rabbitmq_prometheus" in RabbitMQ 3.8 by default
@tianon I'm using the script below as entrypoint in my docker-compose file via: #!/bin/bash
set -e
# Start RMQ from entry point.
# This will ensure that environment variables passed
# will be honored
/usr/local/bin/docker-entrypoint.sh rabbitmq-server -detached
# Do the cluster dance
rabbitmqctl stop_app
rabbitmqctl join_cluster rabbit@rabbitmq1
# Stop the entire RMQ server. This is done so that we
# can attach to it again, but without the -detached flag
# making it run in the forground
rabbitmqctl stop
# Wait a while for the app to really stop
sleep 2s
# Start it
rabbitmq-server |
Closes #419