Skip to content

Commit 886ce91

Browse files
authored
Added IP address export to Prometheus (#127)
Signed-off-by: hxngillani <[email protected]>
1 parent f0dc4a3 commit 886ce91

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/promclient/promclient.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,15 @@ func PushCoreSubData(imsi, ip_addr, state, smf_ip, dnn, slice, upf string) {
104104
"adding subscriber data [%v, %v, %v, %v, %v, %v, %v]",
105105
imsi, ip_addr, state, smf_ip, dnn, slice, upf,
106106
)
107-
promStats.coreSub.WithLabelValues(imsi, "", state, smf_ip, dnn, slice, upf).Inc()
107+
promStats.coreSub.WithLabelValues(imsi, ip_addr, state, smf_ip, dnn, slice, upf).Inc()
108108
}
109109

110110
func DeleteCoreSubData(imsi, ip_addr, state, smf_ip, dnn, slice, upf string) {
111111
logger.PromLog.Debugf(
112112
"deleting subscriber data [%v, %v, %v, %v, %v, %v, %v]",
113113
imsi, ip_addr, state, smf_ip, dnn, slice, upf,
114114
)
115-
promStats.coreSub.DeleteLabelValues(imsi, "", state, smf_ip, dnn, slice, upf)
115+
promStats.coreSub.DeleteLabelValues(imsi, ip_addr, state, smf_ip, dnn, slice, upf)
116116
}
117117

118118
// SetSessStats maintains Session level stats
@@ -121,7 +121,7 @@ func SetSmfSessStats(smfIp, slice, dnn, upf string, count uint64) {
121121
"setting smf session count [%v] with labels [smfIp:%v, slice:%v, dnn:%v, upf:%v]",
122122
count, smfIp, slice, dnn, upf,
123123
)
124-
promStats.smfSessions.WithLabelValues("", "", "", "").Set(float64(count))
124+
promStats.smfSessions.WithLabelValues(smfIp, slice, dnn, upf).Set(float64(count))
125125
}
126126

127127
func DeleteSmfSessStats(smfIp, slice, dnn, upf string) {

0 commit comments

Comments
 (0)