Skip to content

Conversation

@SylvainJuge
Copy link
Contributor

@SylvainJuge SylvainJuge commented Dec 1, 2025

Part of #13031

In order to help with transition to indy instrumentation, we need proper tests for extensions:

  • unlike internal instrumentation they can't be easily migrated
  • ideally we'd like to preserve compatibility
  • if we introduce a new type of extension with indy compatibility, we need to test it

This PR adds:

  • a simple test application
  • an "inlined" instrumentation extension that should reproduce features of existing extensions (for now only using inlined instrumentation)
  • smoke test to execute the test application with extension in docker, with assertions on the expected behavior.

The goal of this PR is to add testing for the "current state" of existing extensions, which should be able to run without any modification.

Tested instrumentation features

  • modify method argument(s)
  • modify method return value
  • usage of virtual fields
  • use local scope variables

How to run

  • execute io.opentelemetry.smoketest.ExtensionsSmokeTest in the IDE

@SylvainJuge SylvainJuge self-assigned this Dec 1, 2025
private static final String appPath =
System.getProperty("io.opentelemetry.smoketest.extension.testapp.path");

private static final String IMAGE = "eclipse-temurin:21";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[for reviewer] for now we only test with a single rather recent JVM, as far as I know we don't have things that might be influenced by the JVM version that relate to indy instrumentation.

Comment on lines 84 to 97
List<String> appOutput =
Arrays.asList(target.getLogs(OutputFrame.OutputType.STDOUT).split("\n"));
assertThat(appOutput)
.describedAs("return value instrumentation")
.contains("return value has been modified");
assertThat(appOutput)
.describedAs("argument value instrumentation")
.contains("argument has been modified");
assertThat(appOutput)
.describedAs("virtual field support")
.contains("virtual field supported");
assertThat(appOutput)
.describedAs("local advice variable support")
.contains("local advice variable supported");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[for reviewer] I know parsing the output can be brittle, but the application is elementary so this should be fine.

@SylvainJuge SylvainJuge marked this pull request as ready for review December 1, 2025 17:56
@SylvainJuge SylvainJuge requested a review from a team as a code owner December 1, 2025 17:56
@SylvainJuge SylvainJuge changed the title extension smoke test (WIP) extension smoke test to avoid regression with indy Dec 1, 2025
…nstrumentation into extensions-examples-indy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant