-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
While using .registerAsync with custom controller, custom controller not working and path is ignored #2279
Comments
Can you provide a minimal reproduction please? |
Yes please. Simple test showcasing the issue. I went through the code but did not find anything obvious :/ |
Thanks. I will take a look hopefully later today or tomorrow |
Thanks! That you for such a quick reaction. |
Out of curiosity, do you need to actually inject anything into the controller via the |
I need to inject config to set custom labels. |
Just to be clear, you are trying to inject something into the controller itself? The whole reason the "custom controller" feature was added was to support Fastify. There really isn't any logic in that controller. Setting custom labels you can do via configuration only. It's a mistake that I allow it to go in the main options, it should only exist outside the PrometheusModule.registerAsync({
controller: CustomController,
useFactory() {
// whatever goes here
return {};
},
}); |
@murbanowicz Is this issue resolved for you? |
## [6.0.1](v6.0.0...v6.0.1) (2024-06-06) ### Bug Fixes * don't allow controller to be declared on options ([6924ffa](6924ffa)), closes [#2279](#2279)
🎉 This issue has been resolved in version 6.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I found this really weird issue.
When using useFactory / registerAsync, the custom controller does not work properly.
I have to use configuration, so I moved to async creation and I hit this issue which I cannot even workaround :/
If custom controller is passed to the options while using registerAsync, the controller is not used, but the base prom controller is being used and on top of that the path is being ignored completely.
The text was updated successfully, but these errors were encountered: