Skip to content

Commit

Permalink
Update patch.
Browse files Browse the repository at this point in the history
  • Loading branch information
zzhlogin committed Dec 17, 2024
1 parent ab5ee9a commit 26283ef
Show file tree
Hide file tree
Showing 21 changed files with 180 additions and 244 deletions.
185 changes: 92 additions & 93 deletions .github/patches/opentelemetry-java-instrumentation.patch

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions .github/workflows/application-signals-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:

default-v8-amd64:
needs: [ upload-main-build ]
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-ec2-default-test.yml@main
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-ec2-default-test.yml@adot-java-v2
secrets: inherit
with:
aws-region: us-east-1
Expand All @@ -55,7 +55,7 @@ jobs:

default-v11-amd64:
needs: [ upload-main-build ]
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-ec2-default-test.yml@main
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-ec2-default-test.yml@adot-java-v2
secrets: inherit
with:
aws-region: us-east-1
Expand All @@ -65,7 +65,7 @@ jobs:

default-v17-amd64:
needs: [ upload-main-build ]
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-ec2-default-test.yml@main
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-ec2-default-test.yml@adot-java-v2
secrets: inherit
with:
aws-region: us-east-1
Expand All @@ -75,7 +75,7 @@ jobs:

default-v21-amd64:
needs: [ upload-main-build ]
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-ec2-default-test.yml@main
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-ec2-default-test.yml@adot-java-v2
secrets: inherit
with:
aws-region: us-east-1
Expand All @@ -85,7 +85,7 @@ jobs:

default-v22-amd64:
needs: [ upload-main-build ]
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-ec2-default-test.yml@main
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-ec2-default-test.yml@adot-java-v2
secrets: inherit
with:
aws-region: us-east-1
Expand All @@ -99,7 +99,7 @@ jobs:
#

eks-v8-amd64:
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-eks-test.yml@main
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-eks-test.yml@adot-java-v2
secrets: inherit
with:
aws-region: us-east-1
Expand All @@ -110,7 +110,7 @@ jobs:

eks-v11-amd64:
needs: eks-v8-amd64
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-eks-test.yml@main
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-eks-test.yml@adot-java-v2
secrets: inherit
with:
aws-region: us-east-1
Expand All @@ -121,7 +121,7 @@ jobs:

eks-v17-amd64:
needs: eks-v11-amd64
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-eks-test.yml@main
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-eks-test.yml@adot-java-v2
secrets: inherit
with:
aws-region: us-east-1
Expand All @@ -132,7 +132,7 @@ jobs:

eks-v21-amd64:
needs: eks-v17-amd64
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-eks-test.yml@main
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-eks-test.yml@adot-java-v2
secrets: inherit
with:
aws-region: us-east-1
Expand All @@ -143,7 +143,7 @@ jobs:

eks-v22-amd64:
needs: eks-v21-amd64
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-eks-test.yml@main
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-eks-test.yml@adot-java-v2
secrets: inherit
with:
aws-region: us-east-1
Expand All @@ -159,7 +159,7 @@ jobs:

asg-v11-amd64:
needs: [ upload-main-build ]
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-ec2-asg-test.yml@main
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-ec2-asg-test.yml@adot-java-v2
secrets: inherit
with:
aws-region: us-east-1
Expand All @@ -172,7 +172,7 @@ jobs:
#

k8s-v11-amd64:
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-k8s-test.yml@main
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-k8s-test.yml@adot-java-v2
secrets: inherit
with:
aws-region: us-east-1
Expand All @@ -182,7 +182,7 @@ jobs:


ecs-v11-amd64:
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-ecs-test.yml@main
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-ecs-test.yml@adot-java-v2
secrets: inherit
with:
aws-region: us-east-1
Expand All @@ -197,7 +197,7 @@ jobs:

default-v11-arm64:
needs: [ upload-main-build ]
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-ec2-default-test.yml@main
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/java-ec2-default-test.yml@adot-java-v2
secrets: inherit
with:
aws-region: us-east-1
Expand All @@ -211,7 +211,7 @@ jobs:

