Modo-me commented on code in PR #3685:
URL: https://github.com/apache/dubbo-go/pull/3685#discussion_r3835383258
##########
metrics/metadata/metric_set.go:
##########
@@ -84,4 +88,52 @@ var (
storeProviderInterfaceRt =
metrics.NewMetricKey(dubboStoreProviderInterfaceRt, "Store Provider Interface
Time")
subscribeServiceRt = metrics.NewMetricKey(dubboSubscribeServiceRt,
"Subscribe Service Time")
+
+ /*
+ # HELP dubbo_metadata_cache_total Total Metadata Cache Lookup Num
+ # TYPE dubbo_metadata_cache_total counter
+
dubbo_metadata_cache_total{application_name="metrics-consumer",hostname="localhost",ip="10.252.156.213",provider_app="metrics-provider",}
5.0
+
dubbo_metadata_cache_hit_total{application_name="metrics-consumer",hostname="localhost",ip="10.252.156.213",provider_app="metrics-provider",}
4.0
+
dubbo_metadata_cache_miss_total{application_name="metrics-consumer",hostname="localhost",ip="10.252.156.213",provider_app="metrics-provider",}
1.0
+ */
+ // app level, tagged by provider app
+ metadataCacheNum =
metrics.NewMetricKey(dubboMetadataCache+totalSuffix, "Total Metadata Cache
Lookup Num")
+ metadataCacheHit =
metrics.NewMetricKey(dubboMetadataCache+"_hit"+totalSuffix, "Hit Metadata Cache
Lookup Num")
+ metadataCacheMiss =
metrics.NewMetricKey(dubboMetadataCache+"_miss"+totalSuffix, "Miss Metadata
Cache Lookup Num")
+
+ /*
+ # HELP dubbo_metadata_fetch_total Total Metadata Fetch Num
+ # TYPE dubbo_metadata_fetch_total counter
+
dubbo_metadata_fetch_total{application_name="metrics-consumer",hostname="localhost",ip="10.252.156.213",provider_app="metrics-provider",result="success",source="report",storage_type="remote",}
1.0
+ */
+ // app level, tagged by provider app, fetch source, storage type and
result
+ metadataFetchNum = metrics.NewMetricKey(dubboMetadataFetch+totalSuffix,
"Total Metadata Fetch Num")
+)
+
+const (
+ TagProviderApp = "provider_app"
+ TagSource = "source"
+ TagStorageType = "storage_type"
+ TagResult = "result"
+)
+
+// Metadata fetch source values
+const (
+ SourceCache = "cache"
+ SourceReport = "report"
+ SourceRpc = "rpc"
+ SourceFallback = "fallback"
+)
+
+// Metadata storage type values
+const (
+ StorageTypeLocal = "local"
+ StorageTypeRemote = "remote"
+ StorageTypeCache = "cache"
Review Comment:
明确了metric的StorageType为local和remote, cache命中的分支处StorageType为""空,不需要观测
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]