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

获取分布式跟踪的 traceId,比如eagleeye的 #1244

Closed
hengyunabc opened this issue Jun 5, 2020 · 0 comments
Closed

获取分布式跟踪的 traceId,比如eagleeye的 #1244

hengyunabc opened this issue Jun 5, 2020 · 0 comments

Comments

@hengyunabc
Copy link
Collaborator

watch

可以直接调用static函数来获取traceId,比如:

[arthas@39996]$ watch com.test.pandora.eagleeye.HomeController home '@com.taobao.eagleeye.EagleEye@getTraceId()'
Press Q or Ctrl+C to abort.
Affect(class count: 1 , method count: 1) cost in 47 ms, listenerId: 4
ts=2020-06-05 17:05:36; [cost=0.752721ms] result=@String[1ee1149c15913479360831011d9c3c]

或者:

[arthas@39996]$ watch com.test.pandora.eagleeye.HomeController home '{params, @com.taobao.eagleeye.EagleEye@getTraceId()}'
Press Q or Ctrl+C to abort.
Affect(class count: 1 , method count: 1) cost in 49 ms, listenerId: 5
ts=2020-06-05 17:08:30; [cost=1.058038ms] result=@ArrayList[
    @Object[][isEmpty=true;size=0],
    @String[1ee1149c15913481104721013d9c3c],
]

trace

trace 命令会自动打印 eagleeye的traceId,比如:

[arthas@39996]$ trace com.test.pandora.eagleeye.HomeController home
Press Q or Ctrl+C to abort.
Affect(class count: 1 , method count: 1) cost in 70 ms, listenerId: 2
`---ts=2020-06-05 17:03:40;thread_name=http-nio-7001-exec-7;id=77;is_daemon=true;priority=5;TCCL=org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedWebappClassLoader@5929021;trace_id=1ee1149c15913478208291007d9c3c;rpc_id=0
    `---[1.215536ms] com.test.pandora.eagleeye.HomeController:home()
        `---[0.882264ms] org.slf4j.Logger:info() #20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant