mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
dont send logs on production
This commit is contained in:
@@ -2,6 +2,7 @@ import { Injectable } from "@angular/core";
|
|||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
import { WebSocketGraylogService } from "../socket/socket";
|
import { WebSocketGraylogService } from "../socket/socket";
|
||||||
import { Span } from "@opentelemetry/sdk-trace-web";
|
import { Span } from "@opentelemetry/sdk-trace-web";
|
||||||
|
import { environment } from "src/environments/environment";
|
||||||
|
|
||||||
|
|
||||||
export class OpenTelemetryLogging {
|
export class OpenTelemetryLogging {
|
||||||
@@ -9,7 +10,11 @@ export class OpenTelemetryLogging {
|
|||||||
socket = new WebSocketGraylogService()
|
socket = new WebSocketGraylogService()
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.socket.start()
|
|
||||||
|
if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
||||||
|
this.socket.start()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
send(data: Object & { type: string; payload: any, spanContext:any }): void {
|
send(data: Object & { type: string; payload: any, spanContext:any }): void {
|
||||||
|
|||||||
@@ -91,21 +91,25 @@ const createTracingInstance = ({bugPrint, name, module, autoFinish}): TracingTyp
|
|||||||
const spanContext = _tracer.startSpan(name)
|
const spanContext = _tracer.startSpan(name)
|
||||||
|
|
||||||
data = convertAttributesToString(data)
|
data = convertAttributesToString(data)
|
||||||
openTelemetryLogging.send({
|
|
||||||
type: 'graylog',
|
if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
||||||
spanContext,
|
openTelemetryLogging.send({
|
||||||
payload: {
|
type: 'graylog',
|
||||||
message: message,
|
spanContext,
|
||||||
object: {
|
payload: {
|
||||||
...data,
|
message: message,
|
||||||
spanId,
|
object: {
|
||||||
name,
|
...data,
|
||||||
user: SessionStore?.user?.FullName,
|
spanId,
|
||||||
device_name: device?.name || device?.model,
|
name,
|
||||||
commit_date: environment.version.lastCommitTime,
|
user: SessionStore?.user?.FullName,
|
||||||
|
device_name: device?.name || device?.model,
|
||||||
|
commit_date: environment.version.lastCommitTime,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
})
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
getAttribute: (key: string) => {
|
getAttribute: (key: string) => {
|
||||||
return data.tags[key]
|
return data.tags[key]
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
export let versionData = {
|
export let versionData = {
|
||||||
"shortSHA": "6b0c0af26",
|
"shortSHA": "e4a0e4c83",
|
||||||
"SHA": "6b0c0af26fedfb5bf69643358db842ced7cd2487",
|
"SHA": "e4a0e4c83b54762a7ba68eed8ae8085972dcb7d7",
|
||||||
"branch": "feature/agenda-api-peter",
|
"branch": "feature/agenda-api-peter",
|
||||||
"lastCommitAuthor": "'Peter Maquiran'",
|
"lastCommitAuthor": "'Peter Maquiran'",
|
||||||
"lastCommitTime": "'Thu Jul 25 16:01:02 2024 +0100'",
|
"lastCommitTime": "'Fri Jul 26 12:42:30 2024 +0100'",
|
||||||
"lastCommitMessage": "cant edit publication without attachment",
|
"lastCommitMessage": "fix swiper",
|
||||||
"lastCommitNumber": "5884",
|
"lastCommitNumber": "5885",
|
||||||
"changeStatus": "On branch feature/agenda-api-peter\nYour branch is ahead of 'origin/feature/agenda-api-peter' by 1 commit.\n (use \"git push\" to publish your local commits)\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: gabinete-digital-fo.code-workspace\n\tmodified: src/app/pages/publications/view-publications/view-publications.page.html\n\tmodified: version/git-version.ts",
|
"changeStatus": "On branch feature/agenda-api-peter\nYour branch is up to date with 'origin/feature/agenda-api-peter'.\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/services/monitoring/opentelemetry/logging.ts\n\tmodified: src/app/services/monitoring/opentelemetry/tracer.ts\n\tmodified: version/git-version.ts",
|
||||||
"changeAuthor": "peter.maquiran"
|
"changeAuthor": "peter.maquiran"
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user