Skip to content

Commit

Permalink
Close out MWTELE-108 (#26)
Browse files Browse the repository at this point in the history
* Workaround lack of dynamic level change in SimpleLogger. Only sm0l crimes committed.

* Do what we can for JWS

* Bump version number, prepare for RC1
  • Loading branch information
kittylyst authored Feb 16, 2024
1 parent 588a23e commit ffdf32a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 4 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.redhat.insights</groupId>
<artifactId>runtimes-agent</artifactId>
<version>0.9.3-SNAPSHOT</version>
<version>0.9.5-SNAPSHOT</version>

<name>Red Hat Insights Java Agent</name>
<description>Red Hat Insights Java Agent</description>
Expand Down Expand Up @@ -370,6 +370,9 @@
<relocation>
<pattern>org.apache</pattern>
<shadedPattern>${shade.prefix}.org.apache</shadedPattern>
<excludes>
<exclude>org.apache.catalina.**</exclude>
</excludes>
</relocation>
<relocation>
<pattern>org.slf4j</pattern>
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/com/redhat/insights/agent/AgentSubreport.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class AgentSubreport implements InsightsSubreport {
activeGuesses.put("org.jboss.modules.Module", AgentSubreport::fingerprintJBoss);
activeGuesses.put(
"io.quarkus.bootstrap.runner.QuarkusEntryPoint", AgentSubreport::fingerprintQuarkus);
activeGuesses.put("org.apache.catalina.Server", AgentSubreport::fingerprintTomcat);
activeGuesses.put("org.apache.catalina.startup.Bootstrap", AgentSubreport::fingerprintTomcat);
}

private AgentSubreport(ClasspathJarInfoSubreport jarsReport) {
Expand Down Expand Up @@ -80,10 +80,14 @@ private void fingerprintReflectively(Collection<JarInfo> jarInfos) {
}
}

static String fingerprintTomcat(Class<?> qClazz) {
// We can't reflectively call org.apache.catalina.util.ServerInfo.getServerNumber() for more info
// as this class is not included in minimal installs of JWS
static String fingerprintTomcat(Class<?> __) {
// We recommend, but don't mandate, the use of Vault in JWS so we can't use it as a definitive
// fingerprint
try {
Class.forName("org.apache.tomcat.vault.VaultInteraction");
} catch (ClassNotFoundException __) {
} catch (ClassNotFoundException _x) {
return "Tomcat";
}
return "JWS";
Expand Down

0 comments on commit ffdf32a

Please sign in to comment.