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 Jakarta JSF 3.0+ instrumentation #7786

Merged
merged 11 commits into from
Feb 14, 2023
Merged

Conversation

astappiev
Copy link
Contributor

@astappiev astappiev commented Feb 10, 2023

Hi,

I copied existing JSF 1.2-2 instrumentation, updated dependencies and namespaces related to JSF 3+.
I don't work with Mojjara implementation, but copied by analogy and verified that package names are unchanged.

I named new packages by anology with servlet packages, but I use jsf-jakarta-common when in servlet we have servlet-javax-common.
My idea was to avoid touching existing packages, but perhaps to keep consistency, I can rename old jsf-common to jsf-javax-common.

Tested with Tomcat and my app, it's working fine with JSF 4 :)

@astappiev astappiev requested a review from a team February 10, 2023 16:00
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 10, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: astappiev / name: Oleh Astappiev (f220254)

Copy link
Member

@mateuszrzeszutek mateuszrzeszutek left a comment

Choose a reason for hiding this comment

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

Thanks @astappiev ! Left a couple of minor comments, but overall it LGTM 👍

module.set("jakarta.faces")
versions.set("[3,)")
assertInverse.set(true)
}
Copy link
Member

Choose a reason for hiding this comment

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

Looks like there are several muzzle failures for these two new libraries:


> Task :instrumentation:jsf:jsf-myfaces-3.0:javaagent:muzzle-AssertPass-org.apache.myfaces.core-myfaces-impl-3.0.0 FAILED
FAILED MUZZLE VALIDATION: io.opentelemetry.javaagent.instrumentation.myfaces.v3_0.MyFacesInstrumentationModule mismatches:
-- io.opentelemetry.javaagent.instrumentation.jsf.jakarta.JsfRequest:33 Missing class jakarta.el.MethodExpression
-- io.opentelemetry.javaagent.instrumentation.myfaces.v3_0.MyFacesErrorCauseExtractor:16 Missing class jakarta.el.ELException
-- io.opentelemetry.javaagent.instrumentation.jsf.jakarta.JsfRequest:31 Missing class jakarta.el.MethodExpression

Perhaps you need to add the el-api dep to muzzle:

Suggested change
}
extraDependency("jakarta.el:jakarta.el-api:4.0.0")
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that line seems to be needed 😄

Unfortunately, I don't know how all these dependencies and muzzle are working under the hood, and just trying different things. After we replaced compileOnly with library, lastestDepTests fail. Seems like all the library dependencies are removed (I was expecting it overrides with redefined only).

I thought that muzzle is a kind of condition when the instrumentation should be loaded, and the dependency on faces implementation should be enough. This extra dependency seems redundant, and the el-api theoretically should be included in the jsf-jakarta-common:testing and loaded whenever the package is used, because it's common for myfaces and mojarra. But all my attempts to move it results in failed tests.

@trask trask added this to the v1.23.0 milestone Feb 14, 2023
@trask trask merged commit ae6350b into open-telemetry:main Feb 14, 2023
@trask
Copy link
Member

trask commented Feb 14, 2023

thx @astappiev!

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.

4 participants