Browse Source

feat: support metrics config

rammiah 1 day ago
parent
commit
d1e07954c5
2 changed files with 10 additions and 2 deletions
  1. 6 2
      web/service/config.json
  2. 4 0
      xray/config.go

+ 6 - 2
web/service/config.json

@@ -81,5 +81,9 @@
       }
     ]
   },
-  "stats": {}
-}
+  "stats": {},
+  "metrics": {
+    "tag": "metrics_out",
+    "listen": "127.0.0.1:11111"
+  }
+}

+ 4 - 0
xray/config.go

@@ -20,6 +20,7 @@ type Config struct {
 	FakeDNS          json_util.RawMessage `json:"fakedns"`
 	Observatory      json_util.RawMessage `json:"observatory"`
 	BurstObservatory json_util.RawMessage `json:"burstObservatory"`
+	Metrics          json_util.RawMessage `json:"metrics"`
 }
 
 func (c *Config) Equals(other *Config) bool {
@@ -61,5 +62,8 @@ func (c *Config) Equals(other *Config) bool {
 	if !bytes.Equal(c.FakeDNS, other.FakeDNS) {
 		return false
 	}
+	if !bytes.Equal(c.Metrics, other.Metrics) {
+		return false
+	}
 	return true
 }