Skip to content
Open
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
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ jobs:
upload_file_to_release "$release_id" "checksum.txt"

upload_file_to_release "$release_id" "agent/build/libs/solarwinds-apm-agent.jar"
upload_file_to_release "$release_id" "custom/shared/src/main/resources/solarwinds-apm-config.json"
upload_file_to_release "$release_id" "libs/shared/src/main/resources/solarwinds-apm-config.json"

source /ci-scripts/bin/helpers.sh
send_to_slack "A new release is ready \`$VERSION\`"
Expand Down Expand Up @@ -426,7 +426,7 @@ jobs:
s3://ssp-stage-global-agent-binaries/apm/java/$AGENTVERSION/solarwinds-apm-agent-lambda.jar \
--acl public-read

aws s3 cp custom/shared/src/main/resources/solarwinds-apm-config.json \
aws s3 cp libs/shared/src/main/resources/solarwinds-apm-config.json \
s3://ssp-stage-global-agent-binaries/apm/java/$AGENTVERSION/solarwinds-apm-config.json \
--acl public-read
- run:
Expand Down Expand Up @@ -480,7 +480,7 @@ jobs:
s3://ssp-prod-global-agent-binaries/apm/java/$AGENTVERSION/solarwinds-apm-agent.jar \
--acl public-read

