Skip to content

feat: add more trace span and integrate with jaeger#177

Merged
dk-lockdown merged 6 commits into
CECTC:devfrom
fatelei:tracing
Jul 17, 2022
Merged

feat: add more trace span and integrate with jaeger#177
dk-lockdown merged 6 commits into
CECTC:devfrom
fatelei:tracing

Conversation

@fatelei
Copy link
Copy Markdown
Collaborator

@fatelei fatelei commented Jul 5, 2022

ref: https://github.com/cectc/dbpack/issues/

Ⅰ. Describe what this PR did

  • integrate with jaeger
  • add more trace span

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

jaeger trace result.

image

Ⅴ. Special notes for reviews

@fatelei fatelei changed the title feat: add more trace span and integrate with jaeger Draft: feat: add more trace span and integrate with jaeger Jul 5, 2022
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jul 5, 2022

Codecov Report

Merging #177 (e171f44) into dev (8290190) will decrease coverage by 0.24%.
The diff coverage is 11.46%.

@@            Coverage Diff             @@
##              dev     #177      +/-   ##
==========================================
- Coverage   43.05%   42.80%   -0.25%     
==========================================
  Files          81       81              
  Lines        9483     9554      +71     
==========================================
+ Hits         4083     4090       +7     
- Misses       4994     5058      +64     
  Partials      406      406              
Impacted Files Coverage Δ
pkg/dt/mysql_undo_log_manager.go 0.00% <ø> (ø)
pkg/executor/sharding.go 0.00% <0.00%> (ø)
pkg/filter/dt/exec/prepare_delete.go 46.29% <0.00%> (-3.71%) ⬇️
pkg/filter/dt/exec/prepare_insert.go 30.76% <0.00%> (-1.42%) ⬇️
pkg/filter/dt/exec/prepare_update.go 51.08% <0.00%> (-4.87%) ⬇️
pkg/filter/dt/exec/query_delete.go 51.06% <0.00%> (-4.76%) ⬇️
pkg/filter/dt/exec/query_insert.go 28.72% <0.00%> (-1.28%) ⬇️
pkg/filter/dt/exec/query_update.go 53.84% <0.00%> (-5.19%) ⬇️
pkg/filter/dt/filter_http.go 15.74% <0.00%> (-0.61%) ⬇️
pkg/filter/dt/filter_mysql.go 1.58% <0.00%> (-0.03%) ⬇️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8290190...e171f44. Read the comment docs.

@dk-lockdown
Copy link
Copy Markdown
Collaborator

dk-lockdown commented Jul 5, 2022

To trace the entire lifecycle of a transaction, should start with the http request proxy:

  1. Get the TraceParent from the request header, and if it exists, pass it to the downstream service. Generate a new TraceParent if it does not exist and pass it downstream.
    request.SetHost(l.conf.BackendHost)
  2. Users can put TraceParent into sql hints, dbpack gets TraceParent from sql hints to construct SpanContext, if it does not exist, generate a new SpanContext.

@dk-lockdown dk-lockdown added WIP Work in progess labels Jul 11, 2022
@fatelei fatelei force-pushed the tracing branch 2 times, most recently from 97ae9c3 to c0b314b Compare July 12, 2022 04:47
@fatelei fatelei changed the title Draft: feat: add more trace span and integrate with jaeger feat: add more trace span and integrate with jaeger Jul 12, 2022
Comment thread pkg/listener/http.go Outdated
Comment thread pkg/listener/http.go Outdated
Comment thread pkg/listener/http.go
Comment thread pkg/filter/dt/filter_http.go
Comment thread pkg/filter/dt/transaction.go Outdated
Comment thread pkg/filter/dt/transaction.go Outdated
Comment thread pkg/filter/dt/transaction.go
Comment thread pkg/filter/dt/transaction.go
Comment thread pkg/filter/dt/transaction.go Outdated
Comment thread pkg/filter/dt/transaction.go Outdated
Comment thread pkg/listener/mysql.go Outdated
Comment thread pkg/listener/mysql.go Outdated
Comment thread pkg/filter/dt/filter_mysql_prepare.go Outdated
Comment thread pkg/filter/dt/filter_mysql_prepare.go Outdated
Comment thread pkg/filter/dt/filter_mysql_prepare.go Outdated
Comment thread pkg/filter/dt/filter_mysql_prepare.go
Comment thread pkg/filter/dt/filter_mysql_prepare.go Outdated
Comment thread pkg/filter/dt/filter_mysql_query.go Outdated
Comment thread pkg/filter/dt/filter_mysql_query.go
Comment thread pkg/filter/dt/filter_mysql_query.go Outdated
Comment thread pkg/filter/dt/filter_mysql_query.go Outdated
Comment thread pkg/filter/dt/filter_mysql_query.go Outdated
Comment thread pkg/sql/db.go Outdated
@dk-lockdown
Copy link
Copy Markdown
Collaborator

LGTM

Copy link
Copy Markdown
Collaborator

@bohehe bohehe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dk-lockdown dk-lockdown merged commit d703959 into CECTC:dev Jul 17, 2022
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

WIP Work in progess

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants