-
Notifications
You must be signed in to change notification settings - Fork 352
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
Add support for tokio tracing for actix Service. #86
Conversation
Codecov Report
@@ Coverage Diff @@
## master #86 +/- ##
==========================================
+ Coverage 58.38% 58.64% +0.25%
==========================================
Files 75 76 +1
Lines 4881 4967 +86
==========================================
+ Hits 2850 2913 +63
- Misses 2031 2054 +23
Continue to review full report at Codecov.
|
I'm not sure this should be in actix-net, not third-party crate. CC @fafhrd91 |
I asked Raj to add it to actix-net |
actix-tracing/src/lib.rs
Outdated
/// Creates a new span for the given request value. | ||
/// | ||
/// By default, this function returns `None`. | ||
fn span_for(&self, _req: &T) -> Option<tracing::Span> { |
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.
should be required method, no reason for default impl
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.
Agree.
actix-tracing/src/lib.rs
Outdated
pub fn trace<S, U, T>( | ||
service_factory: U, | ||
make_span: T, | ||
) -> impl ServiceFactory< |
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.
it won't be possible to use +Clone
with impl Trait
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.
Not sure I understand this. I was able to add a Clone
bound on the Fn
.
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.
Resulted factory wouldn’t have clone even if input service factory would have clone
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.
Let’s return ApplyTransform
type instead of impl ServiceFactory
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.
Changed the return type to ApplyTransform
.
Still don't understand the Clone
comment. The Clone
bound is on the closure and not on the factory returned from 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.
but if you want to make clonable service factory, it would be not possible with impl Trait
thanks! |
Any documentation yet for using this with |
No description provided.