18 lines
613 B
TypeScript
18 lines
613 B
TypeScript
import { Controller, Get, Res } from '@nestjs/common';
|
|
import { ApiExcludeController } from '@nestjs/swagger';
|
|
import { Response } from 'express';
|
|
import { TelemetryMetricsService } from '../../../infrastructure/metrics/telemetry-metrics.service';
|
|
|
|
@ApiExcludeController()
|
|
@Controller('metrics')
|
|
export class MetricsController {
|
|
constructor(private readonly metricsService: TelemetryMetricsService) {}
|
|
|
|
@Get()
|
|
async getMetrics(@Res() res: Response) {
|
|
const metrics = await this.metricsService.getMetrics();
|
|
res.set('Content-Type', this.metricsService.getContentType());
|
|
res.send(metrics);
|
|
}
|
|
}
|