aws s3 cp custom/shared/src/main/resources/solarwinds-apm-config.json \
aws s3 cp libs/shared/src/main/resources/solarwinds-apm-config.json \
s3://ssp-prod-global-agent-binaries/apm/java/$AGENTVERSION/solarwinds-apm-config.json \
--acl public-read
- run:
Expand Down
5 changes: 3 additions & 2 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ This is a **multi-module Gradle project** with the following architecture:
- **agent-lambda/** - Lambda-specific agent (exports via OTLP)
- **bootstrap/** - Bootstrap classes loaded early in JVM lifecycle
- **custom/** - Custom SolarWinds extensions and configurations
- `custom/shared/` - Shared code between agent and agent-lambda
- `custom/lambda/` - Lambda-specific extensions
- **libs/** - Custom SolarWinds libraries
- `libs/shared/` - Shared code between agent and agent-lambda
- `libs/lambda/` - Lambda-specific extensions
- **instrumentation/** - Custom instrumentation modules
- `jdbc/` - JDBC instrumentation
- `spring-webmvc/` - Spring WebMVC instrumentation
Expand Down
16 changes: 1 addition & 15 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
s3://$STAGE_BUCKET/apm/java/$AGENT_VERSION/solarwinds-apm-agent-lambda.jar \
--acl public-read

aws s3 cp custom/shared/src/main/resources/solarwinds-apm-config.json \
aws s3 cp libs/shared/src/main/resources/solarwinds-apm-config.json \
s3://$STAGE_BUCKET/apm/java/$AGENT_VERSION/solarwinds-apm-config.json \
--acl public-read
env:
Expand Down Expand Up @@ -124,8 +124,6 @@ jobs:
platforms: linux/amd64
push: true
tags: "ghcr.io/${{github.repository_owner}}/xk6:latest"
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build rc image
uses: docker/build-push-action@v6
Expand All @@ -135,8 +133,6 @@ jobs:
platforms: linux/amd64
push: true
tags: "ghcr.io/${{github.repository_owner}}/petclinic:agent-rc"
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build stable image
uses: docker/build-push-action@v6
Expand All @@ -145,8 +141,6 @@ jobs:
platforms: linux/amd64
push: true
tags: "ghcr.io/${{github.repository_owner}}/petclinic:agent-latest"
cache-from: type=gha
cache-to: type=gha,mode=max

test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -253,12 +247,6 @@ jobs:
cd smoke-tests
./gradlew test

- uses: actions/upload-artifact@v6
if: always()
with:
path: smoke-tests/build/reports/tests/test
name: lambda-release-test

- name: Free Disk Space After Build
run: |
echo "Disk space before post-build cleanup:"
Expand Down Expand Up @@ -650,8 +638,6 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
load: true
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Login to Docker Hub
uses: docker/login-action@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
/tmp/version.txt \
/tmp/checksum.txt \
agent/build/libs/solarwinds-apm-agent.jar \
custom/shared/src/main/resources/solarwinds-apm-config.json
libs/shared/src/main/resources/solarwinds-apm-config.json

s3-prod-upload: # this job uploads the jar and default config json to prod s3
if: inputs.run_s3_upload
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
s3://$PROD_BUCKET/apm/java/$AGENT_VERSION/solarwinds-apm-agent.jar \
--acl public-read

aws s3 cp custom/shared/src/main/resources/solarwinds-apm-config.json \
aws s3 cp libs/shared/src/main/resources/solarwinds-apm-config.json \
s3://$PROD_BUCKET/apm/java/$AGENT_VERSION/solarwinds-apm-config.json \
--acl public-read
env:
Expand Down
5 changes: 3 additions & 2 deletions agent-lambda/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

plugins {
id("signing")
id("solarwinds.java-conventions")
id("solarwinds.shadow-conventions")
}

Expand All @@ -41,8 +42,8 @@ val upstreamAgent: Configuration by configurations.creating {
}

dependencies {
javaagentLibs(project(":custom:lambda"))
javaagentLibs(project(":custom:shared"))
javaagentLibs(project(":libs:lambda"))
javaagentLibs(project(":libs:shared"))
javaagentLibs(project(":instrumentation"))

bootstrapLibs(project(":bootstrap"))
Expand Down
3 changes: 2 additions & 1 deletion agent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

plugins {
id("signing")
id("solarwinds.java-conventions")
id("solarwinds.shadow-conventions")
}

Expand All @@ -42,7 +43,7 @@ val upstreamAgent: Configuration by configurations.creating {

dependencies {
javaagentLibs(project(":custom"))
javaagentLibs(project(":custom:shared"))
javaagentLibs(project(":libs:shared"))
javaagentLibs(project(":instrumentation"))

bootstrapLibs(project(":bootstrap"))
Expand Down
5 changes: 3 additions & 2 deletions benchmark/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ repositories {

dependencies {
implementation(enforcedPlatform("org.junit:junit-bom:5.10.3"))
implementation(enforcedPlatform("org.testcontainers:testcontainers-bom:2.0.3"))

testImplementation("org.testcontainers:testcontainers:1.19.8")
testImplementation("org.testcontainers:postgresql:1.19.8")
testImplementation("org.testcontainers:testcontainers")
testImplementation("org.testcontainers:testcontainers-postgresql")
testImplementation("org.junit.jupiter:junit-jupiter-api")
testImplementation("org.junit.jupiter:junit-jupiter-params")
testImplementation("com.squareup.okhttp3:okhttp:4.12.0")
Expand Down
4 changes: 4 additions & 0 deletions bootstrap/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
plugins {
id("solarwinds.java-conventions")
}

dependencies {
compileOnly("com.solarwinds.joboe:config")
compileOnly("com.solarwinds.joboe:logging")
Expand Down
7 changes: 0 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ extra["swoAgentVersion"] = swoAgentVersion
group = "com.solarwinds"
version = if (System.getenv("SNAPSHOT_BUILD").toBoolean()) "$swoAgentVersion-SNAPSHOT" else swoAgentVersion

subprojects {
if (this.name != "dependencyManagement") {
apply(plugin = "solarwinds.spotless-conventions")
apply(plugin = "solarwinds.java-conventions")
}
}

allprojects {
plugins.withId("java"){
val cleanListedDependencies by tasks.registering {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ plugins {
id("io.opentelemetry.instrumentation.muzzle-check")
}

if (projectDir.name == "javaagent") {
base.archivesName.set(projectDir.parentFile.name)
}

evaluationDependsOn(":testing:agent-for-testing")
dependencies {
compileOnly("io.opentelemetry:opentelemetry-sdk")
Expand Down Expand Up @@ -94,7 +98,7 @@ tasks.withType<Test>().configureEach {
}

tasks.register("generateInstrumentationVersionFile") {
val name = "com.solarwinds.${project.name}"
val name = "com.solarwinds.${computeInstrumentationName()}"
val version = rootProject.version.toString()
inputs.property("instrumentation.name", name)

Expand All @@ -114,6 +118,13 @@ sourceSets {
}
}

fun computeInstrumentationName(): String {
return when (projectDir.name) {
"javaagent" -> projectDir.parentFile.name
else -> project.name
}
}

class JavaagentProvider(
@InputFile
@PathSensitive(PathSensitivity.RELATIVE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import com.solarwinds.instrumentation.gradle.SolarwindsJavaExtension
plugins {
java
checkstyle
id("solarwinds.spotless-conventions")
}

repositories {
Expand Down
8 changes: 6 additions & 2 deletions custom/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@
* limitations under the License.
*/

plugins {
id("solarwinds.java-conventions")
}

