mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-20 07:19:17 +01:00
lib/logger: merge file
and line
labels into location="file:line"
This should improve the usability for `vm_log_messages_total` metric during practical queries
This commit is contained in:
parent
70b8191fab
commit
42da569bcd
@ -123,7 +123,8 @@ func logMessage(level, msg string, skipframes int) {
|
||||
mu.Unlock()
|
||||
|
||||
// Increment vm_log_messages_total
|
||||
counterName := fmt.Sprintf(`vm_log_messages_total{app_version=%q, level=%q, file=%q, line="%d"}`, buildinfo.Version, levelLowercase, file, line)
|
||||
location := fmt.Sprintf("%s:%d", file, line)
|
||||
counterName := fmt.Sprintf(`vm_log_messages_total{app_version=%q, level=%q, location=%q}`, buildinfo.Version, levelLowercase, location)
|
||||
metrics.GetOrCreateCounter(counterName).Inc()
|
||||
|
||||
switch level {
|
||||
|
Loading…
Reference in New Issue
Block a user