[Metric] custom metrics refinement (#10861)

* In progress

* In Progress.

* Addressed code review.

* Add unit tests.

* Add a simple doc.

* Fixed test failure.

* Fix all test failures from serve.

* Addressed code review.
This commit is contained in:
SangBin Cho
2020-09-25 09:10:28 -07:00
committed by GitHub
parent 609c1b8acd
commit 109481afd9
9 changed files with 421 additions and 124 deletions
+29
View File
@@ -167,6 +167,35 @@ get_current_placement_group
.. autofunction:: ray.util.placement_group.get_current_placement_group
.. _custom-metric-api-ref:
Custom Metrics APIs
-------------------
Metric
~~~~~~
.. autoclass:: ray.util.metrics.Metric
:members:
Count
~~~~~
.. autoclass:: ray.util.metrics.Count
:members:
Gauge
~~~~~
.. autoclass:: ray.util.metrics.Gauge
:members:
Histogram
~~~~~~~~~
.. autoclass:: ray.util.metrics.Histogram
:members:
Experimental APIs
-----------------
+11 -2
View File
@@ -1,9 +1,10 @@
Ray Monitoring with Prometheus
==============================
Ray Monitoring
==============
To help monitoring Ray applications, Ray
- Collects Ray's pre-selected system level metrics.
- Exposes metrics in a Prometheus format. We'll call the endpoint to access these metrics a Prometheus endpoint.
- Support custom metrics APIs that resemble Prometheus `metric types <https://prometheus.io/docs/concepts/metric_types/>`_.
This page describes how to acces these metrics using Prometheus.
@@ -151,3 +152,11 @@ Now, modify a Prometheus config to scrape the file for service discovery.
- '/tmp/ray/prom_metrics_service_discovery.json'
Prometheus will automatically detect that the file contents are changing and update addresses it scrapes to based on the service discovery file generated by Ray.
Custom Metrics
--------------
Ray supports custom metrics APIs to enable developers to have visibility to their applications.
It current supports 3 metric types. All metric types have the same definition as `Prometheus metric types <https://prometheus.io/docs/concepts/metric_types/>`_.
:ref:`Custom Metrics APIs Package Reference <custom-metric-api-ref>`