跳至正文
Wener Notes

Prometheus 联邦

约 1 分钟阅读
  • 是什么?
    • Prometheus 采集 Prometheus
    • 级联联邦/Hierarchical federation - 全量采集 - 例如 多个集群环境
    • 跨服务联邦/Cross-service federation - 部分采集 - 例如 多个集群部署相同服务
  • 优势
    • 简单的解决分布式指标采集问题
  • 建议
    • 如果有更好的条件则选择 Thanos
  • 联邦/Federation 解决的是采集问题,没有解决存储和查询问题
  • 存储和查询能力受单机性能影响
  • 没有缓存、没有查询分发、没有存储切分带来的问题是
    • 无法规模化
    • 数据采集延迟 - 难以集中告警
    • 存储容量无法扩展
    • 大量查询慢
yaml
scrape_configs:
  - job_name: 'federate'
    scrape_interval: 15s
    # 保留所有标签
    honor_labels: true
    # 暴露的联邦接口
    metrics_path: '/federate'
    # 选择指标 -
    params:
      'match[]':
        - '{job="prometheus"}'
        - '{__name__=~"job:.*"}'
    # 需要采集的实例
    static_configs:
      - targets:
          - 'source-prometheus-1:9090'
          - 'source-prometheus-2:9090'
          - 'source-prometheus-3:9090'

关联信息

反向链接、本文链接的其他页面和外部资料。

参考资料

其他外链1 条
最近更新commit 9bc36d1编辑