XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Openmetrics plugin changing Prometheus secret after every xo-server restart

    Scheduled Pinned Locked Moved Unsolved Advanced features
    3 Posts 3 Posters 162 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T Offline
      tmk
      last edited by

      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?

      mpitonM 1 Reply Last reply Reply Quote 0
      • olivierlambertO Offline
        olivierlambert Vates 🪐 Co-Founder CEO
        last edited by

        Question for @Team-XO-Backend

        1 Reply Last reply Reply Quote 0
        • poddingueP poddingue marked this topic as a question
        • mpitonM Offline
          mpiton Vates 🪐 XO Team @tmk
          last edited by mpiton

          @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.

          1 Reply Last reply Reply Quote 0

          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
          • First post
            Last post