Skip to content

Conversation

@JonasKunz
Copy link
Contributor

@JonasKunz JonasKunz commented May 31, 2023

What does this PR do?

Fixes #3145 .

The GlobalOpenTelemetry instrumentation was broken for external plugins due to a sideeffect of hiding the internal Otel-API shipped within the agent classloader from the IndyPluginClassloader:

  • External Plugin IndyPluginClassloaders contain a copy of all classes of the external plugin jar. This means also GlobalOpenTelemetry is copied to the IndyPluginClassloader.
  • Our instrumentation for GlobalOpenTelemetry has a classloader check ensuring that the target classloader can actually load the Otel-API. This is done by trying to load the io.opentelemetry.context.propagation.TextMapSetter.class resource
  • IndyPluginClassloaders cannot locate the resources for their corresponding classes and therefore delegate this search to their parent classloader.
  • The parent classloader filters out classes and resources which are supposed to be hidden from the plugin. With Added OpenTelemetry Metrics API bridge and instrumentation #3014 otel classes were added to this list.
  • For this reason the instrumentation thinks that the copied GlobalOpenTelemetry is not instrumentable.

Checklist

  • This is a bugfix
@ghost
Copy link

ghost commented May 31, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview previewSnapshots

Expand to view the summary

Build stats

  • Start Time: 2023-06-05T23:39:18.235+0000

  • Duration: 15 min 52 sec

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run benchmark tests : Run the benchmark tests.

  • run jdk compatibility tests : Run the JDK Compatibility tests.

  • run integration tests : Run the Agent Integration tests.

  • run end-to-end tests : Run the APM-ITs.

  • run windows tests : Build & tests on windows.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@AlexanderWert AlexanderWert added this to the 8.9 milestone May 31, 2023
@JonasKunz JonasKunz requested a review from a team June 1, 2023 05:01
@JonasKunz JonasKunz enabled auto-merge (squash) June 5, 2023 13:40
@JonasKunz JonasKunz merged commit 2dea96a into elastic:main Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants