Skip to content

Commit aee8252

Browse files
authored
Merge pull request #50 from tigrisdata/hk/locality
fix: check for non-nil Locality before use in group_processes
2 parents a9f1424 + 2c9338f commit aee8252

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

metrics/group_processes.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ func (p *ProcessesMetricGroup) getTags(processName string, process *models.Proce
4444
// For no Kubenetes deployments, metrics will be tagged with the machine hostname and the address of the process
4545
tags["machine_id"] = process.MachineId
4646
tags["address"] = process.Address
47-
tags["zone"] = process.Locality.ZoneId
47+
if process.Locality != nil {
48+
tags["zone"] = process.Locality.ZoneId
49+
}
4850
} else {
4951
// Try to tag the name with the human readable name (as published by the operator) instead of the key in the json
5052
if process.Locality != nil {

0 commit comments

Comments
 (0)