2

结构化日志中的指标,怎么输出给 prometheus?

 1 year ago
source link: https://www.v2ex.com/t/924710
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  Kubernetes

结构化日志中的指标,怎么输出给 prometheus?

  1800x · 8 小时 5 分钟前 via Android · 875 次点击
程序主要是 go 写的。
程序中已经准备好结构化日志。绝大部分日志中有下面字段:traceid 、时间、耗时、查询入口、错误,等。
现在要收集这些数据,形成监控。

我猜大概两种方案:
一、每个节点部署某个专用服务收集日志,提取日志中的指标数据,输出给 prometheus 。
二、不增加服务,结构化日志后端 /输出端,通过某个开源库,处理后,直接通过网络输出给 prometheus

但具体自己没操作过,请教各位 v 友。还望指教。

日志系统暂定使用 LOKI 。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK