mirror of
https://github.com/apricote/Listory.git
synced 2026-01-13 21:21:02 +00:00
feat(observability): Replace Prometheus package with OpenTelemetry
This commit is contained in:
parent
f67383b761
commit
6b1640b753
22 changed files with 2391 additions and 568 deletions
|
|
@ -1,6 +1,5 @@
|
|||
import { Test, TestingModule } from "@nestjs/testing";
|
||||
import type { Response } from "express";
|
||||
import { Logger } from "../logger/logger.service";
|
||||
import { User } from "../users/user.entity";
|
||||
import { AuthSession } from "./auth-session.entity";
|
||||
import { AuthController } from "./auth.controller";
|
||||
|
|
@ -14,10 +13,7 @@ describe("AuthController", () => {
|
|||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
controllers: [AuthController],
|
||||
providers: [
|
||||
{ provide: AuthService, useFactory: () => ({}) },
|
||||
{ provide: Logger, useClass: Logger },
|
||||
],
|
||||
providers: [{ provide: AuthService, useFactory: () => ({}) }],
|
||||
}).compile();
|
||||
|
||||
controller = module.get<AuthController>(AuthController);
|
||||
|
|
|
|||
|
|
@ -3,15 +3,13 @@ import {
|
|||
Catch,
|
||||
ExceptionFilter,
|
||||
ForbiddenException,
|
||||
Logger,
|
||||
} from "@nestjs/common";
|
||||
import type { Response } from "express";
|
||||
import { Logger } from "../logger/logger.service";
|
||||
|
||||
@Catch()
|
||||
export class SpotifyAuthFilter implements ExceptionFilter {
|
||||
constructor(private readonly logger: Logger) {
|
||||
this.logger.setContext(this.constructor.name);
|
||||
}
|
||||
private readonly logger = new Logger(this.constructor.name);
|
||||
|
||||
catch(exception: Error, host: ArgumentsHost) {
|
||||
const response = host.switchToHttp().getResponse<Response>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue