This is an automated email from the ASF dual-hosted git repository.

zhongxjian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-kubernetes.git


The following commit(s) were added to refs/heads/master by this push:
     new 681f76f3 [horus] Customized module monitoring metrics definition (#425)
681f76f3 is described below

commit 681f76f39cb42f1aa9c387825e6dd08c55599983
Author: mfordjody <[email protected]>
AuthorDate: Fri Oct 4 10:04:40 2024 +0800

    [horus] Customized module monitoring metrics definition (#425)
---
 app/horus/core/horuser/metrics.go | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/app/horus/core/horuser/metrics.go 
b/app/horus/core/horuser/metrics.go
index 573b710e..413d7900 100644
--- a/app/horus/core/horuser/metrics.go
+++ b/app/horus/core/horuser/metrics.go
@@ -15,8 +15,25 @@
 
 package horuser
 
-import "github.com/prometheus/client_golang/prometheus"
+import (
+       "github.com/prometheus/client_golang/prometheus"
+       "strings"
+)
 
-func (h *Horuser) Collect(ch chan<- prometheus.Metric) {}
+func (h *Horuser) Collect(ch chan<- prometheus.Metric) {
+       kFunc := func(m map[string]string) string {
+               s := []string{}
+               for k := range m {
+                       s = append(s, k)
+               }
+               return strings.Join(s, ",")
+       }
+       info := map[string]string{}
+       buttons := map[bool]string{}
+       modularKey := buttons[h.cc.CustomModular.Enabled]
+       info[modularKey] = kFunc(h.cc.CustomModular.KubeMultiple)
+}
 
-func (h *Horuser) Describe(ch chan<- *prometheus.Desc) {}
+func (h *Horuser) Describe(ch chan<- *prometheus.Desc) {
+
+}

Reply via email to