-
Notifications
You must be signed in to change notification settings - Fork 435
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
contrib/gorilla/mux: added optional middlewares on mux tracer router #825
Conversation
6ac5e3d
to
90e1635
Compare
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.
Thanks for taking the time to do this. httputil
is much nicer now :)
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.
Really well done. Almost there
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.
Really nice work Diana. Thank you! Let's wait with the merge until we release and unfreeze.
@dianashevchenko can you please rebase this on |
Added middlewares which can be applied to recorder request information as span tags. WithHeaderTags will add request headers(except x-datadog-* prefixed) as span tags and WithQueryParameters will add request query parameters as a single span tag. Fixes #480
Updated docs for the implementation. Renamed struct fields and methods to reflect the functionality better
Refactored code of the TraceAndServe function to use one config parameter, and changed its usage. Added QueryParamTags field that would enable appending query params to the http.url tag. It is currently available only for the gorilla/mux package
Removed sprintf and added doc comment to TraceConfig
5f2e445
to
feebab2
Compare
contrib/gorilla/mux/option.go
Outdated
} | ||
} | ||
|
||
func headerTagsFromRequest(req *http.Request) ddtrace.StartSpanOption { |
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.
Please move this into gorilla/mux/mux.go
where it is used. It's out of place 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.
Thanks!
Added middlewares which can be applied to recorder request information as span tags. WithHeaderTags will add request headers(except x-datadog-* prefixed) as span tags and WithQueryParameters will add request query parameters as a single span tag.
Fixes #480