dependencies {
compileOnly(project(":bootstrap"))
compileOnly(project(":custom:shared"))
compileOnly(project(":libs:shared"))
compileOnly("com.solarwinds.joboe:core")

compileOnly("org.projectlombok:lombok")
Expand All @@ -39,7 +43,7 @@ dependencies {
compileOnly("io.opentelemetry:opentelemetry-sdk-extension-incubator")
compileOnly("io.opentelemetry:opentelemetry-exporter-otlp")

testImplementation(project(":custom:shared"))
testImplementation(project(":libs:shared"))
testImplementation("org.json:json")
testImplementation("com.solarwinds.joboe:core")

Expand Down
5 changes: 5 additions & 0 deletions instrumentation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

plugins {
id("solarwinds.java-conventions")
}

val instrumentationProject = project
subprojects {
afterEvaluate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,25 @@ dependencies {
compileOnly("io.opentelemetry.semconv:opentelemetry-semconv")
compileOnly("com.github.ben-manes.caffeine:caffeine")

testImplementation(project(":instrumentation:jdbc"))
testImplementation(project(":instrumentation:jdbc:javaagent"))
testImplementation(project(":instrumentation:instrumentation-shared"))
testImplementation(platform("org.testcontainers:testcontainers-bom:1.20.4"))
testImplementation(platform("org.testcontainers:testcontainers-bom:2.0.3"))

testImplementation("org.testcontainers:mysql")
testImplementation("org.testcontainers:junit-jupiter")
testImplementation("com.mysql:mysql-connector-j:9.2.0")
testImplementation("org.testcontainers:testcontainers-mysql")
testImplementation("org.testcontainers:testcontainers-junit-jupiter")
testImplementation("com.mysql:mysql-connector-j:9.5.0")
}

tasks.withType<JavaCompile>().configureEach {
dependsOn(":instrumentation:instrumentation-shared:byteBuddyJava")
with(options) {
val args = mutableListOf<String>()
args.addAll(options.compilerArgs)

// remove -Werror added by solarwinds.java-conventions because of deprecation that's a false positive in this case
args.remove("-Werror")
compilerArgs = args
}
}

swoJava {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,19 @@
import org.testcontainers.containers.MySQLContainer;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
import org.testcontainers.utility.DockerImageName;

@Testcontainers
@SuppressWarnings("all")
@ExtendWith(MockitoExtension.class)
class JdbcInstrumentationTest {

@RegisterExtension
private static final AgentInstrumentationExtension testing =
AgentInstrumentationExtension.create();

@Container public MySQLContainer<?> mysql = new MySQLContainer<>("mysql:9.2.0");
@Container
public MySQLContainer<?> mysql = new MySQLContainer<>(DockerImageName.parse("mysql:9.2.0"));

private Connection connection;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@
* limitations under the License.
*/

plugins {
id("solarwinds.java-conventions")
}

dependencies {
compileOnly(project(":custom:shared"))
compileOnly(project(":libs:shared"))
compileOnly("com.google.code.gson:gson")
compileOnly("org.projectlombok:lombok")

Expand All @@ -36,7 +40,7 @@ dependencies {
compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-extension-api")

compileOnly(project(":bootstrap"))
testImplementation(project(":custom:shared"))
testImplementation(project(":libs:shared"))
}

swoJava {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ import java.time.format.DateTimeFormatter
* limitations under the License.
*/

plugins {
id("solarwinds.java-conventions")
}

dependencies {
compileOnly(project(":bootstrap"))
compileOnly("org.projectlombok:lombok")
Expand Down
15 changes: 7 additions & 8 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,16 @@ include("agent")
include("solarwinds-otel-sdk")
include("bootstrap")
include("custom")
include("custom:lambda")
include("custom:shared")
include("libs:lambda")
include("libs:shared")
include("agent-lambda")
include("instrumentation")
include("instrumentation:jdbc")
include("instrumentation:spring-webmvc:spring-webmvc-3.1")
include("instrumentation:spring-webmvc:spring-webmvc-6")
include("instrumentation:spring-webmvc")
include("instrumentation:jdbc:javaagent")
include("instrumentation:spring-webmvc:spring-webmvc-3.1:javaagent")
include("instrumentation:spring-webmvc:spring-webmvc-6:javaagent")
include("instrumentation:hibernate:hibernate-shared")
include("instrumentation:hibernate:hibernate-6.0")
include("instrumentation:hibernate:hibernate-4.0")
include("instrumentation:hibernate:hibernate-6.0:javaagent")
include("instrumentation:hibernate:hibernate-4.0:javaagent")
include("instrumentation:instrumentation-shared")
include("testing")
include("testing:agent-for-testing")
Expand Down
2 changes: 1 addition & 1 deletion smoke-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ repositories {
}

dependencies {
testImplementation platform("org.testcontainers:testcontainers-bom:2.0.2")
testImplementation platform("org.testcontainers:testcontainers-bom:2.0.3")
testImplementation("org.testcontainers:testcontainers")
testImplementation platform('org.junit:junit-bom:5.9.1')
testImplementation 'org.junit.jupiter:junit-jupiter'
Expand Down
1 change: 0 additions & 1 deletion smoke-tests/src/test/java/com/solarwinds/LambdaTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ static void runAppOnce(Agent agent) throws Exception {

GenericContainer<?> k6 = new K6Container(NETWORK, agent, namingConventions).build();
k6.start();
k6.followOutput(new Slf4jLogConsumer(LoggerFactory.getLogger("k6")));

petClinic.execInContainer("kill", "1");
webMvc.execInContainer("kill", "1");
Expand Down
1 change: 0 additions & 1 deletion smoke-tests/src/test/java/com/solarwinds/SmokeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ static void runAppOnce(Agent agent) throws Exception {

GenericContainer<?> k6 = new K6Container(NETWORK, agent, namingConventions).build();
k6.start();
k6.followOutput(new Slf4jLogConsumer(LoggerFactory.getLogger("k6")), OutputFrame.OutputType.STDOUT);

petClinic.execInContainer("kill", "1");
webMvc.execInContainer("kill", "1");
Expand Down
Loading
Loading