V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
annoygaga
V2EX  ›  程序员

你们都是怎么做大规模的 prometheus 服务方案的?

  •  1
     
  •   annoygaga · 24 天前 · 1981 次点击

    如题,小弟想咨询一下大规模的 prometheus 的方案

    规模主要体现在:

    • 数据量较大
    • 查询量也比较多

    但目前 prometheus 主要是单机的方式,想问问分布式的扩展方法

    28 条回复    2024-05-28 09:51:59 +08:00
    duanzhanling
        1
    duanzhanling  
       23 天前
    可以使用 vm 平滑替换 prometheus
    seers
        2
    seers  
       23 天前 via Android
    k8s operator 直接放集群里面
    chankay
        3
    chankay  
       23 天前
    vm 集群版
    F7TsdQL45E0jmoiG
        4
    F7TsdQL45E0jmoiG  
       23 天前   ❤️ 1
    联邦,分层聚合
    DAPTX4869
        5
    DAPTX4869  
       23 天前
    @duanzhanling #1 vm 的全称是?
    standchan
        6
    standchan  
       23 天前   ❤️ 1
    @DAPTX4869 #5 VictoriaMetrics
    nicholasxuu
        7
    nicholasxuu  
       23 天前
    thanos
    qW7bo2FbzbC0
        8
    qW7bo2FbzbC0  
       23 天前
    VictoriaMetrics
    coyove
        9
    coyove  
       23 天前
    关于数据量和 qps ,可以在 prometheus 或 influxdb 前做一层代理,在那里聚合 metrics 每 30s 上报一次
    yph007595
        10
    yph007595  
       23 天前   ❤️ 1
    @DAPTX4869 #5 VictoriaMetrics
    bluicezhen
        11
    bluicezhen  
       23 天前
    thanos ,长期数据存对象存储
    realpg
        12
    realpg  
       23 天前
    prometheus
    没必要搞很大规模的集群
    拆解开就完事 拆解成多个 prometheus 也不集群化 各自独立采集 每个 exporter 采集至少两份就好
    在可视化层, 比如 grafana 进行数据展现时带逻辑
    tramm
        13
    tramm  
       23 天前
    数据量多大?
    说不定根本用不到集群...
    chesha1
        14
    chesha1  
       23 天前
    首先对于 Prometheus 的前后,最好有一个 mq (比如 kafka )和持久化组件(比如 mimir )

    对于 Prometheus 本身,比较简单的方法就是在不同的机器(集群)上手动多建几个 Prometheus 实例,反正都是放到同一个远程的存储里

    如果单个集群就已经大到超过单 Prometheus 实例的抓取能力了,Prometheus 支持联邦: https://prometheus.io/docs/prometheus/latest/federation/,相当于有多个 Prometheus ,后面的 Prometheus 从前面的 Prometheus 抓取数据
    liuliancao
        15
    liuliancao  
       23 天前
    目前我们是这样
    prometheus 1 抓取 federate1 federate2
    prometheus 2 抓取 federate1 federate2
    proemtheus 用负载均衡去读 alertmanager 配置成 cluster 的方式

    你也可以使用 remote_write 功能 这样你的 remote write 配置成 influxdb 两个 prometheus 用同一个数据源就可以了
    sampeng
        16
    sampeng  
       23 天前
    唯一解 thanos

    prometheus 自带的联邦集群就是个玩具。。。。运维成本其实极其高。thanos 反正一个集群扔一个。反正都是汇总在 s3 的。查询就看你要求了。随便横向扩容。
    我以前线上 2000 多个 pod 。查 1 年随便查
    annoygaga
        17
    annoygaga  
    OP
       23 天前
    @duanzhanling VM 本地存储,是不是很折腾?
    annoygaga
        18
    annoygaga  
    OP
       23 天前
    @chankay VM 看上去是单机器存储,是不是很折腾?在 k8s
    annoygaga
        19
    annoygaga  
    OP
       23 天前
    @nicholasxuu thanos 看上去不错,性能如何?多租户好做么?
    annoygaga
        20
    annoygaga  
    OP
       23 天前
    @qW7bo2FbzbC0 VM 多租户如何?
    annoygaga
        21
    annoygaga  
    OP
       23 天前
    @bluicezhen thanos 性能如何?多租户好做么?
    annoygaga
        22
    annoygaga  
    OP
       23 天前
    @tramm 蛮大的。。。而且可能被滥用
    annoygaga
        23
    annoygaga  
    OP
       23 天前
    @sampeng thanos 性能如何?以及多租户好做么?
    annoygaga
        24
    annoygaga  
    OP
       23 天前
    @coyove 多租户的话呢?
    duanzhanling
        25
    duanzhanling  
       22 天前
    @DAPTX4869 VictoriaMetrics
    duanzhanling
        26
    duanzhanling  
       22 天前
    @annoygaga 没有吧,现在单节点 vm ,运行非常 OK
    sampeng
        27
    sampeng  
       19 天前
    @annoygaga 性能尚可,解决 90%问题。多租户就是在每个集群的数据自动追加 label 。一目了然
    xueling
        28
    xueling  
       18 天前
    了解一下我的开源项目,https://github.com/xl-xueling/xl-lighthouse ,定位不是纯粹的监控系统,统计计算方面的功能远超过 prometheus ,远算性能更强和支持的数据量级也更大。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1005 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 19:45 · PVG 03:45 · LAX 12:45 · JFK 15:45
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.