可视化 AWS 状态源中的数据
在本示例中,您将使用 AWS 状态源作为 Grafana 注释。当您遇到 AWS 中断时,这会非常有用。为此,您将使用 AWS RSS 源。您可以在 AWS 状态页面找到更多源。
连接设置
AWS 状态源是公开的,无需认证,因此您只需使用 Infinity 创建一个数据源即可,无需进行任何额外配置。
注释设置
在仪表盘中创建注释后,请按照以下步骤操作
- 创建一个注释并选择您的 Infinity 数据源。
- 选择查询类型为 XML,来源为 URL,格式为 Data Frame。
- 将
https://status.aws.amazon.com/rss/all.rss
提供为 URL。 - 您需要将
rss.channel[0].item
指定为 URL。您可以从原始 RSS 源中找到此路径。 - 创建
title
、description
列,并提供字符串类型。 - 创建
pubDate
列,并将其标记为 'DateTime'。 - 选择
guid[0]._
为字符串。这是您的链接,因此您可以将其别名为“link”。
以下 XML 是一个参考 feed 项目
<item>
<title><![CDATA[Service is operating normally: [RESOLVED] SMS Delivery Delays]]></title>
<link>http://status.aws.amazon.com/</link>
<pubDate>Fri, 14 Jan 2022 14:44:00 PST</pubDate>
<guid isPermaLink="false">http://status.aws.amazon.com/#sns-us-east-1_1642200240</guid>
<description><![CDATA[Between 5:14 AM and 11:38 AM PST, we experienced increased delivery latency while delivering SMS messages using US toll-free numbers. Also starting at 5:14 AM, SMS message delivery receipts were delayed, which created a backlog of undelivered delivery receipts. We are continuing to work with our downstream partners to clear this backlog. Receipts for new SMS deliveries will also be delayed until this backlog clears. The issues have been resolved and the service is operating normally.]]></description>
</item>
状态项目的表格视图
您可以在表格面板中遵循相同的查询步骤来获取表格结果
替代查询方法
如果您熟悉 UQL 查询,您可以通过一个简单的查询实现此功能。在这种方法中,您将选择“UQL”作为查询类型,而不是选择“XML”,并编写以下 UQL 查询。
parse-xml
| scope "rss.channel.item"
| extend "published date"=todatetime("pubDate")
| project "title", "published date", "description", "link"
更多状态源
通过此方法,您不仅可以监控 AWS 状态源,还可以监控任何 RSS 源。