云原生环境下的日志监控

如果无法正常显示,请先停止浏览器的去广告插件。
分享至:
1. 云原生环境下的 日志监控 eBay的日志监控演进之路
2. Intro 云原生环境下,应用容器化,架构微服务化,给日志监控带来了很多挑战,例如客 户端数量激增,日志分布更为分散,查询速度缓慢。 eBay生产环境拥有超过十万台Kubernetes Node的集群,日志监控面临很大挑战。 我们尝试了若干开源方案,碰到了诸多问题,也吸取了很多经验。最终成型了一套 轻量级的高效的大规模下的日志监控系统。这里我们会和大家分享一些我们的经验 教训。
3. Journey on Logs - Stage 1 需求 - - 低开发成本上线 客户学习成本低 先解决有没有的问题 方案 Filebeat + Kafka + Elasticsearch + Grafana
4. Journey on Logs - Stage 1 几年后。。 问题 - - - 扩容成本巨大 (300+ nodes, 0.15GB/s, 30 days) 查询缓慢 数据丢失,迟到现象严重 太重,不 scale 结论 ElasticSearch 不适合大规模日志监控平台
5. Journey on Logs - Stage 2 需求 - - 低存储成本 能scale Loki - - - - - 只对label做index 读写分离 使用廉价的对象存储(S3) 易于维护:所有节点无状态 一揽子方案
6. Journey on Logs - Stage 2 方案 (PoC) - Filebeats + Loki + Grafana
7. Journey on Logs - Stage 2 问题 - - - - Ingester 不稳定 Log volume 在Ingester间不平均 我们的Object Store 在大规模下性能不好 Loki 没有大规模的生产案例 (only 18MB/s, 121K line/s) 结论 规模上去了,Loki也不适合我们
8. Journey on Logs - Stage 3 需求 - - - 存储结构和后端能扛住PB级别的日志 (CAL/CAT) 用户体验像Loki一样友好易用 能和其他监控数据无缝衔接
9. Journey on Logs - Stage 3 方案: Filebeats + Log Ingress + ClickHouse + FileSystem + Log Egress + Grafana
10. Journey on Logs - Stage 3
11. Journey on Logs - Stage 3 Status Snapshot
12. Journey on Logs - Stage 3 Infra Cost Saving: Over 50% Ingest Status Snapshot Uncompressed Read Bytes 1.6 GB/s Compressed Write Bytes 160 MB/s # of pods/clients 1 million Egress Status Snapshot # of requests 0.3 Avg Query Latency < 1s
13. Journey on Logs - Stage 3 优化1 - 避免文件数爆炸 1. 使用 Long-Live 的 TCP Connection 2. 持续 追加日志到同一个文件
14. Journey on Logs - Stage 3 优化2 - 高效的元数据读写 1. 引入Column DB - ClickHouse 2. 利用它的 ReplacingMergeTree 做数据去重 # of total entities 3 billion # of keeping days 30 days Ingest rate ~ 50 k/s
15. Journey on Logs - Stage 3 Perf Compare with MySQL (~1 million entities in one table) Table Design | date | env | pool | ip | hostname | region | Case Time Cost in MySQL (s) Time Cost in ClickHouse (s) SELECT distinct env 0.01 0.036 SELECT distinct pool where env=’prod’ 2.36 0.081 SELECT distinct ip where env=’prod’ and pool=’pool1’ 0.81 0.064 SELECT * where env=’prod’ 1.53 0.573
16. Next 挖掘更多log的价值 1. 看更少的log,得到更多的有用信息 2. Error Log激增,或者某种pattern的log数量发生剧变,及时报警 3. 不需要domain knowledge
17. Next Datadog - Log Patterns
18. More 有schema的需求?Event 1. Agg Metrics 2. Alert 3. Anomaly Detection
19. More - Event
20. More - Anomaly Detection
21. More - Anomaly Detection
22. Q & A

inicio - Wiki
Copyright © 2011-2024 iteam. Current version is 2.134.0. UTC+08:00, 2024-10-01 04:27
浙ICP备14020137号-1 $mapa de visitantes$