【问题标题】:Extract timeseries from TSDB Prometheus 2.0 files using Python使用 Python 从 TSDB Prometheus 2.0 文件中提取时间序列
【发布时间】:2022-07-01 21:09:22
【问题描述】:

[编辑]:我找到了一个包,它完全符合我的要求,但它是用 Go 编写的:https://github.com/ryotarai/prometheus-tsdb-dump

我有一个 s3 存储桶,我的系统指标数据按照 Prometheus 2.0 格式存储在此处,如 https://thanos.io/tip/thanos/design.md/#metric-sources 所示。

我的目标是使用 python 将这些压缩数据“解析”成可理解的格式(例如 json,例如带有键 timestamp、value、metric...),以便执行时间序列分析。

我了解数据的压缩方式使得通过 Thanos 使用 PromQL 查询它们将是快速且最佳的,但我找不到与我的用例类似的任何内容(即使有关于我的数据格式的文档)我想在这里阅读https://github.com/prometheus/prometheus/tree/main/tsdb/docs/format,我不完全理解如何解析index 和chunks 文件..)

【问题讨论】:

    标签: python prometheus thanos


    【解决方案1】:

    您可以使用this library 从 Prometheus 读取数据并将其转换为 Pandas 数据帧。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-09-09
      • 1970-01-01
      • 1970-01-01
      • 2018-12-29
      • 2017-03-08
      • 1970-01-01
      • 2012-08-10
      相关资源
      最近更新 更多