add metrics

Signed-off-by: LiHui <andrewli@yunify.com>
This commit is contained in:
LiHui
2020-12-22 16:19:25 +08:00
committed by LiHui
parent f2e96bce7f
commit 5c8ac10d26
8 changed files with 180 additions and 2 deletions

View File

@@ -0,0 +1,25 @@
package openpitrix
import (
compbasemetrics "k8s.io/component-base/metrics"
"kubesphere.io/kubesphere/pkg/utils/metrics"
)
var (
appTemplateCreationCounter = compbasemetrics.NewCounterVec(
&compbasemetrics.CounterOpts{
Name: "application_template_creation",
Help: "Counter of application template creation broken out for each workspace, name and create state",
StabilityLevel: compbasemetrics.ALPHA,
},
[]string{"workspace", "name", "state"},
)
)
func init() {
Register()
}
func Register() {
metrics.MustRegister(appTemplateCreationCounter)
}