-
Notifications
You must be signed in to change notification settings - Fork 537
HDDS-3130. Add jaeger trace span in s3gateway #645
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
Conversation
@elek Could you help review this patch ? Thank you very much. |
Thank you very much the idea and the patch @runzhiwang I 100% support to introduce tracing for s3g. It's a very good idea. About the implementation: It's definitely a step forward but I started to think how is it possible to do in a transparent way without duplication. I check if the resource name is available from some generic filter and it seems to be possible. My proposal is to do it from a central place, something like this: @Provider
public class TracingFilter implements ContainerRequestFilter,
ContainerResponseFilter {
public static final String TRACING_SCOPE = "TRACING_SCOPE";
@Context
private ResourceInfo resourceInfo;
@Override
public void filter(ContainerRequestContext requestContext)
throws IOException {
Scope scope = GlobalTracer.get().buildSpan(
resourceInfo.getResourceClass().getSimpleName() + "." + resourceInfo
.getResourceMethod().getName()).startActive(true);
requestContext.setProperty(TRACING_SCOPE, scope);
}
@Override
public void filter(ContainerRequestContext requestContext,
ContainerResponseContext responseContext) throws IOException {
Object scope = requestContext.getProperty(TRACING_SCOPE);
if (scope != null) {
((Scope) scope).span().finish();
}
}
} What do you think? I think it would simplify this patch (you don't need to modify all the methods...) |
@elek Very reasonable suggestion. I will try it, thank you very much. |
841d645
to
b34adaa
Compare
c24a897
to
79f94d8
Compare
@elek Hi, I have updated PR according to you suggestion, thank you very much. Additionally, if throw exception when execute request, the method |
4bb16cb
to
18842fd
Compare
The CI failure has nothing to do with this PR. |
@elek CI passed. |
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.
+1 Thanks the update @runzhiwang
Tested and worked well. Will merge it soon.
What changes were proposed in this pull request?
Add jaeger trace span in s3gateway.
What is the link to the Apache JIRA
https://jira.apache.org/jira/browse/HDDS-3130
How was this patch tested?
The jaeger UI shows the right trace information.
