Alexey Serbin has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/19133 )
Change subject: KUDU-3375 Expose Prometheus Metrics in Kudu ...................................................................... KUDU-3375 Expose Prometheus Metrics in Kudu This patch introduces an endpoint which emits server level metrics in Prometheus Text Explosion format for Kudu. The endpoint can be found at /metrics_prometheus path of the webserver. More information on the Prometheus format can be found at: https://prometheus.io/docs/instrumenting/exposition_formats Prefix kudu_ has been added to all of the metric names according to Prometheus naming convention to specify the domain and differentiate from any other metrics belonging to different services. Following the kudu_ prefix either master_ or tserver_ prefix is attached based on the server type that is exposing the metrics. In order to differentiate between different master and tablet servers running on the same host Prometheus automatically attaches an instance label which holds the "hostname:portname". eg: kudu_master_metric{instance="localhost:8765", job="kudu-master", unit_type="unit"} Not all of the Kudu metric names follow the Prometheus metric naming recommendations which state metric units should be attached at the end of the metric name. In Kudu some metrics have these units at the end of the metric name, some in the middle of the metric and for some metrics it is unclear what the metric unit is just by looking at the metric name. Due to this and also because Kudu supports more Metric Units than base Prometheus Metric units, metric units are represented as Prometheus labels for each metric. This also makes it possible to keep time based units more accurate as Milliseconds, Nanoseconds and etc. do not need to be converted to seconds which is the base time unit in Prometheus. More information on Prometheus Metric units and naming conventions can be found at: https://prometheus.io/docs/practices/naming/#metric-names Tested by feeding all of the generated metrics to a prometheus server running on localhost. Added unit tests to each metric type. Change-Id: I4b2d01bd56f6f0f1b6f31cbce15e671d16521739 Reviewed-on: http://gerrit.cloudera.org:8080/19133 Tested-by: Kudu Jenkins Reviewed-by: Alexey Serbin <[email protected]> --- M src/kudu/server/default_path_handlers.cc M src/kudu/server/default_path_handlers.h M src/kudu/server/server_base.cc M src/kudu/util/CMakeLists.txt M src/kudu/util/metrics-test.cc M src/kudu/util/metrics.cc M src/kudu/util/metrics.h A src/kudu/util/prometheus_writer.cc A src/kudu/util/prometheus_writer.h 9 files changed, 445 insertions(+), 14 deletions(-) Approvals: Kudu Jenkins: Verified Alexey Serbin: Looks good to me, approved -- To view, visit http://gerrit.cloudera.org:8080/19133 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I4b2d01bd56f6f0f1b6f31cbce15e671d16521739 Gerrit-Change-Number: 19133 Gerrit-PatchSet: 17 Gerrit-Owner: Khazar Mammadli <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Attila Bukor <[email protected]> Gerrit-Reviewer: Khazar Mammadli <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Tidy Bot (241) Gerrit-Reviewer: Yingchun Lai <[email protected]> Gerrit-Reviewer: Zoltan Chovan <[email protected]>
