mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
27 lines
618 B
TypeScript
27 lines
618 B
TypeScript
|
|
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()
|