1

我正在尝试查找 API 以获取我在 GCP 上创建的特定警报策略的事件。当达到阈值时,我能够收到电子邮件,但我找不到使用[postman][1]获取该事件的方法。我找到了获取我在 GCP 上创建的策略的 API,但不是生成的事件。任何帮助表示赞赏。

已编辑:我为警报策略 API ( https://monitoring.googleapis.com/v3/projects/{projectId}/alertPolicies/{alertId} ) 获得的 Json 响应如下所示

{ “name”:“projects/{projectId}/alertPolicies/{alertId}”,“displayName”:“节点上的最大内存利用率”,“combiner”:“OR”,“creationRecord”:{“mutateTime”:“ 2021-03-02T18:05:21.054509916Z”、“mutatedBy”:“myemail”}、“mutationRecord”:{“mutateTime”:“2021-08-09T16:24:50.941114533Z”、“mutatedBy”:“myemail” }, "条件": [ { "conditionThreshold": { "filter": "resource.type = "gce_instance" AND metric.type = "compute.googleapis.com/guest/memory/bytes_used"", "comparison": " COMPARISON_GT", "thresholdValue": 5, "duration": "0s", "trigger": { "count": 1 },“聚合”:[{“alignmentPeriod”:“60s”,“perSeriesAligner”:“ALIGN_MEAN”,“crossSeriesReducer”:“REDUCE_MAX”,“groupByFields”:[“metric.label.instance_name”]}]},“displayName” : "Memorystore Memcached 节点 - 内存使用量 [MAX]", "name": "projects/{projectId}/alertPolicies/{alertId}/conditions/14902542656838734365" } ], "notificationChannels": [ "projects/{projectId}/notificationChannels /17463875491346552338" ], "启用": true, "alertStrategy": {} }label.instance_name" ] } ] }, "displayName": "Memorystore Memcached 节点 - 内存使用 [MAX]", "name": "projects/{projectId}/alertPolicies/{alertId}/conditions/14902542656838734365" } ], " notificationChannels": ["projects/{projectId}/notificationChannels/17463875491346552338"], "enabled": true, "alertStrategy": {} }label.instance_name" ] } ] }, "displayName": "Memorystore Memcached 节点 - 内存使用 [MAX]", "name": "projects/{projectId}/alertPolicies/{alertId}/conditions/14902542656838734365" } ], " notificationChannels": ["projects/{projectId}/notificationChannels/17463875491346552338"], "enabled": true, "alertStrategy": {} }

但这只是政策

4

1 回答 1

0

我了解到您正在尝试使用 Postman 记录警报策略的触发情况。您实际上可以通过使用GCP 提供的监控系统来实现这一点。

链接的文档为您提供了有关如何查看和管理基于指标的警报策略的事件的指导。它还为您提供了如何过滤事件和查找旧事件的方法。如果这对您有帮助,请在下方评论。

于 2021-08-23T15:03:02.037 回答