diff --git a/.github/workflows/maven-goal/action.yml b/.github/workflows/maven-goal/action.yml index 8d42a8a56f..a2ddbea62b 100644 --- a/.github/workflows/maven-goal/action.yml +++ b/.github/workflows/maven-goal/action.yml @@ -25,12 +25,12 @@ runs: steps: - name: Set up testing JDK if: ${{ inputs.test-java-version != '17' }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ inputs.test-java-version}} distribution: ${{ inputs.test-java-distribution}} - name: Set up build JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: 17 # NOTE: This version is also defined in .buildkite/hooks/pre-command distribution: temurin diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5f80c6475d..c13e506493 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,7 +69,7 @@ jobs: ref: ${{ inputs.branch }} token: ${{ env.GITHUB_TOKEN }} - name: Set up JDK ${{ env.JAVA_VERSION }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ env.JAVA_VERSION }} distribution: ${{ env.JAVA_DIST }} @@ -219,7 +219,7 @@ jobs: with: ref: ${{ env.TAG_NAME }} - name: Set up JDK ${{ env.JAVA_VERSION }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ env.JAVA_VERSION }} distribution: ${{ env.JAVA_DIST }} diff --git a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/AbstractAws1ClientIT.java b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/AbstractAws1ClientIT.java new file mode 100644 index 0000000000..0d1fba6cf6 --- /dev/null +++ b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/AbstractAws1ClientIT.java @@ -0,0 +1,12 @@ +package co.elastic.apm.agent.awssdk.v1; + +import co.elastic.apm.agent.awssdk.common.AbstractAwsClientIT; + +public abstract class AbstractAws1ClientIT extends AbstractAwsClientIT { + + public static final String LOCALSTACK_VERSION = "0.14.2"; + + public AbstractAws1ClientIT() { + super(LOCALSTACK_VERSION); + } +} diff --git a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/DynamoDbClientIT.java b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/DynamoDbClientIT.java index 59afe20f2e..1ebe829184 100644 --- a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/DynamoDbClientIT.java +++ b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/DynamoDbClientIT.java @@ -50,7 +50,7 @@ import static co.elastic.apm.agent.testutils.assertions.Assertions.assertThat; -public class DynamoDbClientIT extends AbstractAwsClientIT { +public class DynamoDbClientIT extends AbstractAws1ClientIT { private AmazonDynamoDB dynamoDB; private AmazonDynamoDBAsync dynamoDBAsync; diff --git a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/S3ClientIT.java b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/S3ClientIT.java index 7ef95379a7..05a6f1e282 100644 --- a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/S3ClientIT.java +++ b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/S3ClientIT.java @@ -36,7 +36,7 @@ import static org.testcontainers.containers.localstack.LocalStackContainer.Service.S3; -public class S3ClientIT extends AbstractAwsClientIT { +public class S3ClientIT extends AbstractAws1ClientIT { private AmazonS3 s3; diff --git a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/SQSClientIT.java b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/SQSClientIT.java index e811db0ac4..7efb851088 100644 --- a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/SQSClientIT.java +++ b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/SQSClientIT.java @@ -57,6 +57,10 @@ public class SQSClientIT extends AbstractSQSClientIT { CoreConfiguration coreConfiguration; MessagingConfiguration messagingConfiguration; + public SQSClientIT() { + super(AbstractAws1ClientIT.LOCALSTACK_VERSION); + } + @BeforeEach public void setupClient() { coreConfiguration = tracer.getConfig(CoreConfiguration.class); diff --git a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/SQSJmsClientIT.java b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/SQSJmsClientIT.java index 2b871bc11f..f8a2ebe393 100644 --- a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/SQSJmsClientIT.java +++ b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/SQSJmsClientIT.java @@ -56,7 +56,7 @@ import static co.elastic.apm.agent.testutils.assertions.Assertions.assertThat; import static org.mockito.Mockito.doReturn; -public class SQSJmsClientIT extends AbstractAwsClientIT { +public class SQSJmsClientIT extends AbstractAws1ClientIT { AmazonSQSMessagingClientWrapper client; SQSConnection connection; SQSConnection receivingConnection; diff --git a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/pom.xml b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/pom.xml index 3e65036a3b..6025ce3407 100644 --- a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/pom.xml +++ b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/pom.xml @@ -13,7 +13,7 @@ ${project.basedir}/../../.. - 2.21.13 + 2.21.36 2.0.0 8 diff --git a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/AbstractAws2ClientIT.java b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/AbstractAws2ClientIT.java new file mode 100644 index 0000000000..b0162779c1 --- /dev/null +++ b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/AbstractAws2ClientIT.java @@ -0,0 +1,12 @@ +package co.elastic.apm.agent.awssdk.v2; + +import co.elastic.apm.agent.awssdk.common.AbstractAwsClientIT; + +public abstract class AbstractAws2ClientIT extends AbstractAwsClientIT { + + public static final String LOCALSTACK_VERSION = "3.0.2"; + + public AbstractAws2ClientIT() { + super(LOCALSTACK_VERSION); + } +} diff --git a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/DynamoDbClientIT.java b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/DynamoDbClientIT.java index dcd5a2e1b5..6e9c6b7f29 100644 --- a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/DynamoDbClientIT.java +++ b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/DynamoDbClientIT.java @@ -54,7 +54,7 @@ import static co.elastic.apm.agent.testutils.assertions.Assertions.assertThat; -public class DynamoDbClientIT extends AbstractAwsClientIT { +public class DynamoDbClientIT extends AbstractAws2ClientIT { private DynamoDbClient dynamoDB; private DynamoDbAsyncClient dynamoDBAsync; diff --git a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/S3ClientIT.java b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/S3ClientIT.java index 2eba149de9..5b369a396d 100644 --- a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/S3ClientIT.java +++ b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/S3ClientIT.java @@ -44,7 +44,7 @@ import static org.assertj.core.api.Assertions.assertThat; -public class S3ClientIT extends AbstractAwsClientIT { +public class S3ClientIT extends AbstractAws2ClientIT { private S3Client s3; private S3AsyncClient s3Async; diff --git a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/SQSClientIT.java b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/SQSClientIT.java index 992bb5460d..da977bb9aa 100644 --- a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/SQSClientIT.java +++ b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/SQSClientIT.java @@ -60,6 +60,10 @@ public class SQSClientIT extends AbstractSQSClientIT { CoreConfiguration coreConfiguration; MessagingConfiguration messagingConfiguration; + public SQSClientIT() { + super(AbstractAws2ClientIT.LOCALSTACK_VERSION); + } + @BeforeEach public void setupClient() { coreConfiguration = tracer.getConfig(CoreConfiguration.class); diff --git a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/SQSJmsClientIT.java b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/SQSJmsClientIT.java index 86124494d9..3286c10644 100644 --- a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/SQSJmsClientIT.java +++ b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/SQSJmsClientIT.java @@ -57,7 +57,7 @@ import static org.mockito.Mockito.doReturn; import static co.elastic.apm.agent.testutils.assertions.Assertions.assertThat; -public class SQSJmsClientIT extends AbstractAwsClientIT { +public class SQSJmsClientIT extends AbstractAws2ClientIT { AmazonSQSMessagingClientWrapper client; SQSConnection connection; SQSConnection receivingConnection; diff --git a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-common/src/test/java/co/elastic/apm/agent/awssdk/common/AbstractAwsClientIT.java b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-common/src/test/java/co/elastic/apm/agent/awssdk/common/AbstractAwsClientIT.java index 9a935eb7b6..622d56be20 100644 --- a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-common/src/test/java/co/elastic/apm/agent/awssdk/common/AbstractAwsClientIT.java +++ b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-common/src/test/java/co/elastic/apm/agent/awssdk/common/AbstractAwsClientIT.java @@ -40,7 +40,6 @@ @Testcontainers public abstract class AbstractAwsClientIT extends AbstractInstrumentationTest { - private static final DockerImageName localstackImage = DockerImageName.parse("localstack/localstack:0.14.2"); protected static final String BUCKET_NAME = "some-test-bucket"; protected static final String SQS_QUEUE_NAME = "some-test-sqs-queue"; protected static final String SQS_IGNORED_QUEUE_NAME = "ignored-queue"; @@ -52,7 +51,12 @@ public abstract class AbstractAwsClientIT extends AbstractInstrumentationTest { protected static final String KEY_CONDITION_EXPRESSION = "attributeOne = :one"; @Container - protected LocalStackContainer localstack = new LocalStackContainer(localstackImage).withServices(localstackService()); + protected LocalStackContainer localstack; + + public AbstractAwsClientIT(String localstackVersion) { + DockerImageName localstackImage = DockerImageName.parse("localstack/localstack:" + localstackVersion); + localstack = new LocalStackContainer(localstackImage).withServices(localstackService()); + } protected abstract String awsService(); diff --git a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-common/src/test/java/co/elastic/apm/agent/awssdk/common/AbstractSQSClientIT.java b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-common/src/test/java/co/elastic/apm/agent/awssdk/common/AbstractSQSClientIT.java index 48005464f3..dd8368ed51 100644 --- a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-common/src/test/java/co/elastic/apm/agent/awssdk/common/AbstractSQSClientIT.java +++ b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-common/src/test/java/co/elastic/apm/agent/awssdk/common/AbstractSQSClientIT.java @@ -38,6 +38,10 @@ public abstract class AbstractSQSClientIT extends AbstractAwsClientIT { protected CoreConfiguration coreConfiguration; protected MessagingConfiguration messagingConfiguration; + public AbstractSQSClientIT(String localstackVersion) { + super(localstackVersion); + } + @BeforeEach public void setupConfig() { coreConfiguration = tracer.getConfig(CoreConfiguration.class); diff --git a/apm-agent-plugins/apm-rabbitmq/apm-rabbitmq-spring/src/test/java/co/elastic/apm/agent/rabbitmq/SpringAmqpBatchIT.java b/apm-agent-plugins/apm-rabbitmq/apm-rabbitmq-spring/src/test/java/co/elastic/apm/agent/rabbitmq/SpringAmqpBatchIT.java index d6b00fcfe0..361fd0af00 100644 --- a/apm-agent-plugins/apm-rabbitmq/apm-rabbitmq-spring/src/test/java/co/elastic/apm/agent/rabbitmq/SpringAmqpBatchIT.java +++ b/apm-agent-plugins/apm-rabbitmq/apm-rabbitmq-spring/src/test/java/co/elastic/apm/agent/rabbitmq/SpringAmqpBatchIT.java @@ -25,6 +25,7 @@ import co.elastic.apm.agent.rabbitmq.components.batch.BatchListenerComponent; import co.elastic.apm.agent.rabbitmq.config.BatchConfiguration; import co.elastic.apm.agent.tracer.configuration.MessagingConfiguration; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.amqp.rabbit.core.BatchingRabbitTemplate; @@ -45,6 +46,7 @@ @RunWith(SpringRunner.class) @SpringBootTest @ContextConfiguration(classes = {BatchConfiguration.class, BatchListenerComponent.class}, initializers = {RabbitMqTestBase.Initializer.class}) +@Ignore("Test causes CI flakyness, presumably due to unclean shutdown of RabbitMqTestBase: Can pre reproduced by running the test in repeated mode locally.") public class SpringAmqpBatchIT extends RabbitMqTestBase { @Autowired diff --git a/docs/api-opentelemetry.asciidoc b/docs/api-opentelemetry.asciidoc index 376cf8f6b4..5812da6d7e 100644 --- a/docs/api-opentelemetry.asciidoc +++ b/docs/api-opentelemetry.asciidoc @@ -6,7 +6,7 @@ endif::[] [[opentelemetry-bridge]] === OpenTelemetry bridge -The Elastic APM OpenTelemetry bridge allows creating Elastic APM `Transactions` and `Spans`, +The Elastic APM OpenTelemetry bridge allows creating Elastic APM `Transactions` and `Spans` using the OpenTelemetry API. OpenTelemetry metrics are also collected. In other words, it translates the calls to the OpenTelemetry API to Elastic APM and thus allows for reusing existing instrumentation. @@ -50,7 +50,7 @@ The minimum required OpenTelemetry version is 1.0.1. ==== Initialize tracer There's no separate dependency needed for the bridge itself. -The Java agent hooks into `GlobalOpenTelemetry` to return it's own implementation of `OpenTelemetry` +The Java agent hooks into `GlobalOpenTelemetry` to return its own implementation of `OpenTelemetry` that is connected to the internal tracer of the agent. [source,java]