metric-limiter-v11-amd64:
needs: [ eks-v22-amd64 ]
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/metric-limiter-test.yml@main
uses: aws-observability/aws-application-signals-test-framework/.github/workflows/metric-limiter-test.yml@adot-java-v2
secrets: inherit
with:
aws-region: us-east-1
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/docker-build-smoke-tests-fake-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ jobs:
with:
java-version: 17
distribution: 'temurin'
# cache local patch outputs
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: |
~/.m2/repository/io/opentelemetry/
key: ${{ runner.os }}-maven-local-${{ hashFiles('.github/patches/opentelemetry-java*.patch') }}

- name: Publish patched dependencies to maven local
uses: ./.github/actions/patch-dependencies
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_password: ${{ secrets.GPG_PASSPHRASE }}
- uses: gradle/wrapper-validation-action@v1
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/nightly-upstream-snapshot-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ jobs:
java-version: 17
distribution: 'temurin'

# cache local patch outputs
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: |
~/.m2/repository/io/opentelemetry/
key: ${{ runner.os }}-maven-local-${{ hashFiles('.github/patches/opentelemetry-java*.patch') }}

- name: Publish patched dependencies to maven local
uses: ./.github/actions/patch-dependencies
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_password: ${{ secrets.GPG_PASSPHRASE }}

- uses: gradle/wrapper-validation-action@v1

- name: Configure AWS Credentials
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/patch-release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

env:
AWS_DEFAULT_REGION: us-east-1
TEST_TAG: public.ecr.aws/aws-observability/adot-autoinstrumentation-java:test
TEST_TAG: public.ecr.aws/aws-observability/adot-autoinstrumentation-java:test-v2

permissions:
id-token: write
Expand Down
21 changes: 20 additions & 1 deletion .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- main
- "release/v*"
env:
TEST_TAG: public.ecr.aws/aws-observability/adot-autoinstrumentation-java:test
TEST_TAG: public.ecr.aws/aws-observability/adot-autoinstrumentation-java:test-v2

jobs:
testpatch:
Expand Down Expand Up @@ -63,6 +63,21 @@ jobs:

- uses: gradle/wrapper-validation-action@v1

# Check disk usage before cleanup
- name: Check disk usage before cleanup
run: df -h

# Cleanup directories before proceeding with setup
- name: Clean up old installations
if: ${{ matrix.os != 'windows-latest' }}
run: |
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
# Check disk usage after cleanup
- name: Check disk usage after cleanup
run: df -h

# cache local patch outputs
- name: Cache local Maven repository
uses: actions/cache@v3
Expand Down Expand Up @@ -149,3 +164,7 @@ jobs:
arguments: build --stacktrace -PenableCoverage=true
- uses: codecov/codecov-action@v3

# Check disk usage after cleanup
- name: Check disk usage after worflow
run: df -h

2 changes: 1 addition & 1 deletion .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
env:
AWS_PUBLIC_ECR_REGION: us-east-1
AWS_PRIVATE_ECR_REGION: us-west-2
TEST_TAG: public.ecr.aws/aws-observability/adot-autoinstrumentation-java:test
TEST_TAG: public.ecr.aws/aws-observability/adot-autoinstrumentation-java:test-v2
PUBLIC_REPOSITORY: public.ecr.aws/aws-observability/adot-autoinstrumentation-java
PRIVATE_REPOSITORY: 020628701572.dkr.ecr.us-west-2.amazonaws.com/adot-autoinstrumentation-java
PRIVATE_REGISTRY: 020628701572.dkr.ecr.us-west-2.amazonaws.com
Expand Down
6 changes: 0 additions & 6 deletions appsignals-tests/contract-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@ tasks {
"-Dio.awsobservability.instrumentation.contracttests.agentPath=${otelAgentJarTask.get().archiveFile.get()
.getAsFile().absolutePath}",
)

println("Agent JAR Path!!!: ${otelAgentJarTask.get().archiveFile.get().asFile.absolutePath}")
testLogging {
events("passed", "skipped", "failed")
showStandardStreams = true
}
}

// Disable the test task from the java plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.logging.ConsoleHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.assertj.core.api.ThrowingConsumer;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
Expand All @@ -39,16 +36,6 @@

