yr.Gauge#
- class yr.Gauge(name: str, description: str, unit: str = '', labels: Dict[str, str] = {})#
基类:
Metrics用来上报 Metrics 数据。
Note
类似 Prometheus 的数据结构。
计费信息会上报到后台的 openYuanrong 采集器。
不能在 driver 中使用。
如果启动 yr 时未配置 runtime_metrics_config,则样例无法使用。
- 参数:
name (str) - 名称。
description (str) - 描述。
unit (str,可选) - 单位。
labels (Dict[str, str],可选) - 标签。例如,
labels = {"request_id": "abc"}。
方法:
添加 label。
设置值。