Need support for native image creation in DGS Spring Boot micrometer #1882
Replies: 1 comment 4 replies
-
Hi @AyushChaubey - thanks for the detailed description. Happy to hear it actually works with GraalVM native images, since we haven't done any work at all to support this. Looking at your jvmTarget, it sounds like you are using the 5.x version of the DGS framework? We are no longer making any feature updates unless it's a critical security fix. For future, I would highly recommend switching to Spring Boot 6 and DGS framework 8.x versions when possible. I understand this may not be planned for the moment. Would you be interested in opening a PR for the 5.x branch for spring-boot-2.7 with that change after trying it out with your project? We don't use GraalVM native images and it would be much easier of you could try the change out with your project first. If it's a simple enough change, we can do a patch release with that. |
Beta Was this translation helpful? Give feedback.
-
Hey,
We are trying to build a GraalVM native image using Spring native support. We are able to create a proper native image that works correctly with DGS. The only issue we are facing is with the
DGS micrometer
dependency.When we add the DGS micrometer dependency, the native image build process fails complaining about missing parameter names in the compiled classes, which are needed for constructor binding to work correctly in native images.
Exception:
Exception in thread "main" org.springframework.boot.context.properties.bind.MissingParametersCompilerArgumentException: Constructor binding in a native image requires compilation with -parameters but the following classes were compiled without it: com.netflix.graphql.dgs.metrics.micrometer.DgsGraphQLMetricsProperties$CardinalityLimiterKind
Possible Solution:
I think to resolve this issue, we need to compile the Kotlin classes with the -parameters compiler argument.
Something like this:
I know DGS doesn't officially support GraalVM but we in our case DGS worked seamlessly with GraalVM and adding above support can actually help us to move forward as we don't want to loose out-of-the-box metrics provided by DGS.
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions