

要获得与亚马逊 Timestream 类似的功能 LiveAnalytics，可以考虑适用于 InfluxDB 的亚马逊 Timestream。适用于 InfluxDB 的 Amazon Timestream 提供简化的数据摄取和个位数毫秒级的查询响应时间，以实现实时分析。点击[此处](https://docs.aws.amazon.com//timestream/latest/developerguide/timestream-for-influxdb.html)了解更多信息。

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# Grafana
<a name="Grafana"></a>

 可使用 Grafana 可视化时间序列数据和创建警报。为帮助您开始使用数据可视化，我们已在 Grafana 中创建示例控制面板，用于可视化从 Python 应用程序发送到 Timestream 的数据，且已创建描述设置的[视频教程](https://youtu.be/pilkz645cs4)。

**Topics**
+ [示例应用程序](#Grafana.sample-app)
+ [教程视频](#Grafana.video-tutorial)

## 示例应用程序
<a name="Grafana.sample-app"></a>

1.  有关更多信息，请按照 [创建数据库](console_timestream.md#console_timestream.db.using-console) 中所述的说明在 Timestream 中创建数据库和表。
**注意**  
 Grafana 控制面板的默认数据库名称和表名称分别设置为 grafanaDB 和 grafanaTable。使用这些名称可最大限度减少设置。

1. 安装 [Python 3.7](https://www.python.org/downloads/) 或更高版本。

1.  [安装和配置 Timestream Python SDK](getting-started.python.md)。

1.  按照 [GitHub](https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/cloning-a-repository) 中的说明克隆[多线程 Python 应用程序](https://github.com/awslabs/amazon-timestream-tools/tree/mainline/tools/python/continuous-ingestor)的 GitHub 存储库，持续将数据摄取到 Timestream 中。

1. 按照[自述文件](https://github.com/awslabs/amazon-timestream-tools/blob/mainline/tools/python/continuous-ingestor/README.md)中的说明运行应用程序，持续将数据摄取到 Timestream 中。

1. 完成[了解如何创建和使用 Amazon Managed Grafana 资源](https://docs.aws.amazon.com/grafana/latest/userguide/getting-started-with-AMG.html)或完成[安装 Grafana](https://grafana.com/docs/grafana/latest/installation/)。

1. 如果安装 Grafana 而非使用 Amazon Managed Grafana，请完成[在 Grafana Cloud 上安装 Amazon Timestream](https://grafana.com/grafana/plugins/grafana-timestream-datasource/?tab=installation/)。

1. 使用所选择的浏览器打开 Grafana 控制面板。如果已在本地安装 Grafana，可以按照 Grafana 文档中描述的说明进行[登录](https://grafana.com/docs/grafana/latest/getting-started/getting-started/#log-in-for-the-first-time)。

1. 启动 Grafana 后，转到“数据源”，点击“添加数据源”，搜索 Timestream，然后选择 Timestream 数据源。

1. 配置身份验证提供商和区域，然后点击“保存并测试”。

1. 设置默认宏。

   1. 将 \$1\$1\$1database 设置为 Timestream 数据库的名称（例如 grafanaDB）。

   1. 将 \$1\$1\$1table 设置为 Timestream 表的名称（例如 grafanaTable）。

   1. 将 \$1\$1\$1measure 设置为表中最常用的度量。

1. 点击“保存并测试”。

1. 点击“控制面板”选项卡。

1. 点击“导入”以导入控制面板。

1. 双击“示例应用程序控制面板”。

1. 点击控制面板设置。

1. 选择变量

1. 更改 dbName 和 tableName，以匹配 Timestream 数据库和表的名称。

1. 点击保存。

1. 刷新控制面板。

1. 要创建警报，请按照 Grafana 文档中描述的说明，[配置 Grafana 托管的警报规则](https://grafana.com/docs/grafana/latest/alerting/alerting-rules/create-grafana-managed-rule/)。

1. 要对警报进行故障排除，请按照 Grafana 文档中描述的说明，进行[故障排除](https://grafana.com/docs/grafana/latest/troubleshooting/)

1. 有关更多信息，请参阅 [Grafana 文档](https://grafana.com/docs/)。

## 教程视频
<a name="Grafana.video-tutorial"></a>

本[视频](https://youtu.be/pilkz645cs4)介绍 Grafana 如何与 Timestream 结合使用。