【问题标题】:How to push metric to Cortex directly如何将指标直接推送到 Cortex
【发布时间】:2021-02-13 01:14:26
【问题描述】:

有没有办法/客户端(python)将指标推送到 Cortex? 我们有 Prometheus 可以推送指标,但在这种情况下,我需要设置 Prometheus 可以从中提取然后推送到 Cortex 的项目。

我需要避免这种情况并将指标直接推送到 Cortex 并跳过 Prometheus。

【问题讨论】:

    标签: python prometheus


    【解决方案1】:

    Cortex 支持使用Prometheus remote_write API 提取数据。有一个示例 Python 代码通过 Prometheus remote_write API 准备数据并将其发送到远程存储 - 请参阅https://gist.github.com/robskillington/fb82ee5c737b79a3bc891df3dce7a9aa

    不幸的是,Prometheus remote_write 协议并不是 Python 中最容易实现和调试的协议。还有其他时间序列数据库,它们通过更简单的基于文本的协议接受数据,例如Influx line protocolGraphite plaintext protocolOpenTSDB put protocol 等。例如,所有这些协议都由VictoriaMetrics 支持。它还支持 Prometheus 查询 API,因此可以用作 Grafana 中 Prometheus 的替代品。详情请见these docs

    【讨论】:

      猜你喜欢
      • 2021-04-21
      • 1970-01-01
      • 1970-01-01
      • 2020-11-19
      • 2011-07-17
      • 1970-01-01
      • 2021-06-11
      • 1970-01-01
      • 2012-06-09
      相关资源
      最近更新 更多