Prometheus 与 OSM 集成
Prometheus 与 OSM 集成
To familiarize yourself on how OSM works with Prometheus, try installing a new mesh with sample applications to see which metrics are collected. 为了熟悉 OSM 如何与 Promethues 工作,试着安装网格和示例应用来看收集了哪些指标。
-
安装 OSM 并使用你自己的 Prometheus 实例:
-
为示例工作负载创建命名空间:
-
让 OSM 监控新创建的命名空间:
-
配置 Prometheus 从新的命名空间获取指标:
-
安装示例应用:
确保所有的 pod 和容器已经启动并运行:
-
生成流量:
下面的命令让 curl Pod 来不停地以每秒 1 个请求的速度访问 httpbin Pod。
-
在 Prometheus 中查看指标:
转发 Prometheus 端口:
在浏览器中访问 http://localhost:7070 查看 Prometheus 用户界面。下面的查询会显示 curl pod 每秒发送多少请求到 httpbin pod,应该是 1:
irate(envoy_cluster_upstream_rq_xx{source_service="curl", envoy_cluster_name="metrics-demo/httpbin"}[30s])
在 Prometheus 用户界面中可随意访问其他的指标。
-
清理
一旦演示资源使用完,通过删除应用命名空间来清理:
然后,卸载 OSM:
$ osm uninstall mesh Uninstall OSM [mesh name: osm] ? [y/n]: y OSM [mesh name: osm] uninstalled
在卸载 OSM 后删除集群范围的资源,执行下面的命令。参阅 卸载指南 获取更多信息。
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.