Skip to content

Commit

Permalink
feat: migrate PrometheusController to fastify
Browse files Browse the repository at this point in the history
  • Loading branch information
techsavvyash committed Jan 3, 2024
1 parent 35757b4 commit af92425
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@samagra-x/stencil",
"version": "0.0.5",
"version": "0.0.6",
"description": "Stencil - An opinionated backend framework for NodeJS based on NestJS",
"author": "Yash Mittal (@techsavvyash) & Team SamagraX",
"license": "MIT",
Expand Down
6 changes: 3 additions & 3 deletions packages/common/src/controllers/prometheus.controller.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Controller, Get, Res } from '@nestjs/common';
import { Response } from 'express';
import { FastifyReply } from 'fastify';
import { register } from 'prom-client';
@Controller()
export class PrometheusController {
@Get('metrics')
async metrics(@Res() response: Response) {
response.set('Content-Type', register.contentType);
async metrics(@Res() response: FastifyReply) {
response.headers({ 'Content-Type': register.contentType });
response.send(await register.metrics());
}
}

0 comments on commit af92425

Please sign in to comment.