Skip to content

Commit

Permalink
CUST-110209: remove joboe logging from SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
cleverchuk committed Aug 20, 2024
1 parent 2dacba9 commit 09ebd56
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 4 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,22 @@ jobs:
env:
SW_APM_SERVICE_KEY: ${{ secrets.SW_APM_SERVICE_KEY }}:smoke-test-linux

smoke-test-sdk-no-agent:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Run application
working-directory: smoke-tests
run: |
./gradlew :sdk-test-no-agent:run
smoke-test-windows:
runs-on: windows-latest
needs:
Expand Down
45 changes: 45 additions & 0 deletions smoke-tests/sdk-test-no-agent/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* © SolarWinds Worldwide, LLC. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

plugins {
java
application
}

group = "com.solarwinds"
version = "unspecified"

repositories {
mavenCentral()
}

dependencies {
implementation("io.netty:netty-common:4.1.94.Final")
implementation("io.github.appoptics:solarwinds-otel-sdk:2.5.0")
testImplementation(platform("org.junit:junit-bom:5.9.1"))
testImplementation("org.junit.jupiter:junit-jupiter")
}

tasks.test {
useJUnitPlatform()
}


application {
mainClass.set("com.solarwinds.netty.NettyApp")
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* © SolarWinds Worldwide, LLC. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.solarwinds.netty;

import io.netty.util.NetUtil;
import com.solarwinds.api.ext.SolarwindsAgent

import java.util.concurrent.TimeUnit;

public class NettyApp {
public static void main(String[] args) {
SolarwindsAgent.setTransactionName("hello world")
System.out.printf("Number of interfaces: %d%n", NetUtil.NETWORK_INTERFACES.size());
try {
TimeUnit.MINUTES.sleep(1);
} catch (InterruptedException ignore) {

}
System.out.printf("Shutting down%n");
}
}
1 change: 1 addition & 0 deletions smoke-tests/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ rootProject.name = 'smoke-tests'

include 'netty-test'
include 'spring-boot-webmvc'
include 'sdk-test-no-agent'

Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@

package com.solarwinds.api.ext;

import com.solarwinds.joboe.logging.Logger;
import com.solarwinds.joboe.logging.LoggerFactory;
import com.solarwinds.opentelemetry.core.AgentState;
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;

public class SolarwindsAgent {
private SolarwindsAgent() {}

private static final Logger logger = LoggerFactory.getLogger();
private static final Logger logger = Logger.getLogger(SolarwindsAgent.class.getName());

private static boolean agentAttached = false;

Expand All @@ -35,7 +34,7 @@ private SolarwindsAgent() {}
agentAttached = true;

} catch (ClassNotFoundException | NoClassDefFoundError | NoSuchMethodError e) {
logger.warn("The SolarWinds APM Agent is not available. The SDK will be no-op.");
logger.warning("The SolarWinds APM Agent is not available. The SDK will be no-op.");
}
}

Expand Down

0 comments on commit 09ebd56

Please sign in to comment.