Skip to content

Conversation

@felixbarny
Copy link
Member

@felixbarny felixbarny commented Feb 11, 2019

closes #332

@codecov-io
Copy link

codecov-io commented Feb 11, 2019

Codecov Report

Merging #486 into master will increase coverage by 5.09%.
The diff coverage is 73.68%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #486      +/-   ##
============================================
+ Coverage     64.39%   69.48%   +5.09%     
- Complexity       68     1414    +1346     
============================================
  Files           165      156       -9     
  Lines          6235     5755     -480     
  Branches        719      614     -105     
============================================
- Hits           4015     3999      -16     
+ Misses         1974     1510     -464     
  Partials        246      246
Impacted Files Coverage Δ Complexity Δ
...ent/jaxrs/JaxRsTransactionNameInstrumentation.java 79.16% <100%> (-0.25%) 7 <1> (+7)
...ent/jaxws/JaxWsTransactionNameInstrumentation.java 72.22% <72.22%> (-2.78%) 7 <7> (+7)
...tracing/impl/OpenTracingBridgeInstrumentation.java
...gent/opentracing/impl/ApmScopeInstrumentation.java
...t/v5_6/ElasticsearchRestClientInstrumentation.java
...t/opentracing/impl/SpanContextInstrumentation.java
...t/v6_4/ElasticsearchRestClientInstrumentation.java
...pentracing/impl/ApmSpanBuilderInstrumentation.java
...tic/apm/agent/jsf/JsfLifecycleInstrumentation.java
...agent/opentracing/impl/ApmSpanInstrumentation.java
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 551e642...506c4b8. Read the comment docs.

public ElementMatcher<? super NamedElement> getTypeMatcherPreFilter() {
// setting application_packages makes this matcher more performant but is not required
// could lead to false negative matches when importing a 3rd party library whose JAX-WS resources are exposed
return isInAnyPackage(applicationPackages, ElementMatchers.<NamedElement>any());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this false negative interesting? I assume mostly it would be application code, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this would only be an edge case. I expect that mostly, the JAX-WS resources are inside of the application. If they're not, then they can just add the 3rd party packages as well.


@Override
public Collection<String> getInstrumentationGroupNames() {
return Arrays.asList("jax-ws", "jax-ws-annotations");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why both? It would make sense if we want to disable annotation-based instrumentation in general and then have annotations both here and in jax-rs, but this just seems like a duplication

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did it mainly to do it in a similar way to the JAX-RS instrumentation. I think my initial intention was to have another category for the client instrumentation. But we ended up not instrumenting the JAX-RS client, so it's kind of useless as it is right now. I'll remove the jax-*-annotations category. We can always re-add them later if needed.

if (tracer != null) {
final Transaction transaction = tracer.currentTransaction();
if (transaction != null && transaction.getName().length() == 0) {
transaction.withName(signature);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SOAP clients calls will not be captured?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not about capturing SOAP calls, it's just about naming SOAP transactions

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant- would this instrumentation be executed for SOAP client invocations, thus changing the wrong transaction names, or the annotation in the type matching eliminates that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's actually a good question. I think it works because the stub created for the WS request does not contain the annotations.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test I suggested would verify that

import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;

import static org.assertj.core.api.Java6Assertions.assertThat;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ask my IDE 😄
But seriously, good catch 👍

assertThat(response.body().string()).isNotEmpty();

final List<JsonNode> reportedTransactions = test.getReportedTransactions();
assertThat(reportedTransactions.stream().map(node -> node.get("name").textValue())).contains("HelloWorldServiceImpl#sayHello");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Full test should be:

  • First transaction is HelloWorldServiceImpl#sayHello
  • second transaction is the SOAP client servlet one
  • the client span is reported

And even though tested within the app, for clarity I would test that both transactions have the same trace ID

@eyalkoren
Copy link
Contributor

Also - update changelog

@felixbarny felixbarny merged commit 5258956 into elastic:master Feb 13, 2019
@felixbarny felixbarny deleted the jax-ws branch February 13, 2019 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support SOAP

4 participants