fix: Enhance session metrics logging to include party member species and username

pull/60/head
Frederico Santos 2 months ago
parent 28c279c36d
commit 400cb28ee3

@ -86,6 +86,7 @@ func ProcessSessionMetrics(save defs.SessionSaveData, username string) {
}
if save.WaveIndex == 1 {
party := ""
for i := 0; i < len(save.Party); i++ {
partyMember, ok := save.Party[i].(map[string]interface{})
if !ok {
@ -98,15 +99,16 @@ func ProcessSessionMetrics(save defs.SessionSaveData, username string) {
formIndex = fmt.Sprintf("%d", formIdx)
}
species, ok := partyMember["Species"].(int)
species, ok := partyMember["species"].(int)
if !ok {
log.Printf("invalid type for Species at index %d", i)
continue
}
key := fmt.Sprintf("%d-%s", species, formIndex)
log.Printf("incremented starter %s", key)
party += key + ","
starterCounter.WithLabelValues(key).Inc()
}
log.Printf("Incremented starters %s count for %s", party, username)
}
}

Loading…
Cancel
Save