Skip to content

Conversation

@laurit
Copy link
Contributor

@laurit laurit commented Sep 23, 2024

Resolves #12267
Resolves #4788
Hopefully also resolves #9575

* This class is internal and is hence not for public use. Its APIs are unstable and can change at
* any time.
*/
public final class AwsSdkInstrumenterFactory {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class is used by AwsSdkTelemetry that is in a different package. This comment is enforced by tooling on public classes in internal package. It is not needed on SqsAdviceBridge as it is not in internal package.

@Override
public void transform(TypeTransformer transformer) {
transformer.applyAdviceToMethod(
named("onMessage").and(takesArgument(0, named("org.springframework.messaging.Message"))),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a TODO. I skipped it because I wasn't quite sure how to handle it.


@BeforeAll
static void setUp() {
sqs = SQSRestServerBuilder.withPort(0).withInterface("localhost").start();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any concern about port conflicts here?

Suggested change
sqs = SQSRestServerBuilder.withPort(0).withInterface("localhost").start();
int sqsPort = PortUtils.findOpenPort();
sqs = SQSRestServerBuilder.withPort(sqsPort).withInterface("localhost").start();

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Port 0 usually means any port, os will pick whatever port is free. This is really the best option. The algorithm in PortUtils.findOpenPort mostly attempts to guard that tests running in parallel wouldn't try to use the same port, it is not able guarantee that some other application won't use the port it has picked.

@laurit laurit merged commit 9a7f712 into open-telemetry:main Oct 7, 2024
56 checks passed
@laurit laurit deleted the spring-cloud-aws branch October 7, 2024 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants