Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SmallRye GraphQL extension's metrics are broken #12420

Closed
jmartisk opened this issue Sep 30, 2020 · 1 comment · Fixed by #12421
Closed

SmallRye GraphQL extension's metrics are broken #12420

jmartisk opened this issue Sep 30, 2020 · 1 comment · Fixed by #12421
Assignees
Milestone

Comments

@jmartisk
Copy link
Contributor

The producer of vendor MetricRegistry is detected as unused (unless an application injects it directly, which makes no sense), but it is needed at runtime. This appears at application boot:

CDI: programmatic lookup problem detected
-----------------------------------------
At least one bean matched the required type and qualifiers but was marked as unused and removed during build
Removed beans:
	- PRODUCER_METHOD bean io.smallrye.metrics.MetricRegistries#getVendorRegistry() [types=[class org.eclipse.microprofile.metrics.MetricRegistry], qualifiers=[@org.eclipse.microprofile.metrics.annotation.RegistryType(type=VENDOR)]]
Required type: class org.eclipse.microprofile.metrics.MetricRegistry
Required qualifiers: [@org.eclipse.microprofile.metrics.annotation.RegistryType(type=VENDOR)]
Solutions:
	- Application developers can eliminate false positives via the @Unremovable annotation
	- Extensions can eliminate false positives via build items, e.g. using the UnremovableBeanBuildItem
	- See also https://quarkus.io/guides/cdi-reference#remove_unused_beans

Unfortunately, io.quarkus.smallrye.graphql.deployment.MetricsTest is unable to catch this error, because the test itself injects the vendor registry, therefore it's not unused and everything works....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants