Skip to content

Commit

Permalink
Merge branch 'main' into apachehttpclient_v5
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Dec 5, 2023
2 parents 58ff6e6 + d1aaa52 commit cca0a02
Show file tree
Hide file tree
Showing 17 changed files with 57 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/maven-goal/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<properties>
<apm-agent-parent.base.dir>${project.basedir}/../../..</apm-agent-parent.base.dir>
<version.aws.sdk>2.21.13</version.aws.sdk>
<version.aws.sdk>2.21.36</version.aws.sdk>
<version.aws.jms>2.0.0</version.aws.jms>
<!-- AWS SDK v2 is compiled for Java 8 -->
<maven.compiler.target>8</maven.compiler.target>
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/api-opentelemetry.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit cca0a02

Please sign in to comment.