public abstract class AwsSdkBaseTest extends ContractTestBase {

protected static final Logger LOGGER = Logger.getLogger(AwsSdkBaseTest.class.getName());

static {
ConsoleHandler handler = new ConsoleHandler();
handler.setLevel(Level.INFO);
LOGGER.addHandler(handler);
LOGGER.setLevel(Level.INFO);
LOGGER.setUseParentHandlers(false);
}

private final LocalStackContainer localstack =
new LocalStackContainer(DockerImageName.parse("localstack/localstack:3.5.0"))
.withServices(
Expand Down Expand Up @@ -620,7 +607,6 @@ protected void assertMetricAttributes(
}

protected void doTestS3CreateBucket() throws Exception {
LOGGER.info("doTestS3CreateBucket!!!!!!: ");
appClient.get("/s3/createbucket/create-bucket").aggregate().join();

var traces = mockCollectorClient.getTraces();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,6 @@ protected Map<String, String> getApplicationEnvironmentVariables() {
COLLECTOR_HTTP_ENDPOINT,
"OTEL_RESOURCE_ATTRIBUTES",
getApplicationOtelResourceAttributes(),
// // The default OTLP protocol has been changed from grpc to
// http/protobuf in
// order
// // to align with the specification. You can switch to the grpc protocol using
// // OTEL_EXPORTER_OTLP_PROTOCOL=grpc or -Dotel.exporter.otlp.protocol=grpc.
"OTEL_EXPORTER_OTLP_PROTOCOL",
"grpc");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ protected long getThreshold(String metricName) {
switch (metricName) {
// If maximum memory size is undefined, then value is -1
// https://docs.oracle.com/en/java/javase/17/docs/api/java.management/java/lang/management/MemoryUsage.html#getMax()
// TODO: Figure out why tomcat thread counts can be negative.
case JMXMetricsConstants.TOMCAT_THREADS:
threshold = -3;
break;
case JMXMetricsConstants.JVM_HEAP_MAX:
case JMXMetricsConstants.JVM_NON_HEAP_MAX:
case JMXMetricsConstants.JVM_POOL_MAX:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,32 +145,11 @@ protected void assertSemanticConventionsAttributes(
.isEqualTo(SemanticConventionsConstants.HTTP_REQUEST_METHOD);
assertThat(attribute.getValue().getStringValue()).isEqualTo(method);
})
// network.protocol.name has marked as Conditionally required if not http and
// network.protocol.version is set:
//
// https://opentelemetry.io/blog/2023/http-conventions-declared-stable/#summary-of-changes
// .satisfiesOnlyOnce(
// attribute -> {
// assertThat(attribute.getKey())
// .isEqualTo(SemanticConventionsConstants.NETWORK_PROTOCOL_NAME);
// assertThat(attribute.getValue().getStringValue()).isEqualTo("http");
// })
.satisfiesOnlyOnce(
attribute -> {
assertThat(attribute.getKey())
.isEqualTo(SemanticConventionsConstants.NETWORK_PROTOCOL_VERSION);
})
// HttpClientPeerServiceAttributesExtractor is removed from netty instrumentation:
//
// https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/12083/files
//
// instrumentation/netty/netty-4-common/library/src/main/java/io/opentelemetry/instrumentation/netty/v4/common/internal/client/NettyClientInstrumenterFactory.java
// .satisfiesOnlyOnce(
// attribute -> {
//
// assertThat(attribute.getKey()).isEqualTo(SemanticConventionsConstants.PEER_SERVICE);
// assertThat(attribute.getValue().getStringValue()).isEqualTo("backend:8080");
// })
.satisfiesOnlyOnce(
attribute -> {
assertThat(attribute.getKey()).isEqualTo(SemanticConventionsConstants.THREAD_ID);
Expand All @@ -179,7 +158,7 @@ protected void assertSemanticConventionsAttributes(
attribute -> {
assertThat(attribute.getKey()).isEqualTo(SemanticConventionsConstants.THREAD_NAME);
});
// Conditionally include PEER_SERVICE assertio

if (!getApplicationImageName().equals("aws-appsignals-tests-netty-http-client-app")) {
assertThat(attributesList)
.satisfiesOnlyOnce(
Expand Down
Loading

0 comments on commit 26283ef

Please sign in to comment.