digikare / nestjs-prom

A prometheus module for nestjs
160 stars 54 forks source link

@PromMethodCounter() does not end up in /metrics #65

Closed roderik closed 3 years ago

roderik commented 3 years ago

I've added the PromModule to my top level module and in a service like below. From the docs i assumed /metrics would return a line starting with app_classnameupdate... but i only get process, nodejs and http metrics. Am I missing something in the setup? (i tried also to add the PromModule to the module the service is in without success)

top level module:

@Module({
  imports: [
    PromModule.forRoot({
      withHttpMiddleware: {
        enable: true,
      },
    }),
    ...

service:

  @PromMethodCounter()
  async update(
    entity: BlockchainNetwork,
    name?: string,
    type?: ClusterServiceType,
    size?: ClusterServiceSize,
    forceJob = false
  ): Promise<BlockchainNetwork> {
    return this.genericUpdate(entity, name, type, size, forceJob);
  }
roderik commented 3 years ago

I was wong, my bad