;数据配置;指标;普罗米修斯指标

普罗米修斯指标

要将Prometheus指标导入Grafana Cloud,请配置Prometheus使用remote_writeremote_write允许将刮取的样本转发到兼容的远程存储端点。要了解更多,请参见remote_write来自普罗米修斯的文件。

从普罗米修斯发送数据

要将Prometheus数据发送到Grafana Cloud Metrics,您需要在您的环境中运行Prometheus实例,如下图所示:

当地的普罗米修斯建筑

添加以下内容remote_write代码片段添加到Prometheus配置文件中(通常prometheus.yml).你可以找到/ api /舞会/推动URL、用户名和密码,为您的指标端点单击细节在普罗米修斯卡片上云门户

remote_write: - url:  basic_auth: username:  password:  . basic_auth: username:  password: 

从多个Prometheus实例发送数据

从多个Prometheus实例发送度量时,可以使用external_labels参数用实例标识符标记时间序列数据。附加任何external_labels全球Prometheus配置文件的部分。你可以找到/ api /舞会/推动URL、用户名和密码,为您的指标端点单击细节在普罗米修斯卡片上云门户

第一个普罗米修斯实例:

global: external_labels: origin_prometheus: prometheus01 remote_write: - url:  basic_auth: username:  password: 

第二个普罗米修斯例子:

global: external_labels: origin_prometheus: prometheus02 remote_write: - url:  basic_auth: username:  password: 

从多个高可用性Prometheus实例发送数据

如果您在高可用性(HA)配置中从多个Prometheus实例将数据传输到Grafana Cloud Metrics,那么您应该使用集群而且__replica__标签来重复在Grafana Cloud Metrics端点接收到的数据。将这些添加到external_labels的配置文件。你可以找到/ api /舞会/推动URL、用户名和密码,为您的指标端点单击细节在普罗米修斯卡片上云门户

第一个HA Prometheus实例:

global: external_labels: cluster: promo -team1 __replica__: replica1 remote_write: - url:  basic_auth: username:  password: 

第二个HA Prometheus实例:

global: external_labels: cluster: promo -team1 __replica__: replica2 remote_write: - url:  basic_auth: username:  password: 

集群标签将标识HA Prometheus集群将数据发送到Grafana Cloud Metrics。的__replica__标签应该设置为HA Prometheus集群中的唯一值。当Grafana Cloud Metrics重复数据删除并接收数据时,它将被删除。

要了解有关Prometheus配置参数的更多信息,请参阅普罗米修斯。io配置文档

使用Prometheus和node_exports监视Linux主机提供了安装本地Prometheus实例并使用的完整从头到尾示例remote_write将指标从实例发送到Grafana Cloud。