-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
*: Integrate timeline tracing with TiKV #19557
Conversation
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
2 similar comments
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
2 similar comments
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
1 similar comment
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
9f25358
to
a085381
Compare
18a9b5a
to
8737e7e
Compare
Signed-off-by: zhongzc <zhongzc_arch@outlook.com> integration Signed-off-by: zhongzc <zhongzc_arch@outlook.com> support local storage Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>
@zhongzc: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
trace/reporter.go
Outdated
curTraceID uint64 | ||
curServiceName string | ||
curJTrace *jaeger.Trace | ||
curSpanIDPrefix uint32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@breeswish
server/conn.go
Outdated
var handle minitrace.TraceHandle | ||
traceEnabled := tidbtrace.Enable.Load() | ||
if traceEnabled { | ||
ctx, handle = minitrace.StartRootSpan(ctx, cc.packetToSQL(data), rand.Uint64(), &tidbtrace.Context{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@c4pt0r You can replace rand.Uint64()
with another meaningful trace ID here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>
Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>
Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>
Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>
Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>
Seems it's a very useful PR, I think we should support/merge it. |
Signed-off-by: zhongzc zhongzc_arch@outlook.com
Getting Started
Create a Work Directory
Build TiDB
git clone -b tracing https://github.com/zhongzc/tidb --depth=1 (cd tidb && make)
Build TiKV
git clone -b new-minitrace https://github.com/zhongzc/tikv --depth=1 (cd tikv && make build)
Create Config Files
Run Jaeger
Set Up Datadog (alternative)
Follow https://docs.datadoghq.com/getting_started/tracing/
Run TiUP to Start a Cluster Locally
Examples
Trace data of SQL whose cost time more than
log.slow-threshold
(set to 5ms above) will be recorded.Select:
From Jaeger UI:
From Datadog UI:
![Screenshot from 2020-12-04 10-59-18](https://user-images.githubusercontent.com/29565014/101116362-ea6f9780-361f-11eb-8457-d598a0859730.png)
Insert:
From Jaeger UI:
![Screenshot from 2020-11-26 17-23-32](https://user-images.githubusercontent.com/29565014/100332315-33b25c80-300c-11eb-9e76-68e0fc8231ec.png)
From Datadog UI:
![Screenshot from 2020-12-04 11-00-08](https://user-images.githubusercontent.com/29565014/101116386-f78c8680-361f-11eb-8892-9e7b3233c446.png)
Release note