Skip to content

Commit c24623c

Browse files
authored
Merge pull request #51 from tigrisdata/hk/locality2
fix: by default use "unknown" zone if locality is not set
2 parents aee8252 + 5752900 commit c24623c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

metrics/group_processes.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,17 @@ 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"] = "unknown"
4748
if process.Locality != nil {
4849
tags["zone"] = process.Locality.ZoneId
4950
}
5051
} else {
52+
tags["fdb_pod_name"] = processName
53+
tags["zone"] = "unknown"
5154
// Try to tag the name with the human readable name (as published by the operator) instead of the key in the json
5255
if process.Locality != nil {
5356
tags["fdb_pod_name"] = process.Locality.InstanceId
5457
tags["zone"] = process.Locality.ZoneId
55-
} else {
56-
tags["fdb_pod_name"] = processName
5758
}
5859
}
5960
tags["class_type"] = process.ClassType

0 commit comments

Comments
 (0)