惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
V2EX
小众软件
小众软件
MongoDB | Blog
MongoDB | Blog
Jina AI
Jina AI
G
Google Developers Blog
H
Help Net Security
Microsoft Azure Blog
Microsoft Azure Blog
月光博客
月光博客
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
爱范儿
爱范儿
B
Blog
云风的 BLOG
云风的 BLOG
H
Hackread – Cybersecurity News, Data Breaches, AI and More
GbyAI
GbyAI
博客园 - 叶小钗
aimingoo的专栏
aimingoo的专栏
Blog — PlanetScale
Blog — PlanetScale
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
博客园_首页
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence

Grafana

大家的 Grafana+Prometheus 都接了什么告警系统? 如何修改下拉框筛选的选项变成中文进行显示? Grafana 如何根据已经有的 Panel 里的 Threshold 来自动的生成对应的 Alert Rule? Grafana OnCall 只能在 Grafana Could 上用吗? 「Grafana Plugin」支持 jsx 实时渲染的 grafana 面板插件 才部署几天的 loki 产生的小文件既然有 234.5W 求助一个 Grafana 展示网络线路状态问题,有偿 怎么在 Panel 里同时展示 value 和 tag 呢? 最近我安装了 Loki + Promtail + Grafana,感觉这一组合可以取代 Elasticsearch + Logstash 大佬们,这条 promql 怎么写哇 用人用过 grafana Synthetic-monitoring 吗 grafana 可以做离线非实时数据的在线展示吗? 使用 docker 制作了一个简单的 grafana 监控工具 Grafana - An open source, feature rich metrics dashboard and graph editor for Graphite, InfluxDB & OpenTSDB.
为什么在 Loki 中要在使用 sum_over_time()后使用 sum()?
dadagogogo · 2024-05-22 · via Grafana

我采集了 Nginx 的一些日志到 Loki 中,想在 Grafana 中展示,日志关键内容如下

{"bytes_sent": 1400, "uri":"/test"}
{"bytes_sent": 1300, "uri":"/test"}

我尝试使用下述 LogQL 。

sum_over_time({job="$job"} | json |  unwrap bytes_sent  [$__interval])

对应的 Query Inspector 是

Expr: sum_over_time({job="nginx_access_log"} | json |  unwrap bytes_sent  [1m])
Step: 1m0s

但我得到了这样的图:

grafana graph

在这个图中,每个点的 legend 是整个日志,内容是 bytes_send 的值,为什么 sum_over_time 返回的是这些内容呢?

当我尝试在其之前加多一个 sum()时,我得到了我想要的内容和图。

sum(sum_over_time({job="$job"} | json |  unwrap bytes_sent  [$__interval]))

right graph

我实在不知道为什么要在 sum_over_time 前要加 sum 方法,而不是只用 sum_over_time 就可以了。