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
Instrument mp-rest-client #102
Instrument mp-rest-client #102
Conversation
hi @andymc12 could you please look at the linked issues for mp-rest-client? eclipse/microprofile-rest-client#122 Alternative to these two could be a listener similar to |
ec2b58d
to
9c0f8f4
Compare
9c0f8f4
to
27975b9
Compare
@fmhwong @objectiser could you please review? The PR should be in a final form. Once this is merged we could split TCK and locate rest client tests in a separate module for vendors who do not implement rest-client, this however requires creating a shared tck package for some common classes and services e.g. tracer service. I was able to successfully pass TCK with smallrye implementation, the PR to smallrye is linked in the first comment of this PR. |
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.
Only minor comments.
tck/src/main/java/org/eclipse/microprofile/opentracing/tck/application/ClientServices.java
Outdated
Show resolved
Hide resolved
*/ | ||
@Test | ||
@RunAsClient | ||
private void testNestedSpans() { |
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.
Looks like missing the async version of this.
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.
test testMultithreadedNestedSpansAsync
should test it.
...rc/main/java/org/eclipse/microprofile/opentracing/tck/application/TestServerWebServices.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/eclipse/microprofile/opentracing/tck/application/TestServerWebServices.java
Outdated
Show resolved
Hide resolved
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.
LGTM (just some minor comments)
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
823fcd7
to
5cb6916
Compare
In 19.0.0.2 the RestClientBuilder is still not automatically instrumented with opentracing, so the called service does not get the span id, thus cannot be correlated in e.g. zipkin. |
@fachat that's a question for OpenLiberty vs the specification (as I believe that's what the version you mention refers to). It is most definitely resolved in the specification, but it's likely OpenLiberty doesn't implement that version yet |
Resolves #82
The current proposed solution:
All clients are by default traced. Tracing could be disabled via
Traced(false)
on the client interface or method.Issues to address:
How to disable, enable tracing? Tracing could be enabled by default and disabled ifTraced can be applied on interface or method@Traced(false)
is present on the interface or vice-versa. Make interface type available to providers microprofile-rest-client#121Async integration probably would be leaking asdone via AsyncInvocationInterceptorAsyncInvocationInterceptor
https://github.com/eclipse/microprofile-rest-client/blob/master/api/src/main/java/org/eclipse/microprofile/rest/client/ext/AsyncInvocationInterceptor.java#L40 does not have a callback to remove applied context. AsyncInvocationInterceptor does not have remove context callback microprofile-rest-client#122RestClientBuilder
(@Inject @RestClient ServiceInterface
) - not needed the loading of components (interceptors) should be the same as for manually created clientSmallRye implementation smallrye/smallrye-opentracing#28
Other links to blocking issues, mostly for testing (SmallRye):