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

Wrong resource name in ClusterNode-related commands for SphU.entry(method) #1077

Closed
sczyh30 opened this issue Oct 9, 2019 · 0 comments · Fixed by #1078
Closed

Wrong resource name in ClusterNode-related commands for SphU.entry(method) #1077

sczyh30 opened this issue Oct 9, 2019 · 0 comments · Fixed by #1078
Assignees
Labels
kind/bug Category issues or prs related to bug.

Comments

@sczyh30
Copy link
Member

sczyh30 commented Oct 9, 2019

Issue Description

Type: bug report

Describe what happened (or what feature you want)

Wrong resource name resolved in ClusterNode-related commands (e.g. tree, cnode and clusterNode) for SphU.entry(method). The actual resource name for the ClusterNode is correct (full-qualified, classes with package name), but when we get all ClusterNode from related API commands, the displayed resource name will be simplified (i.e. package name is omitted).

For example, for the method com.alibaba.csp.demo.DemoService:foo(java.lang.String), the displayed name will be DemoService:foo(String).

This is caused by the getShowName method of MethodResourceWrapper, which will simplify the FQN of the method.

This bug will also affect the resource display in the dashboard, as the data depends on the command center of Sentinel transport module. This could mislead developers.

Describe what you expected to happen

The resource name for the Method instance should be full-qualified.

How to reproduce it (as minimally and precisely as possible)

  1. Assume we have a method com.alibaba.csp.sentinel.dashboard.controller.DemoController#link, we get the Method instance via reflection API.
  2. Then invoke SphU.entry(method), we can see this in the log: Add child <com.alibaba.csp.sentinel.dashboard.controller.DemoController:link()> to node <xxx>
  3. Execute curl localhost:8719/tree, we cound find wrong name DemoController:link() here:
EntranceNode: machine-root(t:0 pq:0.0 bq:0.0 tq:0.0 rt:0.0 prq:0.0 1mp:6 1mb:0 1mt:6)
-EntranceNode: sentinel_web_servlet_context(t:0 pq:0.0 bq:0.0 tq:0.0 rt:0.0 prq:0.0 1mp:6 1mb:0 1mt:6)
--/demo/link(t:0 pq:0.0 bq:0.0 tq:0.0 rt:0.0 prq:0.0 1mp:0 1mb:0 1mt:0)
---DemoController:link()(t:0 pq:0.0 bq:0.0 tq:0.0 rt:0.0 prq:0.0 1mp:0 1mb:0 1mt:0)

t:threadNum  pq:passQps  bq:blockQps  tq:totalQps  rt:averageRt  prq: passRequestQps 1mp:1m-pass 1mb:1m-block 1mt:1m-total

Tell us your environment

Sentinel 1.7.0-SNAPSHOT in master branch

Anything else we need to know?

NONE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Category issues or prs related to bug.
Projects
None yet
1 participant