数据写入

最近更新时间:2024-12-10 14:55:32

我的收藏

操作场景

在一些场景下(例如:Flink job 的生命周期可能很短,来不及等待 Prometheus 拉取其指标),我们需要将指标数据直接写入 Prometheus。此时可以使用 Remote Write 或者 Pushgateway 的方式。

Remote Write

POST /api/v1/prom/write
Remote Write 是 Prometheus 标准的协议,更多介绍可以 访问这里。使用 remote write 我们可以把 VPC 内其他 Prometheus 的数据写入到腾讯云托管的 Prometheus 服务中,对于数据的稳定性提升和迁移,都不失为一种不错的方案。

Pushgateway

虽然 Prometheus 采集指标建议以 Pull 模式拉取为主,但是有些场景我们仍然需要使用 Push 推送的方式,详情请参见 官方文档。详细使用参见 Pushgateway 接入