普罗米修斯指标
要将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: 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。
相关Grafana云资源
介绍普罗米修斯和格拉夫娜云
普罗米修斯要接管监控世界了!在这次网络研讨会上,我们将首先简要介绍开源项目,它是监控现代云原生系统的实际标准。
如何用Grafana Cloud建立和可视化大规模的综合监控
在这个GrafanaCONline会话中,学习如何使用Kubernetes、Grafana Loki和Grafana Cloud的合成监控功能来设置基础设施的检查。
使用Grafana Cloud来驱动制造工厂的效率
GrafanaCONline课程讲述了Grafana如何帮助一家拥有75年历史的制造公司提高产品质量和维护设备。