我正在按照以下说明从Google监控API获取我的项目中的服务列表:https://cloud.google.com/monitoring/service-monitoring/using-api#using-curl
curl --http1.1 --header "Authorization: Bearer ${ACCESS_TOKEN}" https://monitoring.googleapis.com/v3/projects/${PROJECT_ID}/services
我获得了项目中appEngine
和clusterIstio
对象的结果,但没有获得我的Cloud Endpoints的结果。
此处的文档建议支持Cloud Endpoints:https://cloud.google.com/monitoring/service-monitoring/using-api#choosing-svcmon-api。
这里是否缺少任何有关启用端点进行监视的说明?
您可以使用API几乎使用项目中的所有指标来创建自定义SLO。
首先,使用此调用创建服务:
https://cloud.google.com/monitoring/service-monitoring/using-api#service-create
然后,针对该服务创建SLO:
https://cloud.google.com/monitoring/service-monitoring/using-api#slo-create
这里是一个演练(使用App Engine服务,而不是自定义服务):
https://medium.com/google-cloud/slos-with-stackdriver-service-monitoring-62f193147b3f