Skip to content
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 instrumentation for jax-ws frameworks #2314

Merged
merged 5 commits into from Feb 22, 2021

Conversation

laurit
Copy link
Contributor

@laurit laurit commented Feb 17, 2021

Adds instrumentation for cxf, metro and axis2 jax-ws frameworks. Currently instrumentation only creates a span for web service invocations and updates server span name.
There is already an instrumentation that creates spans for jax-ws methods based on annotations. I believe it is slightly flawed as it is not able to identify all webservice methods and also identifies some methods as webservice methods although they are not.

@mateuszrzeszutek
Copy link
Member

Can you split this PR? Reviewing almost 2k lines at once won't be easy

@laurit
Copy link
Contributor Author

laurit commented Feb 17, 2021

@mateuszrzeszutek It really isn't that bad, there is a 500 line xml configuration file for axis, 6 .gradle files, some tests files, the amount of actual code isn't that much + it is the same thing for 3 frameworks and it is in new files which should make it easier to review.

@mateuszrzeszutek
Copy link
Member

Okay, I'll take a look at it tomorrow then.

@laurit
Copy link
Contributor Author

laurit commented Feb 17, 2021

@mateuszrzeszutek thanks

group = "org.apache.axis2"
module = "axis2-jaxws"
versions = "[1.6.0,)"
assertInverse
Copy link
Member

Choose a reason for hiding this comment

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

Nice, I didn't know it works without = true

Copy link
Contributor

Choose a reason for hiding this comment

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

Does it actually?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it wasn't intentional, so might not really work

Copy link
Member

Choose a reason for hiding this comment

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

🤔
Can you verify that it works?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It doesn't

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should be fixed now

dependencies {
implementation project(':instrumentation:jaxws:jaxws-2.0-cxf-3.0:library')

api group: 'javax.xml.ws', name: 'jaxws-api', version: '2.3.1'
Copy link
Member

Choose a reason for hiding this comment

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

Won't using api include this lib in the javaagent? Consider using compileOnly + testImplementation instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

testInstrumentation project(':instrumentation:servlet:servlet-3.0:javaagent')
testInstrumentation project(':instrumentation:jetty-8.0:javaagent')

latestDepTestLibrary group: 'com.sun.xml.ws', name: 'jaxws-rt', version: '2+'
Copy link
Member

Choose a reason for hiding this comment

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

If tests don't work for [3,) shouldn't we add a limit in muzzle too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added classLoaderMatcher

}

public void end(Packet packet, Throwable throwable) {
Scope scope = (Scope) packet.get(TracingPropertySet.SCOPE_KEY);
Copy link
Member

Choose a reason for hiding this comment

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

Properties are not removed from the packet (unlike other JAX-WS instrumentations), is that okay?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For axis and cxf I removed the properties to ensure that we won't end up closing the same span twice in case these interceptors are called twice for whatever reason. On metro these properties can not be removed, remove method exists, but calling it will complain that the property is read only. I guess if needed I could add a property with mutable value that could track whether end has already been called.

laurit and others added 3 commits February 22, 2021 12:38
…a/io/opentelemetry/instrumentation/axis2/Axis2JaxWsTracer.java

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
@iNikem iNikem merged commit 4c49932 into open-telemetry:main Feb 22, 2021
@laurit laurit deleted the jaxws-frameworks branch March 5, 2021 10:24
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.

None yet

3 participants