Use default namespace in metrics exporter

Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>
This commit is contained in:
Vivek Singh
2020-03-22 23:23:50 +05:30
committed by Alex Ellis
parent f7b02b47f8
commit c0ba41ce33
4 changed files with 16 additions and 14 deletions

View File

@ -51,7 +51,7 @@ type PrometheusFunctionNotifier struct {
func (p PrometheusFunctionNotifier) Notify(method string, URL string, originalURL string, statusCode int, event string, duration time.Duration) {
serviceName := getServiceName(originalURL)
if len(p.FunctionNamespace) > 0 {
if index := strings.Index(serviceName, "."); index == -1 {
if !strings.Contains(serviceName, ".") {
serviceName = fmt.Sprintf("%s.%s", serviceName, p.FunctionNamespace)
}
}