AlexStocks commented on code in PR #3685:
URL: https://github.com/apache/dubbo-go/pull/3685#discussion_r3819228754
##########
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:
[P1] 这里把“执行路径”混进了 `source`/`storage_type` 的取值,两个维度因此无法表示它们声称的含义。当前 Head
上,remote provider 命中缓存时会导出 `source=cache, storage_type=cache`;判别探针期望保留
`storage_type=remote`,实际得到 `cache`。同样,report 失败后由 RPC 成功取得数据时又写成
`source=fallback`,丢失了实际来源 `rpc`。这样按 `source` 或 `storage_type` 聚合会得到错误结论。建议让
`source` 固定为 cache/report/rpc、`storage_type` 固定为 local/remote,把 fallback
作为单独的路径/阶段标签。
--
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]