Jimywu's Hugo Site
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

ExploreGrama

一、loki数据源 Explore your logs

从loglabels选择器中选择一个log流,可以在查询区域写这样的stream selector
普通查询 {job="default/promethues"}

组合查询 {app="cassandra",namespace="prod"}

过滤查询 {app="cassandra"} |~ "(duration|latency)s*(=|is|of)s*[d.]+"
{app="cassandra"} |= "exact match"
{app="cassandra"} != "do not match"

{filename="/var/log/tns-app.log"} #普通查询
{filename="/var/log/tns-app.log"} |= "error" #使用过滤器表达式查询

{job="varlogs"} #普通查询
{job=~”apache|syslog”} #多job匹配查询

Grafana displays all logs within the log file of the sample application. The height of each bar encodes the number of logs that were generated at that time. Grafana 会显示示例应用的所有logs,柱状条的高度代表我们在某个时间产生的日志数量。

二、promethues数据源 Explore your metrics( ad-hoc queries)

tns_request_duration_seconds_count press Shift + Enter
rate(tns_request_duration_seconds_count[5m])
sum(rate(tns_request_duration_seconds_count[5m])) by(route)