15.3. 收集数据网格指标
使用 Prometheus 等监控工具来收集数据网格指标。
前提条件
-
启用统计信息。如果没有启用统计信息,Data Grid 为指标提供
0
和-1
值。 - (可选)启用直方图。默认情况下,Data Grid 生成量表,但不生成直方图。
流程
获取 Prometheus (OpenMetrics)格式的指标:
curl -v http://localhost:11222/metrics
$ curl -v http://localhost:11222/metrics
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 以 MicroProfile JSON 格式获取指标:
curl --header "Accept: application/json" http://localhost:11222/metrics
$ curl --header "Accept: application/json" http://localhost:11222/metrics
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
后续步骤
配置监控应用程序以收集数据网格指标。例如,将以下内容添加到 prometheus.yml
中:
static_configs: - targets: ['localhost:11222']
static_configs:
- targets: ['localhost:11222']
参考
- Prometheus 配置
- 启用 Data Grid Statistics