首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >OpsGenie和ApplicationInsights:如何包含查询结果数据并链接到查询结果?

OpsGenie和ApplicationInsights:如何包含查询结果数据并链接到查询结果?
EN

Stack Overflow用户
提问于 2022-05-10 11:03:04
回答 1查看 221关注 0票数 1

我在中有警报,如果异常计数>0,则会触发这些警报,然后通过web钩子将消息发送到OpsGenie。集成非常有效,但我需要包含更多有关AppInsights异常(消息和类型)的信息,这些异常与警报的查询结果相关。我还想包括URL来查询结果。

我试图在查询中使用下面的Log search,但是我无法在OpsGenie中“捕获”有关查询结果的信息。

代码语言:javascript
复制
exceptions
| where details[0].severityLevel == "Error"
| order by timestamp

我还试图使用Exception指标作为信号,但也无法获得这些信息。

我拥有的有效载荷(GUID被混淆为[GUID]):

代码语言:javascript
复制
{
  "alertLogOwner": "Azure",
  "actionOwner": "Azure",
  "alertId": "[GUID]",
  "_incomingData": {
    "_parsedData": {
      "-teams": [
        "[GUID]"
      ],
      "-actions": [],
      "-tags": [],
      "description": "[OpsGenie] Exceptions on Prod count larger than 0",
      "alias": "[/subscriptions/[GUID]/providers/Microsoft.AlertsManagement/alerts/[GUID]]",
      "_details": {},
      "source": "Azure",
      "message": "[Azure]  GreaterThan 0 LogQueryCriteria in the last PT5M mins was activated\nDescription: [OpsGenie] Exceptions on Prod count large",
      "priority": "P3",
      "entity": ""
    },
    "integrationType": "Azure",
    "integrationName": "Azure Digital (Prod alerts)",
    "integrationId": "[GUID]"
  },
  "_actionSource": {
    "sourceSubName": "Create Alert",
    "sourceType": "Azure",
    "domain": "integration",
    "incomingDataId": "[GUID]",
    "sourceName": "Azure Digital (Prod alerts)"
  },
  "alertLogType": "system"
}

我看不到从上面获取查询结果/ URL到警报的任何方法。因此,问题是:如何获得查询结果和OpsGenie中Azure应用程序Insight警报的URL。

EN

回答 1

Stack Overflow用户

发布于 2022-05-12 04:43:30

如何获得查询结果和OpsGenie中的Azure应用程序Insight警报的URL?

正如尼克H建议的那样,添加gist作为社区wiki的答案,以帮助可能面临类似问题的社区成员。

  • 如果异常(消息和类型)和来自AppInsights的URL包含在payload中,则可以使用字符串处理regex将它们提取到警报中。

注意:需要将信息包括在payload中。如果没有从AppInsights发送到Opsgenie,那就不可能了。

如果在payload中解析了这些数据,但是在将数据提取到警报中或在日志中找到数据时遇到了困难,则可以向Opsgenie支持求助。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72185185

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档