[ 
https://issues.apache.org/jira/browse/KUDU-3538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18078632#comment-18078632
 ] 

ASF subversion and git services commented on KUDU-3538:
-------------------------------------------------------

Commit 5e476d45c5549828d7d8c3341a0e9459a8a47b97 in kudu's branch 
refs/heads/master from Marton Greber
[ https://gitbox.apache.org/repos/asf?p=kudu.git;h=5e476d45c ]

KUDU-3538: Add Prometheus HTTP service discovery

Prometheus HTTP service discovery enables automatic discovery of all
Kudu Master and TServer instances. This makes setting up monitoring for
Kudu through Prometheus much easier.

This patch adds a new /prometheus-sd endpoint on Kudu Master servers,
according to the Prometheus HTTP SD format [1], [2]. Leader master
responds with HTTP-SD JSON describing all Masters and TServers.
Follower masters return an empty JSON array.

For example, with 3 Masters and 3 TServers running locally, the leader's
/prometheus-sd endpoint returns:

[
  {
    "targets": [
      "127.0.0.1:8765"
    ],
    "labels": {
      "group": "masters",
      "cluster_id": "8d4a5e7e8ac14324aad96630f54f661f",
      "location": "n/a",
      "__scheme__": "http"
    }
  },
  {
    "targets": [
      "127.0.0.1:8767"
    ],
    "labels": {
      "group": "masters",
      "cluster_id": "8d4a5e7e8ac14324aad96630f54f661f",
      "location": "n/a",
      "__scheme__": "http"
    }
  },
  {
    "targets": [
      "127.0.0.1:8769"
    ],
    "labels": {
      "group": "masters",
      "cluster_id": "8d4a5e7e8ac14324aad96630f54f661f",
      "location": "n/a",
      "__scheme__": "http"
    }
  },
  {
    "targets": [
      "127.0.0.1:9875"
    ],
    "labels": {
      "group": "tservers",
      "cluster_id": "8d4a5e7e8ac14324aad96630f54f661f",
      "location": "n/a",
      "__scheme__": "http"
    }
  },
  {
    "targets": [
      "127.0.0.1:9873"
    ],
    "labels": {
      "group": "tservers",
      "cluster_id": "8d4a5e7e8ac14324aad96630f54f661f",
      "location": "n/a",
      "__scheme__": "http"
    }
  },
  {
    "targets": [
      "127.0.0.1:9871"
    ],
    "labels": {
      "group": "tservers",
      "cluster_id": "8d4a5e7e8ac14324aad96630f54f661f",
      "location": "n/a",
      "__scheme__": "http"
    }
  }
]

I've added basic unit tests to verify the structure of the JSON.
Moreover, integration tests dedicated to the SD feature have been added.

[1] 
https://prometheus.io/docs/prometheus/latest/http_sd/#writing-http-service-discovery
[2] 
https://training.promlabs.com/training/relabeling/introduction-to-relabeling/hidden-labels-and-metadata/

Change-Id: I931aa72a7567c0dde43d7b7ed53a2dd0fa8bc1fe
Reviewed-on: http://gerrit.cloudera.org:8080/21723
Reviewed-by: Alexey Serbin <[email protected]>
Tested-by: Marton Greber <[email protected]>
Reviewed-by: Gabriella Lotz <[email protected]>


> Implement HTTP Service Discovery endpoint for Prometheus
> --------------------------------------------------------
>
>                 Key: KUDU-3538
>                 URL: https://issues.apache.org/jira/browse/KUDU-3538
>             Project: Kudu
>          Issue Type: Sub-task
>          Components: master
>            Reporter: Alexey Serbin
>            Assignee: Marton Greber
>            Priority: Major
>              Labels: Integration, metrics, observability, supportability
>
> For better integration with Prometheus, it would be great to make Kudu 
> providing the [Prometheus HTTP-based Service Discovery 
> mechanism|https://prometheus.io/docs/prometheus/latest/configuration/configuration/#http_sd_config].
> The SD endpoint should be served by the embedded webserver of a Kudu master.  
> The endpoint should provide the list of URLs with Prometheus-enabled metric 
> endpoints for all masters and tablet servers in a Kudu cluster.  The content 
> must conform with the requirements outlined the corresponding documentation 
> at 
> [https://prometheus.io/docs/prometheus/latest/http_sd|https://prometheus.io/docs/prometheus/latest/http_sd/]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to