tianxiaoliang commented on a change in pull request #1155:
URL:
https://github.com/apache/servicecomb-service-center/pull/1155#discussion_r716297549
##########
File path: server/metrics/prometheus/metrics_meta.go
##########
@@ -34,85 +33,48 @@ const (
SubSystem = "db"
)
-// Key return metrics key
-func Key(name string) string {
- return util.StringJoin([]string{SubSystem, name}, "_")
-}
-
var (
domainCounter = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
- Namespace: metric.FamilyName,
+ Namespace: metrics.FamilyName,
Subsystem: SubSystem,
Name: KeyDomainTotal,
Help: "Gauge of domain created in Service Center",
}, []string{"instance"})
serviceCounter = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
- Namespace: metric.FamilyName,
+ Namespace: metrics.FamilyName,
Subsystem: "db",
Name: KeyServiceTotal,
Help: "Gauge of microservice created in Service
Center",
- }, []string{"instance", "framework", "frameworkVersion",
"domain"})
+ }, []string{"instance", "framework", "frameworkVersion",
"domain", "project"})
instanceCounter = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
- Namespace: metric.FamilyName,
+ Namespace: metrics.FamilyName,
Subsystem: SubSystem,
Name: KeyInstanceTotal,
Help: "Gauge of microservice created in Service
Center",
- }, []string{"instance", "domain"})
+ }, []string{"instance", "framework", "frameworkVersion",
"domain", "project"})
schemaCounter = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
- Namespace: metric.FamilyName,
+ Namespace: metrics.FamilyName,
Subsystem: SubSystem,
Name: KeySchemaTotal,
Help: "Gauge of schema created in Service Center",
- }, []string{"instance", "domain"})
+ }, []string{"instance", "domain", "project"})
frameworkCounter = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
- Namespace: metric.FamilyName,
+ Namespace: metrics.FamilyName,
Subsystem: SubSystem,
Name: KeyFrameworkTotal,
Help: "Gauge of client framework info in Service
Center",
- }, metric.ToLabelNames(Framework{}))
+ }, []string{"instance", "framework", "frameworkVersion",
"domain", "project"})
Review comment:
常量
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]