From df0a8759c5061ba29c236f1810751c012bd399e3 Mon Sep 17 00:00:00 2001 From: Ankur Upadhyaya Date: Thu, 20 Oct 2022 21:25:45 +0530 Subject: [PATCH 1/2] updated util version --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index ad034fda..846f182a 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/omec-project/ngap v1.1.0 github.com/omec-project/openapi v1.1.0 github.com/omec-project/path_util v1.1.0 - github.com/omec-project/util v1.0.3 + github.com/omec-project/util v1.0.4 github.com/prometheus/client_golang v1.11.1 github.com/sirupsen/logrus v1.9.0 github.com/spf13/viper v1.7.1 diff --git a/go.sum b/go.sum index 45e8f4e8..b69b2adf 100644 --- a/go.sum +++ b/go.sum @@ -819,8 +819,8 @@ github.com/omec-project/openapi v1.1.0/go.mod h1:Fv9ajWROYypcNER+ZwWXPhLCdV4pBz7 github.com/omec-project/path_util v1.0.100-dev/go.mod h1:O1ch35al6+FXKmg6+5vOpKusl4fiB0u36oYjxwI4QK4= github.com/omec-project/path_util v1.1.0 h1:vzzLsay8+uexyYEqS06th8lMcwp+N+CXcaHhaypZn1Q= github.com/omec-project/path_util v1.1.0/go.mod h1:O1ch35al6+FXKmg6+5vOpKusl4fiB0u36oYjxwI4QK4= -github.com/omec-project/util v1.0.3 h1:v4IoVKcC/FXRdgtA1H1WDvXXfOKHf4b60De1D/hWgUQ= -github.com/omec-project/util v1.0.3/go.mod h1:BGsKjsH+kNoPcMhEEX1PgDAR4A2r03rD3902mQ9f1II= +github.com/omec-project/util v1.0.4 h1:9BkSdA0j6/K/rw9Q79ONOTSGWBNTmt1q7YiapsGcNTI= +github.com/omec-project/util v1.0.4/go.mod h1:BGsKjsH+kNoPcMhEEX1PgDAR4A2r03rD3902mQ9f1II= github.com/omec-project/util_3gpp v1.1.1 h1:lT8J2uvCuKaOrIasZgV7+bXSjBb9/i8FG9ZFQnpx2yE= github.com/omec-project/util_3gpp v1.1.1/go.mod h1:r8J8yuEwWeBLlX4ZqsCjbEYxUZDCTWn0H+xZ12kvB/s= github.com/onsi/ginkgo v0.0.0-20151202141238-7f8ab55aaf3b/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= From 8f06d3ae4e661e3acc082c011dc2722a94cad50a Mon Sep 17 00:00:00 2001 From: Ankur Upadhyaya Date: Wed, 9 Nov 2022 16:34:00 +0530 Subject: [PATCH 2/2] metric function changes --- context/amf_ran.go | 7 +++ context/amf_ue.go | 47 ++++++++++++++++++ context/db.go | 1 - factory/config.go | 14 ++++-- gmm/handler.go | 2 + gmm/sm.go | 7 ++- go.mod | 11 +++-- go.sum | 72 +++++++++++++++++++++------ logger/logger.go | 2 + metrics/kafka.go | 110 ++++++++++++++++++++++++++++++++++++++++++ ngap/handler.go | 15 ++++++ service/amf_server.go | 18 +++++++ service/init.go | 14 ++++++ util/init_context.go | 3 ++ 14 files changed, 299 insertions(+), 24 deletions(-) create mode 100644 metrics/kafka.go diff --git a/context/amf_ran.go b/context/amf_ran.go index 2f1c6680..2ab33c4f 100644 --- a/context/amf_ran.go +++ b/context/amf_ran.go @@ -15,6 +15,7 @@ import ( "github.com/omec-project/amf/logger" "github.com/omec-project/amf/metrics" "github.com/omec-project/amf/protos/sdcoreAmfServer" + mi "github.com/omec-project/metricfunc/pkg/metricinfo" "github.com/omec-project/ngap/ngapConvert" "github.com/omec-project/ngap/ngapType" "github.com/omec-project/openapi/models" @@ -64,6 +65,12 @@ func NewSupportedTAIList() []SupportedTAI { } func (ran *AmfRan) Remove() { + //send nf(gnb) status notification + gnbStatus := mi.MetricEvent{EventType: mi.CNfStatusEvt, + NfStatusData: mi.CNfStatus{NfType: mi.NfTypeGnb, + NfStatus: mi.NfStatusDisconnected, NfName: ran.GnbId}} + metrics.StatWriter.PublishNfStatusEvent(gnbStatus) + ran.SetRanStats(RanDisconnected) ran.Log.Infof("Remove RAN Context[ID: %+v]", ran.RanID()) ran.RemoveAllUeInRan() diff --git a/context/amf_ue.go b/context/amf_ue.go index 14d2188c..01bc6ed6 100644 --- a/context/amf_ue.go +++ b/context/amf_ue.go @@ -24,9 +24,11 @@ import ( "github.com/omec-project/UeauCommon" "github.com/omec-project/amf/logger" + "github.com/omec-project/amf/metrics" "github.com/omec-project/amf/protos/sdcoreAmfServer" "github.com/omec-project/fsm" "github.com/omec-project/idgenerator" + mi "github.com/omec-project/metricfunc/pkg/metricinfo" "github.com/omec-project/nas/nasMessage" "github.com/omec-project/nas/nasType" "github.com/omec-project/nas/security" @@ -1023,3 +1025,48 @@ func (ue *AmfUe) NewEventChannel() (tx *EventChannel) { //tx.Message <- msg return tx } + +func getPublishUeCtxtInfoOp(state fsm.StateType) mi.SubscriberOp { + + switch state { + case Deregistered: + return mi.SubsOpDel + case DeregistrationInitiated: + return mi.SubsOpDel + case Authentication: + return mi.SubsOpAdd + case SecurityMode: + return mi.SubsOpMod + case ContextSetup: + return mi.SubsOpMod + case Registered: + return mi.SubsOpMod + default: + return mi.SubsOpMod + } +} + +//Collect Ctxt info and publish on Kafka stream +func (ueContext *AmfUe) PublishUeCtxtInfo() { + op := getPublishUeCtxtInfoOp(ueContext.State[models.AccessType__3_GPP_ACCESS].Current()) + kafkaSmCtxt := mi.CoreSubscriber{} + + //Populate kafka sm ctxt struct + kafkaSmCtxt.Imsi = ueContext.Supi + kafkaSmCtxt.AmfId = ueContext.servingAMF.NfId + kafkaSmCtxt.Guti = ueContext.Guti + kafkaSmCtxt.Tmsi = ueContext.Tmsi + kafkaSmCtxt.AmfIp = ueContext.AmfInstanceIp + if ueContext.RanUe != nil && ueContext.RanUe[models.AccessType__3_GPP_ACCESS] != nil { + kafkaSmCtxt.AmfNgapId = ueContext.RanUe[models.AccessType__3_GPP_ACCESS].AmfUeNgapId + kafkaSmCtxt.RanNgapId = ueContext.RanUe[models.AccessType__3_GPP_ACCESS].RanUeNgapId + kafkaSmCtxt.GnbId = ueContext.RanUe[models.AccessType__3_GPP_ACCESS].Ran.GnbId + kafkaSmCtxt.TacId = ueContext.RanUe[models.AccessType__3_GPP_ACCESS].Tai.Tac + } + kafkaSmCtxt.AmfSubState = string(ueContext.State[models.AccessType__3_GPP_ACCESS].Current()) + ueState := ueContext.GetCmInfo() + kafkaSmCtxt.UeState = string(ueState[0].CmState) + + //Send to stream + metrics.GetWriter().PublishUeCtxtEvent(kafkaSmCtxt, op) +} diff --git a/context/db.go b/context/db.go index 3c0b97a0..798d94fe 100644 --- a/context/db.go +++ b/context/db.go @@ -69,7 +69,6 @@ func SetupAmfCollection() { factory.AmfConfig.Configuration.AmfDBName = "sdcore_amf" } - if (factory.AmfConfig.Configuration.Mongodb != nil) && (factory.AmfConfig.Configuration.Mongodb.Url != "") { mongoDbUrl = factory.AmfConfig.Configuration.Mongodb.Url diff --git a/factory/config.go b/factory/config.go index ac99b4f8..dc1a5732 100644 --- a/factory/config.go +++ b/factory/config.go @@ -43,6 +43,12 @@ type Mongodb struct { Url string `yaml:"url"` } +type KafkaInfo struct { + BrokerUri string `yaml:"brokerUri,omitempty"` + BrokerPort int `yaml:"brokerPort,omitempty"` + Topic string `yaml:"topicName,omitempty"` +} + type Configuration struct { AmfName string `yaml:"amfName,omitempty"` AmfDBName string `yaml:"amfDBName,omitempty"` @@ -70,9 +76,11 @@ type Configuration struct { T3565 TimerValue `yaml:"t3565"` //Maintain TaiList per slice - SliceTaiList map[string][]models.Tai `yaml:"sliceTaiList,omitempty"` - EnableSctpLb bool `yaml:"enableSctpLb"` - EnableDbStore bool `yaml:"enableDBStore"` + SliceTaiList map[string][]models.Tai `yaml:"sliceTaiList,omitempty"` + EnableSctpLb bool `yaml:"enableSctpLb"` + EnableDbStore bool `yaml:"enableDBStore"` + KafkaInfo KafkaInfo `yaml:"kafkaInfo,omitempty"` + DebugProfilePort int `yaml:"debugProfilePort,omitempty"` } func (c *Configuration) Get5gsNwFeatSuppEnable() bool { diff --git a/gmm/handler.go b/gmm/handler.go index 112f72a0..f2b23948 100644 --- a/gmm/handler.go +++ b/gmm/handler.go @@ -242,6 +242,7 @@ func transport5GSMMessage(ue *context.AmfUe, anType models.AccessType, newSmContext.SetUserLocation(deepcopy.Copy(ue.Location).(models.UserLocation)) ue.StoreSmContext(pduSessionID, newSmContext) ue.GmmLog.Infof("create smContext[pduSessionID: %d] Success", pduSessionID) + ue.PublishUeCtxtInfo() // TODO: handle response(response N2SmInfo to RAN if exists) } } @@ -355,6 +356,7 @@ func forward5GSMMessageToSMF( ngap_message.SendDownlinkNasTransport(ue.RanUe[accessType], n1Msg, nil) } } + ue.PublishUeCtxtInfo() return nil } diff --git a/gmm/sm.go b/gmm/sm.go index bdf6e355..97e9a71d 100644 --- a/gmm/sm.go +++ b/gmm/sm.go @@ -77,6 +77,7 @@ func Registered(state *fsm.State, event fsm.EventType, args fsm.ArgsType) { amfUe.ClearRegistrationRequestData(accessType) amfUe.GmmLog.Debugln("EntryEvent at GMM State[Registered]") //store context in DB. Registration procedure is complete. + amfUe.PublishUeCtxtInfo() context.StoreContextInDB(amfUe) case GmmMessageEvent: amfUe := args[ArgAmfUe].(*context.AmfUe) @@ -198,6 +199,7 @@ func Authentication(state *fsm.State, event fsm.EventType, args fsm.ArgsType) { if err := HandleAuthenticationResponse(amfUe, accessType, gmmMessage.AuthenticationResponse); err != nil { logger.GmmLog.Errorln(err) } + amfUe.PublishUeCtxtInfo() case nas.MsgTypeAuthenticationFailure: if err := HandleAuthenticationFailure(amfUe, accessType, gmmMessage.AuthenticationFailure); err != nil { logger.GmmLog.Errorln(err) @@ -245,7 +247,7 @@ func SecurityMode(state *fsm.State, event fsm.EventType, args fsm.ArgsType) { amfUe.TxLog = amfUe.NASLog.WithField(logger.FieldSupi, fmt.Sprintf("SUPI:%s", amfUe.Supi)) amfUe.GmmLog = amfUe.GmmLog.WithField(logger.FieldSupi, fmt.Sprintf("SUPI:%s", amfUe.Supi)) amfUe.ProducerLog = logger.ProducerLog.WithField(logger.FieldSupi, fmt.Sprintf("SUPI:%s", amfUe.Supi)) - + amfUe.PublishUeCtxtInfo() amfUe.GmmLog.Debugln("EntryEvent at GMM State[SecurityMode]") if amfUe.SecurityContextIsValid() { amfUe.GmmLog.Debugln("UE has a valid security context - skip security mode control procedure") @@ -357,7 +359,7 @@ func ContextSetup(state *fsm.State, event fsm.EventType, args fsm.ArgsType) { gmmMessage := args[ArgNASMessage] accessType := args[ArgAccessType].(models.AccessType) amfUe.GmmLog.Debugln("EntryEvent at GMM State[ContextSetup]") - + amfUe.PublishUeCtxtInfo() switch message := gmmMessage.(type) { case *nasMessage.RegistrationRequest: amfUe.RegistrationRequest = message @@ -462,6 +464,7 @@ func DeregisteredInitiated(state *fsm.State, event fsm.EventType, args fsm.ArgsT } } } + amfUe.PublishUeCtxtInfo() case GmmMessageEvent: amfUe := args[ArgAmfUe].(*context.AmfUe) gmmMessage := args[ArgNASMessage].(*nas.GmmMessage) diff --git a/go.mod b/go.mod index 846f182a..21449cf8 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/antonfisher/nested-logrus-formatter v1.3.1 github.com/fsnotify/fsnotify v1.4.9 github.com/gin-contrib/cors v1.3.1 - github.com/gin-gonic/gin v1.7.3 + github.com/gin-gonic/gin v1.8.1 github.com/google/uuid v1.3.0 github.com/mitchellh/mapstructure v1.4.1 github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 @@ -26,15 +26,18 @@ require ( github.com/omec-project/openapi v1.1.0 github.com/omec-project/path_util v1.1.0 github.com/omec-project/util v1.0.4 - github.com/prometheus/client_golang v1.11.1 + github.com/prometheus/client_golang v1.13.0 github.com/sirupsen/logrus v1.9.0 github.com/spf13/viper v1.7.1 github.com/stretchr/testify v1.8.0 - github.com/urfave/cli v1.22.4 + github.com/urfave/cli v1.22.9 go.mongodb.org/mongo-driver v1.10.1 google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.1 gopkg.in/yaml.v2 v2.4.0 ) -require github.com/leodido/go-urn v1.2.1 // indirect +require ( + github.com/omec-project/metricfunc v1.1.1 + github.com/segmentio/kafka-go v0.4.38 +) diff --git a/go.sum b/go.sum index b69b2adf..6b41708b 100644 --- a/go.sum +++ b/go.sum @@ -400,8 +400,9 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.5.0/go.mod h1:Nd6IXA8m5kNZdNEHMBd93KT+mdY3+bewLgRvmCsR2Do= github.com/gin-gonic/gin v1.7.0/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= -github.com/gin-gonic/gin v1.7.3 h1:aMBzLJ/GMEYmv1UWs2FFTcPISLrQH2mRgL9Glz8xows= github.com/gin-gonic/gin v1.7.3/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= +github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= +github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -409,9 +410,11 @@ github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3I github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= @@ -437,13 +440,16 @@ github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/ github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= -github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= -github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= +github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= +github.com/go-playground/validator/v10 v10.10.0 h1:I7mrTYv78z8k8VXa/qJlOlEXn/nBh+BF8dHX5nt/dr0= +github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGKFlFgcHWWmHQjg= github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= @@ -476,6 +482,8 @@ github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWe github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= +github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= +github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20151105175453-c7fdd8b5cd55/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= github.com/godbus/dbus v0.0.0-20180201030542-885f9cc04c9c/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= @@ -668,6 +676,7 @@ github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.15.6/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/compress v1.15.7/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY= github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/klauspost/connect-compress v0.1.1/go.mod h1:tyt/UNZLW/dx6KTkBsoUT4ZQ33ja/68QJUxDXDARJg4= @@ -677,8 +686,9 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= @@ -710,8 +720,9 @@ github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= github.com/mattn/go-shellwords v1.0.6/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= @@ -809,6 +820,8 @@ github.com/omec-project/logger_conf v1.1.0/go.mod h1:2+SOX9OFbPZ+UNv8k+tvPnaWHo4 github.com/omec-project/logger_util v1.0.100-dev/go.mod h1:UkD09amIhlh8P0k82A6Uz/atiZGeFS3C2wd334CKpuY= github.com/omec-project/logger_util v1.1.0 h1:R7tT80+ML1HlK4OoTrNv/UK+2H/u2GdIFNBx41g630Q= github.com/omec-project/logger_util v1.1.0/go.mod h1:UkD09amIhlh8P0k82A6Uz/atiZGeFS3C2wd334CKpuY= +github.com/omec-project/metricfunc v1.1.1 h1:vlbKT5SJViVgH4pHRrDETiZ2UWp0lO+xp0yxMbRjh7k= +github.com/omec-project/metricfunc v1.1.1/go.mod h1:OmdlWD+gW+/61W/5yT8gqEqfSQ7kNqBp1h8KJ8LEmBE= github.com/omec-project/nas v1.1.2 h1:ApgVHVVvxPydy8H5Dd2fuiGafrvjCIgGgf37h824kd8= github.com/omec-project/nas v1.1.2/go.mod h1:gXqi/IZwEGXno26X8wg8ITsAUiemRQ7PkIJOWP1NzGA= github.com/omec-project/ngap v1.1.0 h1:J9bkPEzzyGd1787nGY/aZVp3gckkZBoJB4tkTo59eyw= @@ -892,8 +905,13 @@ github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAv github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ= github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU= +github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pierrec/lz4/v4 v4.1.15 h1:MO0/ucJhngq7299dKLwIMtgTfbkoSPF6AoMYDd8Q4q0= +github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pierrre/gotestcover v0.0.0-20160517101806-924dca7d15f0/go.mod h1:4xpMLz7RBWyB+ElzHu8Llua96TRCB3YwX+l5EP1wmHk= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -910,8 +928,10 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.11.1 h1:+4eQaD7vAZ6DsfsxB15hbE0odUjGI5ARs9yskGu1v4s= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU= +github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -925,8 +945,10 @@ github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.30.0 h1:JEkYlQnpzrzQFxi6gnukFPdQ+ac82oRhzMcIduJu/Ug= github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= +github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -938,8 +960,9 @@ github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+Gx github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= +github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/robertkrimen/godocdown v0.0.0-20130622164427-0bfa04905481/go.mod h1:C9WhFzY47SzYBIvzFqSvHIR6ROgDo4TtdTuRaOMjF/s= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= @@ -947,6 +970,9 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= +github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -960,6 +986,9 @@ github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= github.com/seccomp/libseccomp-golang v0.9.2-0.20210429002308-3879420cc921/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= +github.com/segmentio/kafka-go v0.4.35/go.mod h1:GAjxBQJdQMB5zfNA21AhpaqOB2Mu+w3De4ni3Gbm8y0= +github.com/segmentio/kafka-go v0.4.38 h1:iQdOBbUSdfuYlFpvjuALgj7N6DrdPA0HfB4AhREOdtg= +github.com/segmentio/kafka-go v0.4.38/go.mod h1:ikyuGon/60MN/vXFgykf7Zm8P5Be49gJU6vezwjnnhU= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= @@ -1036,17 +1065,19 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1 github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c/go.mod h1:hzIxponao9Kjc7aWznkXaL4U4TWaDSs8zcsY4Ka08nM= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go v1.2.1 h1:dz+JxTe7GZQdErTo7SREc1jQj/hFP1k7jyIAwODoW+k= github.com/ugorji/go v1.2.1/go.mod h1:cSVypSfTLm2o9fKxXvQgn3rMmkPXovcWor6Qn5tbFmI= +github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo= +github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.1 h1:/TRfW3XKkvWvmAYyCUaQlhoCDGjcvNR8xVVA/l5p/jQ= github.com/ugorji/go/codec v1.2.1/go.mod h1:s/WxCRi46t8rA+fowL40EnmD7ec0XhR7ZypxeBNdzsM= +github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= +github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli v1.22.4 h1:u7tSpNPPswAFymm8IehJhy4uJMlUuU/GmqSkvJ1InXA= -github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/urfave/cli v1.22.9 h1:cv3/KhXGBGjEXLC4bH0sLuJ9BewaAbpk5oyMOveu4pw= +github.com/urfave/cli v1.22.9/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.11.1/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo= github.com/urfave/cli/v2 v2.11.2/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo= github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk= @@ -1067,6 +1098,10 @@ github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23n github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= github.com/xdg-go/stringprep v1.0.3 h1:kdwGpVNwPFtjs98xCGkHjQtGKh86rDcRZN17QEMCOIs= github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= +github.com/xdg/scram v1.0.5 h1:TuS0RFmt5Is5qm9Tm2SoD89OPqe4IRiFtyFY4iwWXsw= +github.com/xdg/scram v1.0.5/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= +github.com/xdg/stringprep v1.0.3 h1:cmL5Enob4W83ti/ZHuZLuKD/xqJfus4fVPwE+/BDm+4= +github.com/xdg/stringprep v1.0.3/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= @@ -1180,6 +1215,7 @@ golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c= @@ -1278,6 +1314,9 @@ golang.org/x/net v0.0.0-20211108170745-6635138e15ea/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220706163947-c90051bbdb60/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220728211354-c7608f3a8462/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b h1:ZmngSVLe/wycRns9MKikG9OWIEjGcGAkacif7oYQaUY= golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= @@ -1294,8 +1333,9 @@ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210810183815-faf39c7919d5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f h1:Qmd2pbz05z7z6lm0DrgQVVPuBm92jqujBKMHMOlOQEw= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b h1:clP8eMhB30EHdc0bd2Twtq6kgU7yl5ub2cQLSdrv1Dg= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1308,6 +1348,7 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde h1:ejfdSekXMDxDLbRrJMwUk6KnSLZ2McaUCVcIKM+N6jc= golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1406,6 +1447,8 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1415,6 +1458,7 @@ golang.org/x/sys v0.0.0-20211107104306-e0b2ad06fe42/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/logger/logger.go b/logger/logger.go index 59e56047..1bb8eed5 100644 --- a/logger/logger.go +++ b/logger/logger.go @@ -34,6 +34,7 @@ var ( EeLog *logrus.Entry GinLog *logrus.Entry GrpcLog *logrus.Entry + KafkaLog *logrus.Entry ) const ( @@ -75,6 +76,7 @@ func init() { EeLog = log.WithFields(logrus.Fields{"component": "AMF", "category": "EventExposure"}) GinLog = log.WithFields(logrus.Fields{"component": "AMF", "category": "GIN"}) GrpcLog = log.WithFields(logrus.Fields{"component": "AMF", "category": "GRPC"}) + KafkaLog = log.WithFields(logrus.Fields{"component": "AMF", "category": "Kafka"}) } func SetLogLevel(level logrus.Level) { diff --git a/metrics/kafka.go b/metrics/kafka.go new file mode 100644 index 00000000..a3edc9ab --- /dev/null +++ b/metrics/kafka.go @@ -0,0 +1,110 @@ +// SPDX-FileCopyrightText: 2022-present Intel Corporation +// +// SPDX-License-Identifier: Apache-2.0 + +package metrics + +import ( + "context" + "encoding/json" + "fmt" + "time" + + "github.com/omec-project/amf/factory" + "github.com/omec-project/amf/logger" + mi "github.com/omec-project/metricfunc/pkg/metricinfo" + "github.com/segmentio/kafka-go" +) + +type Writer struct { + kafkaWriter kafka.Writer +} + +var StatWriter Writer + +func InitialiseKafkaStream(config *factory.Configuration) error { + + brokerUrl := "sd-core-kafka-headless:9092" + topicName := "sdcore-data-source-amf" + + if config.KafkaInfo.BrokerUri != "" && config.KafkaInfo.BrokerPort != 0 { + brokerUrl = fmt.Sprintf("%s:%d", config.KafkaInfo.BrokerUri, config.KafkaInfo.BrokerPort) + } + logger.KafkaLog.Debugf("initialise kafka broker url [%v]", brokerUrl) + + if config.KafkaInfo.Topic != "" { + topicName = config.KafkaInfo.Topic + } + logger.KafkaLog.Debugf("initialise kafka Topic [%v]", config.KafkaInfo.Topic) + + producer := kafka.Writer{ + Addr: kafka.TCP(brokerUrl), + Topic: topicName, + Balancer: &kafka.LeastBytes{}, + BatchTimeout: 10 * time.Millisecond, + } + + StatWriter = Writer{ + kafkaWriter: producer, + } + + logger.KafkaLog.Debugf("initialising kafka stream with url[%v], topic[%v]", brokerUrl, topicName) + return nil +} + +func GetWriter() Writer { + + return StatWriter +} + +func (writer Writer) SendMessage(message []byte) error { + msg := kafka.Message{Value: message} + err := writer.kafkaWriter.WriteMessages(context.Background(), msg) + return err +} + +func (writer Writer) PublishUeCtxtEvent(ctxt mi.CoreSubscriber, op mi.SubscriberOp) error { + + smKafkaEvt := mi.MetricEvent{EventType: mi.CSubscriberEvt, + SubscriberData: mi.CoreSubscriberData{Subscriber: ctxt, Operation: op}} + if msg, err := json.Marshal(smKafkaEvt); err != nil { + logger.KafkaLog.Errorf("publishing ue context event error [%v] ", err.Error()) + return err + } else { + logger.KafkaLog.Debugf("publishing ue context event[%s] ", msg) + StatWriter.SendMessage(msg) + } + return nil +} + +var nfInstanceId string + +//initialised by context package +func SetNfInstanceId(s string) { + nfInstanceId = s +} + +/* +func PublishMsgEvent(msgType mi.AmfMsgType) error { + + smKafkaMsgEvt := mi.MetricEvent{EventType: mi.CMsgTypeEvt, MsgType: mi.CoreMsgType{MsgType: msgType.String(), SourceNfId: nfInstanceId}} + if msg, err := json.Marshal(smKafkaMsgEvt); err != nil { + return err + } else { + logger.KafkaLog.Debugf("publishing msg event[%s] ", msg) + StatWriter.SendMessage(msg) + } + return nil +} +*/ + +func (writer Writer) PublishNfStatusEvent(msgEvent mi.MetricEvent) error { + + if msg, err := json.Marshal(msgEvent); err != nil { + return err + } else { + logger.KafkaLog.Debugf("publishing nf status event[%s] ", msg) + StatWriter.SendMessage(msg) + } + return nil +} diff --git a/ngap/handler.go b/ngap/handler.go index 1b650a0d..e190495e 100644 --- a/ngap/handler.go +++ b/ngap/handler.go @@ -16,11 +16,13 @@ import ( "github.com/omec-project/amf/context" gmm_message "github.com/omec-project/amf/gmm/message" "github.com/omec-project/amf/logger" + "github.com/omec-project/amf/metrics" "github.com/omec-project/amf/nas" ngap_message "github.com/omec-project/amf/ngap/message" "github.com/omec-project/amf/protos/sdcoreAmfServer" "github.com/omec-project/amf/util" "github.com/omec-project/aper" + mi "github.com/omec-project/metricfunc/pkg/metricinfo" "github.com/omec-project/nas/nasMessage" libngap "github.com/omec-project/ngap" "github.com/omec-project/ngap/ngapConvert" @@ -635,9 +637,15 @@ func HandleNGSetupRequest(ran *context.AmfRan, message *ngapType.NGAPPDU) { if cause.Present == ngapType.CausePresentNothing { ngap_message.SendNGSetupResponse(ran) + //send nf(gnb) status notification + gnbStatus := mi.MetricEvent{EventType: mi.CNfStatusEvt, + NfStatusData: mi.CNfStatus{NfType: mi.NfTypeGnb, + NfStatus: mi.NfStatusConnected, NfName: ran.GnbId}} + metrics.StatWriter.PublishNfStatusEvent(gnbStatus) } else { ngap_message.SendNGSetupFailure(ran, cause) } + } func HandleUplinkNasTransport(ran *context.AmfRan, message *ngapType.NGAPPDU) { @@ -1070,6 +1078,7 @@ func HandleUEContextReleaseComplete(ran *context.AmfRan, message *ngapType.NGAPP if err != nil { ran.Log.Errorln(err.Error()) } + amfUe.PublishUeCtxtInfo() context.StoreContextInDB(amfUe) case context.UeContextReleaseUeContext: ran.Log.Infof("Release UE[%s] Context : Release Ue Context", amfUe.Supi) @@ -1081,9 +1090,11 @@ func HandleUEContextReleaseComplete(ran *context.AmfRan, message *ngapType.NGAPP //Valid Security is not exist for this UE then only delete AMfUe Context if !amfUe.SecurityContextAvailable { ran.Log.Infof("Valid Security is not exist for the UE[%s], so deleting AmfUe Context", amfUe.Supi) + amfUe.PublishUeCtxtInfo() amfUe.Remove() context.DeleteContextFromDB(amfUe) } else { + amfUe.PublishUeCtxtInfo() context.StoreContextInDB(amfUe) } case context.UeContextReleaseDueToNwInitiatedDeregistraion: @@ -1092,6 +1103,7 @@ func HandleUEContextReleaseComplete(ran *context.AmfRan, message *ngapType.NGAPP if err != nil { ran.Log.Errorln(err.Error()) } + amfUe.PublishUeCtxtInfo() amfUe.Remove() context.DeleteContextFromDB(amfUe) case context.UeContextReleaseHandover: @@ -1106,6 +1118,7 @@ func HandleUEContextReleaseComplete(ran *context.AmfRan, message *ngapType.NGAPP ran.Log.Errorln(err.Error()) } amfUe.AttachRanUe(targetRanUe) + amfUe.PublishUeCtxtInfo() // Todo: remove indirect tunnel default: ran.Log.Errorf("Invalid Release Action[%d]", ranUe.ReleaseAction) @@ -1712,6 +1725,7 @@ func HandlePDUSessionResourceSetupResponse(ran *context.AmfRan, message *ngapTyp } //store context in DB. PDU Establishment is complete. + amfUe.PublishUeCtxtInfo() context.StoreContextInDB(amfUe) } @@ -2336,6 +2350,7 @@ func HandleInitialContextSetupResponse(ran *context.AmfRan, message *ngapType.NG printCriticalityDiagnostics(ran, criticalityDiagnostics) } ranUe.RecvdInitialContextSetupResponse = true + amfUe.PublishUeCtxtInfo() context.StoreContextInDB(amfUe) } diff --git a/service/amf_server.go b/service/amf_server.go index 5a271788..c037c4ea 100644 --- a/service/amf_server.go +++ b/service/amf_server.go @@ -12,8 +12,10 @@ import ( "os" "github.com/omec-project/amf/context" + "github.com/omec-project/amf/metrics" "github.com/omec-project/amf/ngap" "github.com/omec-project/amf/protos/sdcoreAmfServer" + mi "github.com/omec-project/metricfunc/pkg/metricinfo" "google.golang.org/grpc" ) @@ -60,6 +62,12 @@ func (s *Server) HandleMessage(srv sdcoreAmfServer.NgapService_HandleMessageServ ran.RanId = ran.ConvertGnbIdToRanId(ran.GnbId) log.Printf("RanID: %v for GnbId: %v", ran.RanID(), req.GnbId) rsp.GnbId = req.GnbId + + //send nf(gnb) status notification + gnbStatus := mi.MetricEvent{EventType: mi.CNfStatusEvt, + NfStatusData: mi.CNfStatus{NfType: mi.NfTypeGnb, + NfStatus: mi.NfStatusConnected, NfName: req.GnbId}} + metrics.StatWriter.PublishNfStatusEvent(gnbStatus) } } ran.Amf2RanMsgChan = Amf2RanMsgChan @@ -69,8 +77,18 @@ func (s *Server) HandleMessage(srv sdcoreAmfServer.NgapService_HandleMessageServ } else if req.Msgtype == sdcoreAmfServer.MsgType_GNB_DISC { log.Println("GNB disconnected") ngap.HandleSCTPNotificationLb(req.GnbId) + //send nf(gnb) status notification + gnbStatus := mi.MetricEvent{EventType: mi.CNfStatusEvt, + NfStatusData: mi.CNfStatus{NfType: mi.NfTypeGnb, + NfStatus: mi.NfStatusDisconnected, NfName: req.GnbId}} + metrics.StatWriter.PublishNfStatusEvent(gnbStatus) } else if req.Msgtype == sdcoreAmfServer.MsgType_GNB_CONN { log.Println("New GNB Connected ") + //send nf(gnb) status notification + gnbStatus := mi.MetricEvent{EventType: mi.CNfStatusEvt, + NfStatusData: mi.CNfStatus{NfType: mi.NfTypeGnb, + NfStatus: mi.NfStatusConnected, NfName: req.GnbId}} + metrics.StatWriter.PublishNfStatusEvent(gnbStatus) } else { ngap.DispatchLb(req, Amf2RanMsgChan) } diff --git a/service/init.go b/service/init.go index 57b73d7b..35728685 100644 --- a/service/init.go +++ b/service/init.go @@ -10,6 +10,8 @@ package service import ( "bufio" "fmt" + "net/http" + _ "net/http/pprof" //Using package only for invoking initialization. "os" "os/exec" "os/signal" @@ -114,6 +116,14 @@ func (amf *AMF) Initialize(c *cli.Context) error { amf.setLogLevel() + //Initiating a server for profiling + if factory.AmfConfig.Configuration.DebugProfilePort != 0 { + addr := fmt.Sprintf(":%d", factory.AmfConfig.Configuration.DebugProfilePort) + go func() { + http.ListenAndServe(addr, nil) + }() + } + if err := factory.CheckConfigVersion(); err != nil { return err } @@ -313,6 +323,10 @@ func (amf *AMF) Start() { go metrics.InitMetrics() + if err := metrics.InitialiseKafkaStream(factory.AmfConfig.Configuration); err != nil { + initLog.Errorf("initialise kafka stream failed, %v ", err.Error()) + } + self := context.AMF_Self() util.InitAmfContext(self) self.Drsm, _ = util.InitDrsm() diff --git a/util/init_context.go b/util/init_context.go index 373a3d8b..7fe7df71 100644 --- a/util/init_context.go +++ b/util/init_context.go @@ -15,6 +15,7 @@ import ( "github.com/omec-project/amf/context" "github.com/omec-project/amf/factory" "github.com/omec-project/amf/logger" + "github.com/omec-project/amf/metrics" "github.com/omec-project/nas/security" "github.com/omec-project/openapi/models" ) @@ -40,6 +41,8 @@ func InitAmfContext(context *context.AMFContext) { logger.UtilLog.Infof("amfconfig Info: Version[%s] Description[%s]", config.Info.Version, config.Info.Description) configuration := config.Configuration context.NfId = uuid.New().String() + metrics.SetNfInstanceId(context.NfId) + if configuration.AmfName != "" { context.Name = configuration.AmfName }