-
Notifications
You must be signed in to change notification settings - Fork 154
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
[Ftr] tracing #236
[Ftr] tracing #236
Conversation
pkg/filter/tracing/tracing.go
Outdated
"net/http" | ||
"time" | ||
|
||
"go.opentelemetry.io/otel/trace" |
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.
split it
Codecov Report
@@ Coverage Diff @@
## develop #236 +/- ##
===========================================
- Coverage 40.18% 39.65% -0.54%
===========================================
Files 50 50
Lines 2541 2575 +34
===========================================
Hits 1021 1021
- Misses 1410 1444 +34
Partials 110 110
Continue to review full report at Codecov.
|
|
||
// Do execute tracerFilter filter logic. | ||
func (f TraceFilter) Handle(hc *contexthttp.HttpContext) { | ||
spanName := spanNamePrefix + hc.Request.Method + " " + hc.Request.URL.Path |
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.
一般情况下在网关层spanName直接到method就可以了,不需要把url path作为spanName。这是一个会无限膨胀的字段,会给后期聚合带来非常大的困难。
@@ -60,3 +64,31 @@ func HttpRouteActionMatch(c *HttpContext, ra model.RouteAction) bool { | |||
|
|||
return true | |||
} | |||
|
|||
// ExtractRequestBody extract body of http request | |||
func ExtractRequestBody(req *http.Request) []byte { |
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.
我还是建议不要采集body了,如果这是个上传文件的请求,或是敏感请求,不是很合适
[Ftr] tracing Former-commit-id: 59c6681
[Ftr] tracing
What this PR does:Support jaeger tracing
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: