Skip to content

Commit

Permalink
Merge pull request #192 from newrelic/support/NR-223811-Wildfly
Browse files Browse the repository at this point in the history
NR-223811 : Wildfly Server Configuration Extraction
  • Loading branch information
IshikaDawda authored Mar 6, 2024
2 parents 35bb912 + c898b72 commit cff85e6
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
26 changes: 26 additions & 0 deletions instrumentation-security/wildfly-8/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
dependencies {
implementation(project(":newrelic-security-api"))
implementation("com.newrelic.agent.java:newrelic-api:${nrAPIVersion}")
implementation("com.newrelic.agent.java:newrelic-weaver-api:${nrAPIVersion}")
implementation("org.wildfly:wildfly-undertow:26.1.1.Final") {
exclude(group: "org.jacorb", module: "jacorb")
}
implementation("org.jboss.xnio:xnio-api:3.8.7.Final")
implementation("org.jboss.logging:jboss-logging:3.5.0.Final")
implementation("org.jboss.msc:jboss-msc:1.4.13.Final")
}

jar {
manifest { attributes 'Implementation-Title': 'com.newrelic.instrumentation.security.wildfly-8' }
}

verifyInstrumentation {
passesOnly 'org.wildfly:wildfly-undertow:[8.0.0.Final,)'
excludeRegex '.*(Alpha|Beta|CR).*'
}

site {
title 'Wildfly'
type 'Appserver'
versionOverride '[8.0.0.Final,)'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
*
* * Copyright 2020 New Relic Corporation. All rights reserved.
* * SPDX-License-Identifier: Apache-2.0
*
*/

package org.wildfly.extension.undertow;

import java.io.IOException;
import java.net.InetSocketAddress;

import com.newrelic.api.agent.security.NewRelicSecurity;
import org.xnio.ChannelListener;
import org.xnio.StreamConnection;
import org.xnio.XnioWorker;
import org.xnio.channels.AcceptingChannel;

import com.newrelic.api.agent.weaver.Weave;
import com.newrelic.api.agent.weaver.Weaver;

/*
* The CAT point cut for wildfly had to be pulled out because
* the jar was not getting loaded correctly.
*/
@Weave
public abstract class HttpListenerService {

protected void startListening(XnioWorker worker, InetSocketAddress socketAddress,
ChannelListener<AcceptingChannel<StreamConnection>> acceptListener) throws IOException {

NewRelicSecurity.getAgent().setApplicationConnectionConfig(socketAddress.getPort(), "http");
Weaver.callOriginal();
}

}
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ include 'instrumentation:async-http-client-2.0.0'
include 'instrumentation:sun-net-httpserver'
include 'instrumentation:tomcat-7'
include 'instrumentation:tomcat-8'
include 'instrumentation:wildfly-8'
include 'instrumentation:grpc-1.4.0'
include 'instrumentation:grpc-1.22.0'
include 'instrumentation:grpc-1.40.0'
Expand Down

0 comments on commit cff85e6

Please sign in to comment.