diff --git a/cmd/outline-ss-server/metrics.go b/cmd/outline-ss-server/metrics.go index c5641411..5766163a 100644 --- a/cmd/outline-ss-server/metrics.go +++ b/cmd/outline-ss-server/metrics.go @@ -60,7 +60,7 @@ func newProxyCollector(proto string) (*proxyCollector, error) { prometheus.CounterOpts{ Name: "data_bytes_per_location", Help: "Bytes transferred by the proxy, per location", - }, []string{"proto", "dir", "location", "asn"}).CurryWith(map[string]string{"proto": proto}) + }, []string{"proto", "dir", "location", "asn", "asorg"}).CurryWith(map[string]string{"proto": proto}) if err != nil { return nil, err } @@ -82,16 +82,16 @@ func (c *proxyCollector) Collect(ch chan<- prometheus.Metric) { func (c *proxyCollector) addClientTarget(clientProxyBytes, proxyTargetBytes int64, accessKey string, clientInfo ipinfo.IPInfo) { addIfNonZero(clientProxyBytes, c.dataBytesPerKey, "c>p", accessKey) - addIfNonZero(clientProxyBytes, c.dataBytesPerLocation, "c>p", clientInfo.CountryCode.String(), asnLabel(clientInfo.ASN)) + addIfNonZero(clientProxyBytes, c.dataBytesPerLocation, "c>p", clientInfo.CountryCode.String(), asnLabel(clientInfo.ASN.Number), clientInfo.ASN.Organization) addIfNonZero(proxyTargetBytes, c.dataBytesPerKey, "p>t", accessKey) - addIfNonZero(proxyTargetBytes, c.dataBytesPerLocation, "p>t", clientInfo.CountryCode.String(), asnLabel(clientInfo.ASN)) + addIfNonZero(proxyTargetBytes, c.dataBytesPerLocation, "p>t", clientInfo.CountryCode.String(), asnLabel(clientInfo.ASN.Number), clientInfo.ASN.Organization) } func (c *proxyCollector) addTargetClient(targetProxyBytes, proxyClientBytes int64, accessKey string, clientInfo ipinfo.IPInfo) { addIfNonZero(targetProxyBytes, c.dataBytesPerKey, "p