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

普罗米修斯指标

要将Prometheus度量数据导入Grafana Cloud,请配置Prometheus使用remote_writeremote_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。