add logging

This commit is contained in:
Peter Maquiran
2024-07-22 11:37:02 +01:00
parent ef7edb3978
commit 717968ac52
12 changed files with 787 additions and 35 deletions
@@ -0,0 +1,26 @@
import { Injectable } from "@angular/core";
import { v4 as uuidv4 } from 'uuid';
import { WebSocketGraylogService } from "../socket/socket";
import { Span } from "@opentelemetry/sdk-trace-web";
export class OpenTelemetryLogging {
socket = new WebSocketGraylogService()
constructor() {
this.socket.start()
}
send(data: Object & { type: string; payload: any, spanContext:any }): void {
this.socket.send({
type: data.type,
payload: data.payload,
requestId: uuidv4(),
spanContext: data.spanContext
});
}
}
export const openTelemetryLogging = new OpenTelemetryLogging()