Skip to content

Conversation

@zeitlinger
Copy link
Member

@zeitlinger zeitlinger commented Nov 14, 2025

We broke native image and didn't realize it because

  • main was broken at the time due to spring 7 latest deps
  • it took more that 1 PR to fix latest deps and thus didn't see the failure

@zeitlinger zeitlinger self-assigned this Nov 14, 2025
@github-actions github-actions bot added the test native This label can be applied to PRs to trigger them to run native tests label Nov 14, 2025
@zeitlinger zeitlinger marked this pull request as ready for review November 14, 2025 20:38
@zeitlinger zeitlinger requested a review from a team as a code owner November 14, 2025 20:38
@zeitlinger zeitlinger added this to the v2.22.0 milestone Nov 14, 2025
@laurit
Copy link
Contributor

laurit commented Nov 15, 2025

I created #15311 that uses a slightly different approach just to test out whether it would work. Noticed that for webflux instrumentation the header getter logic is duplicated for client and server instrumentation, fixed that too. The approach taken in this PR is fine too and I might even prefer it. Though first all tests would need to pass.

@zeitlinger
Copy link
Member Author

I created #15311 that uses a slightly different approach just to test out whether it would work. Noticed that for webflux instrumentation the header getter logic is duplicated for client and server instrumentation, fixed that too. The approach taken in this PR is fine too and I might even prefer it. Though first all tests would need to pass.

great - I'm also trying to fix this PR so that we can choose.

  • I've also opted not to ignore exceptions (which has already made it hard to fix the PR)
  • added explicit check for spring 7 instead
  • not removed duplication yet

@zeitlinger
Copy link
Member Author

@laurit should I rebase - or just close this PR?

@laurit
Copy link
Contributor

laurit commented Nov 18, 2025

@laurit should I rebase - or just close this PR?

your choice. I like that it always uses GET_HEADERS.invoke(headers, name), unlike the current code that has a branch. I don't like that it uses Class.forName("org.springframework.core.Nullness"); for version detection as this is not a reliable way to detect versions. It fails when there are multiple versions of spring on classpath, unfortunately this sometimes happens.

@zeitlinger zeitlinger removed this from the v2.22.0 milestone Nov 18, 2025
@zeitlinger zeitlinger changed the title fix graal native image fix graal native image - improvement Nov 18, 2025
@zeitlinger zeitlinger force-pushed the fix-native-image-build branch from 925e44c to 71f5a5b Compare November 18, 2025 14:47
@zeitlinger
Copy link
Member Author

It fails when there are multiple versions of spring on classpath, unfortunately this sometimes happens.

removed that again

@zeitlinger zeitlinger force-pushed the fix-native-image-build branch from 74ca70f to 75b93e8 Compare November 20, 2025 12:07
@zeitlinger
Copy link
Member Author

@laurit thanks for the feedback

I also added nullaway to make the new code more maintainable

@laurit laurit merged commit 9aad1e6 into open-telemetry:main Nov 21, 2025
90 checks passed
@zeitlinger zeitlinger deleted the fix-native-image-build branch November 21, 2025 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test native This label can be applied to PRs to trigger them to run native tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants