mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00: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
1 changed files with 2 additions and 1 deletions
|
@ -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 a new issue