You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/developer-guide/add_metrics.md
+6-13Lines changed: 6 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,8 @@ UCM supports custom metrics with bidirectional updates from both Python and C++
3
3
4
4
## Architecture Overview
5
5
The metrics consists of these components below:
6
-
-**metrics** : Central stats registry that manages all metric lifecycle operations (registration, creation, updates, queries)
7
-
-**observability.py** : Prometheus integration layer that handles metric exposition and multiprocess collection
6
+
-**monitor** : Central stats registry that manages all metric lifecycle operations (registration, creation, updates, queries)
7
+
-**observability.py** : Prometheus integration layer that handles metric exposition
8
8
-**metrics_config.yaml** : Declarative configuration that defines which custom metrics to register and their properties
9
9
10
10
## Getting Started
@@ -31,7 +31,7 @@ prometheus:
31
31
32
32
# Gauge metrics configuration
33
33
gauges:
34
-
- name: "lookup_hit_rate"
34
+
- name: "external_lookup_hit_rate"
35
35
documentation: "Hit rate of ucm lookup requests"
36
36
multiprocess_mode: "livemostrecent"
37
37
@@ -43,15 +43,14 @@ prometheus:
43
43
```
44
44
45
45
### Use Monitor APIs to Update Stats
46
-
The monitor provides a unified interface for metric operations. Note that the workflow requires registering a stats class before creating an instance.
46
+
The monitor provides a unified interface for metric operations. Users only need to create stats and update them, while the observability component is responsible for fetching the stats and pushing them to Prometheus.
47
47
:::::{tab-set}
48
48
:sync-group: install
49
49
50
50
::::{tab-item} Python side interfaces
51
51
:selected:
52
52
:sync: py
53
53
**Lifecycle Methods**
54
-
- `register_istats(name, py::object)`: Register a new stats class implementation.
55
54
- `create_stats(name)`: Create and initialize a registered stats object.
56
55
57
56
**Operation Methods**
@@ -64,11 +63,8 @@ The monitor provides a unified interface for metric operations. Note that the wo
64
63
65
64
**Example:** Using built-in ConnStats
66
65
```python
67
-
from ucm.integration.vllm.conn_stats import ConnStats
0 commit comments