Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

NR-223811 : Wildfly Server Configuration Extraction #192

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading