普罗米修斯指标
要将Prometheus度量数据导入Grafana Cloud,请配置Prometheus使用remote_write
.remote_write
允许您将抓取的样本转发到兼容的远程存储端点。要了解更多,请参见remote_write来自普罗米修斯文档。
从普罗米修斯发回数据
要将Prometheus数据发送到Grafana Cloud Metrics,您需要在您的环境中运行一个Prometheus实例,如下图所示:
添加以下内容remote_write
片段到您的Prometheus配置文件(通常prometheus.yml
).你可以在/ api /舞会/推动
URL,用户名和密码为您的指标端点单击细节在普罗米修斯的卡片上云门户:
remote_write:—url: <您的Metrics实例remote_write endpoint> basic_auth: username: <您的Metrics实例ID> password: <您的Grafana.com API Key>
从多个普罗米修斯实例发送数据
从多个Prometheus实例发送度量时,可以使用external_labels
参数将时间序列数据标记为实例标识符。附加任何external_labels
到全球
Prometheus配置文件的一部分。你可以在/ api /舞会/推动
URL,用户名和密码为您的指标端点单击细节在普罗米修斯的卡片上云门户:
第一个普罗米修斯的例子:
global: external_labels: origin_prometheus: prometheus01 remote_write:—url: <您的Metrics实例remote_write endpoint> basic_auth: username: <您的Metrics实例ID> password: <您的Grafana.com API Key>
第二个普罗米修斯的例子:
global: external_labels: origin_prometheus: prometheus02 remote_write:—url: <您的Metrics实例remote_write endpoint> basic_auth: username: <您的Metrics实例ID> password: <您的Grafana.com API Key>
从多个高可用性Prometheus实例发送数据
如果在高可用性(HA)配置中从多个Prometheus实例将数据传送到Grafana Cloud Metrics,则应该使用集群
而且__replica__
标签来消除在Grafana Cloud Metrics端点接收到的重复数据。将这些添加到external_labels
章节的普罗米修斯配置文件。你可以在/ api /舞会/推动
URL,用户名和密码为您的指标端点单击细节在普罗米修斯的卡片上云门户:
第一个HA Prometheus实例:
global: external_labels: cluster: promal_team1 __replica__: replica1 remote_write: - url: <您的Metrics实例remote_write endpoint> basic_auth: username: <您的Metrics实例ID> password: <您的Grafana.com API Key>
第二个HA Prometheus实例:
global: external_labels: cluster: promal_team1 __replica__: replica2 remote_write: - url: <您的Metrics实例remote_write endpoint> basic_auth: username: <您的Metrics实例ID> password: <您的Grafana.com API Key>
的集群
标签将标识HA Prometheus集群将数据发送到Grafana Cloud Metrics。的__replica__
label应该在HA Prometheus集群中设置为唯一的值。当Grafana Cloud Metrics重复数据删除和接收数据时,它将被删除。
要了解有关Prometheus配置参数的更多信息,请参阅普罗米修斯。io配置文档.
的使用Prometheus和node_export监视Linux主机提供了一个完整的安装本地Prometheus实例并使用的从头到尾示例remote_write
将度量从实例发送到Grafana Cloud。
相关的Grafana云资源
《普罗米修斯》和《格拉夫纳云》简介
普罗米修斯要接管监控世界了!在本次网络研讨会中,我们将首先快速介绍开源项目,它是监控现代云原生系统的事实上标准。
如何用Grafana Cloud建立和可视化大规模的合成监控
学习如何使用Kubernetes, Grafana Loki和Grafana Cloud的合成监控功能来设置您的基础设施的检查。
使用Grafana Cloud来提高制造工厂的效率
本节GrafanaCONline将讲述Grafana如何帮助一家拥有75年历史的制造公司提高产品质量和设备维护。