Openmetrics plugin changing Prometheus secret after every xo-server restart
-
I've just started testing out the Open Metrics plugin in XO to send metrics to an external Prometheus collector and I've run into what appears to be a bug where any time the xo-server daemon is restarted, the XO changes the Prometheus secret associated with the plugin.
I can only assume that this is not the intended behavior since this obviously breaks any collection efforts until the secret is updated on the Prometheus side. Does anyone know if this is an already known issue and/or if a fix is in the works?
-
Question for @Team-XO-Backend
-
P poddingue marked this topic as a question
-
@tmk Confirmed bug on our side; thanks for the report.
The plugin declared its secret with a random default in the config schema. That expression runs when the module is imported, so every xo-server process computes a different one, and xo-server never writes back the values ajv fills in from schema defaults. So if you copied the secret out of the plugin form without saving the configuration, scraping worked until the next restart, and Prometheus started getting 401s.
Fix is here: https://github.com/vatesfr/xen-orchestra/pull/10290. The random default is gone. The secret is generated once on the first load and saved through the plugin configuration, so it survives a restart. If you already have one saved, it's left alone.
Once it's merged it'll be on master for people building from sources, and it'll reach XOA in the next release.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login