-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add PCF metrics counters #151
feat: add PCF metrics counters #151
Conversation
Signed-off-by: Dario Faccin <dario.faccin@canonical.com>
Signed-off-by: Dario Faccin <dario.faccin@canonical.com>
producer/smpolicy.go
Outdated
@@ -255,11 +259,18 @@ func createSMPolicyProcedure(request models.SmPolicyContextData) ( | |||
func HandleDeleteSmPolicyContextRequest(request *httpwrapper.Request) *httpwrapper.Response { | |||
logger.SMpolicylog.Infoln("handle DeleteSmPolicyContext") | |||
smPolicyID := request.Params["smPolicyId"] | |||
response, problems := getSmPolicyContextProcedure(smPolicyID) | |||
smPolicyDnn := "UNKNOWN_DNN" | |||
if problems != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be response != nil ?
if problem is not nil then response is nil and it would lead to crash.
producer/smpolicy.go
Outdated
// status code is based on SPEC, and option headers | ||
return httpwrapper.NewResponse(http.StatusOK, nil, response) | ||
} else if problemDetails != nil { | ||
stats.IncrementPcfSmPolicyStats("get", "UNKNOWN_DNN", "SUCCESS") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not this be FAILURE?
producer/smpolicy.go
Outdated
@@ -340,17 +354,25 @@ func HandleUpdateSmPolicyContextRequest(request *httpwrapper.Request) *httpwrapp | |||
logger.SMpolicylog.Infoln("handle UpdateSmPolicyContext") | |||
requestDataType := request.Body.(models.SmPolicyUpdateContextData) | |||
smPolicyID := request.Params["smPolicyId"] | |||
getResponse, getProblemDetails := getSmPolicyContextProcedure(smPolicyID) | |||
smPolicyDnn := "UNKNOWN_DNN" | |||
if getProblemDetails != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- getResponse would be nil if getProblemDetails is not nil.
- Can we have consistency in naming these variables?
Signed-off-by: Dario Faccin <dario.faccin@canonical.com>
Signed-off-by: Dario Faccin <dario.faccin@canonical.com>
This PR adds two new 5G specific metrics,
pcf_smpolicy
andpcf_policy_authorization
to exported metrics via Prometheus.The scope of the metrics is the following:
pcf_smpolicy
: this metric counts the total number of Session Management policy queries to PCF; the metric stores the query type (create
,get
,update
,delete
), the DNN and the result (SUCCESS
,FAILURE
);pcf_policy_authorization
: this metric counts the total number policy authorization queries to PCF; the metric stores the query type (create
,get
,update
,delete
), the resource type (application_sessions
,events_subscriptions
) and the result (SUCCESS
,FAILURE
).