digikare / nestjs-prom

A prometheus module for nestjs
160 stars 54 forks source link

Property based injection for PromService doesn't work #73

Open snigdha920 opened 2 years ago

snigdha920 commented 2 years ago

Property based injections for PromService doesn't work, here is a minimal reproduction repo: https://github.com/snigdha920/nestjs-promservice-reproduction-repo

While starting the app, you will see that the property defined using the property injection is undefined but using the constructor injection is okay:

[Nest] 36696  - 11/07/2022, 12:05:45 PM     LOG [NestFactory] Starting Nest application...
[Nest] 36696  - 11/07/2022, 12:05:45 PM     LOG [InstanceLoader] PromCoreModule dependencies initialized +19ms
promServiceProperyInjection inside AppService constructor -  undefined
promServiceConstructorInjection inside AppService constructor -  PromService {}
[Nest] 36696  - 11/07/2022, 12:05:45 PM     LOG [InstanceLoader] PromModule dependencies initialized +1ms
[Nest] 36696  - 11/07/2022, 12:05:45 PM     LOG [InstanceLoader] AppModule dependencies initialized +0ms
[Nest] 36696  - 11/07/2022, 12:05:45 PM     LOG [RoutesResolver] AppController {/}: +2ms
[Nest] 36696  - 11/07/2022, 12:05:45 PM     LOG [RouterExplorer] Mapped {/, GET} route +1ms
[Nest] 36696  - 11/07/2022, 12:05:45 PM     LOG [RoutesResolver] PromController {/metrics}: +0ms
[Nest] 36696  - 11/07/2022, 12:05:45 PM     LOG [RouterExplorer] Mapped {/metrics, GET} route +0ms
[Nest] 36696  - 11/07/2022, 12:05:45 PM     LOG [NestApplication] Nest application successfully started +1ms