Loki 的 filename 标签为什么过了 24 小时就丢失了 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Ritter
V2EX    日志处理

Loki 的 filename 标签为什么过了 24 小时就丢失了

  •  
  •   Ritter 2023 年 3 月 3 日 1065 次点击
    这是一个创建于 1068 天前的主题,其中的信息可能已经有所发展或是发生改变。

    应用内日志做了按天的轮转,存储时间是 7 天,通过边车容器 promtail 挂载共享卷 push 到 Loki
    Loki 的话也挂载了持久卷,并且设置了 15 天存储和最大回看周期,刚部署完第一天 push 了所有的日志包括轮转日志,在 grafana 也能看到 filename 标签包含了所有文件,但是第二天查看的时候 filename 标签只有轮转日志了,举个简单的例子就是:
    day1:
    filename => app.log app.log.2023-03-01 app.log.2023-03-02
    day2:
    filename => app.log
    app.log 为轮转文件,日志轮转模式为 rename-create 模式,看 Loki 文档也是推荐使用这种模式
    以下为 Loki 的配置文件

    auth_enabled: false server: http_listen_port: 3100 common: path_prefix: /data/loki chunk_store_config: max_look_back_period: 360h compactor: shared_store: filesystem working_directory: /data/loki/boltdb-shipper-compactor ingester: chunk_block_size: 262144 chunk_idle_period: 3m chunk_retain_period: 1m lifecycler: ring: kvstore: store: inmemory replication_factor: 1 max_transfer_retries: 0 limits_config: enforce_metric_name: false reject_old_samples: true reject_old_samples_max_age: 168h schema_config: configs: - from: "2023-01-01" index: period: 24h prefix: index_ chunks: period: 24h prefix: chunk_ object_store: filesystem schema: v11 store: boltdb-shipper storage_config: boltdb_shipper: active_index_directory: /data/loki/boltdb-shipper-active cache_location: /data/loki/boltdb-shipper-cache cache_ttl: 24h shared_store: filesystem filesystem: directory: /data/loki/chunks table_manager: retention_deletes_enabled: true retention_period: 360h 

    我估计是 schema_config 内 index 的 period 设置出的问题,我理解这个设置的意思是在 24h 后重建索引,但是不明白 Loki 重建索引的规则是什么,为什么只有 filename 的 label 丢失了,有大佬解答一下吗

    目前尚无回复
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     4522 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 31ms UTC 01:34 PVG 09:34 LAX 17:34 JFK 20:34
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86