688 prometheus integration - #827
Conversation
# Conflicts: # backend/package-lock.json # traefik.yml
| const app = await NestFactory.create(AppModule); | ||
|
|
||
| const metrics = app.get(MetricsService); | ||
| app.useGlobalInterceptors(new HttpMetricsInterceptor(metrics)); |
There was a problem hiding this comment.
Interceptor seem to be registered twice, also on app.module.ts L106
| provide: Logger, | ||
| useClass: CustomLogger, | ||
| }, | ||
| { provide: APP_INTERCEPTOR, useClass: HttpMetricsInterceptor }, |
There was a problem hiding this comment.
Already registered in main.ts L22 ?
| scheme: http | ||
| metrics_path: /metrics | ||
| static_configs: | ||
| - targets: [ 'mmu-backend-test.larus.tetras-libre.fr' ] |
| registers: [this.registry], | ||
| collect: async () => { | ||
| try { | ||
| const { stdout } = await execFileAsync('du', ['-sb', '/upload'], { |
There was a problem hiding this comment.
Must use upload folder path defined in L30 ?
| service = module.get<MetricsService>(MetricsService); | ||
| }); | ||
|
|
||
| it('should be defined', () => { |
There was a problem hiding this comment.
No tests implemented.
At least return a 200 and body with Prometheus formatted data ?
| } | ||
|
|
||
| const project = await this.findOne(projectId); | ||
| const startedAt = project?.lockedAt; |
There was a problem hiding this comment.
We have a potential issue here.
If no lockedAt value we record anything ?
Can you explain what's your intention here ?
| @@ -124,10 +132,30 @@ export class ProjectService { | |||
|
|
|||
| async lockProject(projectId: number, lock: boolean, userId: number) { | |||
There was a problem hiding this comment.
Do you check if the user unlocking is the same than lock before ?
If I remember rightly we have sometime an unwanted lock message that happen in UI (i have no scenario to reproduct, but sometime I open for the first time an existing project and i get it).
Can you check or implement unit test on this function ?
No description provided.