Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

服务方法的指标数据,ip标签为何移走了?是怎么考量的? #13345

Closed
1 task done
bert82503 opened this issue Nov 10, 2023 · 2 comments
Closed
1 task done

Comments

@bert82503
Copy link

bert82503 commented Nov 10, 2023

  • I have searched the issues of this repository and believe that this is not a duplicate.

Ask your question here

应用从3.2.5升级到3.2.7版本,发现方法维度的标签指标,没有ip标签字段?请问是怎么考量的?
3.2.6版本没有重构org.apache.dubbo.metrics.model.MetricsSupport#applicationTags)

刚发现,是这个重构了 #13034
@songxiaosheng @AlbumenJ
某个方法耗时长,怎么反推定位到是某个ip实例触发的?通过traceId定位么?

看了3.2.7版本发布说明的3个功能变更,没搜索到关于MetricsSupporthostTags的改动

image

标签指标数据前后对比

3.2.6版本的标签指标有ip标签

# HELP dubbo_provider_requests_failed_service_unavailable_total_aggregate Aggregated failed codec total Requests
# TYPE dubbo_provider_requests_failed_service_unavailable_total_aggregate gauge
dubbo_provider_requests_failed_service_unavailable_total_aggregate{
application_module_id="1.1",application_name="lefit-user",
application_version="3.2.6",
git_commit_id="89e279739b02f79dcb0a9d40462feb12fd237908",group="",
hostname="lihuagangdebijibendiannao.local",interface="com.lefit.user.client.core.UserLoginApi",
ip="172.16.22.50",method="userLoginInWXMiniProgram",version="1.0",} 0.0

3.2.7版本的标签指标没有ip标签

# HELP dubbo_provider_requests_failed_service_unavailable_total_aggregate Aggregated failed codec total Requests
# TYPE dubbo_provider_requests_failed_service_unavailable_total_aggregate gauge
dubbo_provider_requests_failed_service_unavailable_total_aggregate{
application="lefit-user",application_module_id="1.1",
application_name="lefit-user",
group="",interface="com.lefit.user.client.core.UserApi",method="userDefaultGenInfo",version="1.0",} 0.0

通过arthas抓包验证org.apache.dubbo.metrics.model.MethodMetric.getTags

watch org.apache.dubbo.metrics.model.ApplicationMetric getTags '{target, returnObj}' -x 2

img_v3_0052_8ad14dfc-b57c-4d7f-a997-253aa052fadg

org.apache.dubbo.metrics.model.Metric

public interface Metric {
    Map<String, String> getTags();
}

服务方法维度的标签指标

org.apache.dubbo.metrics.model.MethodMetric#getTags

e5f2ad18-62de-42e2-a19c-75cae2230cea

org.apache.dubbo.metrics.model.MetricsSupport#methodTags

e07b37db-d1be-47e9-bb96-61fe3437b38a

org.apache.dubbo.metrics.model.MetricsSupport#hostTags
这个方法没有被调用,所以ip标签没有了

73cdec92-a34a-4b73-89a2-10922b70e2ef

应用维度的标签指标

org.apache.dubbo.metrics.model.ApplicationMetric#getTags
包装调用hostTags

img_v3_0252_4b4dcaff-9cf5-47f1-b1cb-737e2a7f217g

@bert82503 bert82503 changed the title 服务方法的标签指标,ip为何移走了?是怎么考量的? 服务方法的标签指标数据,ip标签为何移走了?是怎么考量的? Nov 10, 2023
@bert82503 bert82503 changed the title 服务方法的标签指标数据,ip标签为何移走了?是怎么考量的? 服务方法的指标数据,ip标签为何移走了?是怎么考量的? Nov 10, 2023
@songxiaosheng
Copy link
Member

songxiaosheng commented Nov 10, 2023

ip或者主机信息可以直接通过取指标来源查询比如普罗米修斯的$instance变量,在每个指标中增加此标签有点冗余了

@bert82503
Copy link
Author

ip或者主机信息可以直接通过取指标来源查询比如普罗米修斯的$instance变量,在每个指标中增加此标签有点冗余了

理解了,感谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants