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

FEAT: Programmatically hide Prometheus.metricPath from @nestjs/swagger output #51

Open
hitmands opened this issue Feb 14, 2021 · 1 comment

Comments

@hitmands
Copy link

I couldn't find a way of hiding the prom endpoint from our public swagger output.

PromModule.forRoot({
      metricPath: '/heartbeat/metrics',
});

image


Is there a way to pass the ApiExcludeEndpoint decorator to Prometheus?

import { ApiExcludeEndpoint } from '@nestjs/swagger';

@Controlle('hello-world')
class HelloWorld {

  @ApiExcludeEndpoint()
  @Get('/hide-from-swagger-json')
  privateEndpoint() {
    return { hidden: true };
  }
}
@pragmaticivan
Copy link

You might be able to do that with Reflect.defineMetadata(metakey, metadata, descriptor.value);?

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

No branches or pull requests

2 participants