Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-62583

Add options to include Cluster UUID and Cluster Name in Prometheus Service Discovery

    XMLWordPrintable

Details

    • 0

    Description

      To allow users to have labels for the Cluster UUID and Cluster Name in their Prometheus metrics, we should add optional parameters to the Prometheus Service Discovery API (as documented here).

      As well as the existing options (disposition, network, port, type), we should add include_cluster_uuid, and include_cluster_name.

      Both are boolean, and both default to false.

      As the Cluster Name is mutable, and there is no way to guarantee uniqueness across multiple clusters, we should enforce that Cluster Name is only available alongside the Cluster UUID. I.e. include_cluster_name can only be true when include_cluster_uuid is also true.

      If the new options are set to true, then a new labels section should be added to the payload returned.

      The structure is documented at file_sd_config and http_sd_config, but for example:

      - targets:
          - 'node-001.example.com:18091'
          - 'node-002.example.com:18091'
          - 'node-003.example.com:18091'
        labels:
          cluster_uuid: 46ab47f8-c5d7-482a-d566-d4ac3b2dcc4a
          cluster_name: 'Example Cluster Name'
      

      Prometheus will then include those values in the time series that are recorded.

      The reason for not making these the default is that that would be a breaking change, causing any current Prometheus consumers to create brand new time series for all the Couchbase metrics.

      Similarly, trying to add this anywhere other than in the Service Discovery, involves changes in every component that generates metrics.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            steve.watanabe Steve Watanabe
            malarky Chris Malarky
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                PagerDuty