Commit 01ee36d2 authored by Kevin Di Lallo's avatar Kevin Di Lallo
Browse files

meep-subscriptions notification prometheus logging fix

parent c304c9b9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1680,6 +1680,7 @@ func newMobilityProcedureSubCfg(sub *MobilityProcedureSubscription, subId string
		Id:                  subId,
		AppId:               appId,
		Type:                MOBILITY_PROCEDURE_SUBSCRIPTION,
		NotifType:           MOBILITY_PROCEDURE_NOTIFICATION,
		Self:                sub.Links.Self.Href,
		NotifyUrl:           sub.CallbackReference,
		ExpiryTime:          expiryTime,
@@ -1700,6 +1701,7 @@ func newAdjAppInfoSubCfg(sub *AdjacentAppInfoSubscription, subId string, appId s
		Id:                  subId,
		AppId:               appId,
		Type:                ADJACENT_APP_INFO_SUBSCRIPTION,
		NotifType:           ADJACENT_APP_INFO_NOTIFICATION,
		Self:                sub.Links.Self.Href,
		NotifyUrl:           sub.CallbackReference,
		ExpiryTime:          expiryTime,
+1 −0
Original line number Diff line number Diff line
@@ -981,6 +981,7 @@ func newAppTerminationNotifSubCfg(sub *AppTerminationNotificationSubscription, s
		Id:                  subId,
		AppId:               appId,
		Type:                APP_TERMINATION_NOTIF_SUB_TYPE,
		NotifType:           APP_TERMINATION_NOTIF_TYPE,
		Self:                sub.Links.Self.Href,
		NotifyUrl:           sub.CallbackReference,
		ExpiryTime:          nil,
+1 −0
Original line number Diff line number Diff line
@@ -1396,6 +1396,7 @@ func newAssocStaSubscriptionCfg(sub *AssocStaSubscription, subId string) *sm.Sub
		Id:                  subId,
		AppId:               instanceId,
		Type:                ASSOC_STA_SUBSCRIPTION,
		NotifType:           ASSOC_STA_NOTIFICATION,
		Self:                sub.Links.Self.Href,
		NotifyUrl:           sub.CallbackReference,
		ExpiryTime:          expiryTime,
+3 −2
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ type SubscriptionCfg struct {
	Id                  string     `json:"id"`
	AppId               string     `json:"appId"`
	Type                string     `json:"subType"`
	NotifType           string     `json:"notifType"`
	Self                string     `json:"self"`
	NotifyUrl           string     `json:"notifyUrl"`
	ExpiryTime          *time.Time `json:"expiryTime"`
@@ -233,10 +234,10 @@ func (sub *Subscription) sendNotification(notif []byte, sandbox string, service
		_ = httpLog.LogTx(notifUrl, notifMethod, string(notif), notifResp, startTime)
		if notifErr != nil {
			log.Error(notifErr)
			met.ObserveNotification(sandbox, service, string(notif), notifUrl, nil, duration)
			met.ObserveNotification(sandbox, service, sub.Cfg.NotifType, notifUrl, nil, duration)
			return notifErr
		}
		met.ObserveNotification(sandbox, service, string(notif), notifUrl, notifResp, duration)
		met.ObserveNotification(sandbox, service, sub.Cfg.NotifType, notifUrl, notifResp, duration)
	} else {
		if notifErr != nil {
			log.Error(notifErr)