mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +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 { WebSocketGraylogService } from "../socket/socket";
|
||||
import { Span } from "@opentelemetry/sdk-trace-web";
|
||||
import { environment } from "src/environments/environment";
|
||||
|
||||
|
||||
export class OpenTelemetryLogging {
|
||||
@@ -9,7 +10,11 @@ export class OpenTelemetryLogging {
|
||||
socket = new WebSocketGraylogService()
|
||||
|
||||
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 {
|
||||
|
||||
@@ -91,21 +91,25 @@ const createTracingInstance = ({bugPrint, name, module, autoFinish}): TracingTyp
|
||||
const spanContext = _tracer.startSpan(name)
|
||||
|
||||
data = convertAttributesToString(data)
|
||||
openTelemetryLogging.send({
|
||||
type: 'graylog',
|
||||
spanContext,
|
||||
payload: {
|
||||
message: message,
|
||||
object: {
|
||||
...data,
|
||||
spanId,
|
||||
name,
|
||||
user: SessionStore?.user?.FullName,
|
||||
device_name: device?.name || device?.model,
|
||||
commit_date: environment.version.lastCommitTime,
|
||||
|
||||
if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
||||
openTelemetryLogging.send({
|
||||
type: 'graylog',
|
||||
spanContext,
|
||||
payload: {
|
||||
message: message,
|
||||
object: {
|
||||
...data,
|
||||
spanId,
|
||||
name,
|
||||
user: SessionStore?.user?.FullName,
|
||||
device_name: device?.name || device?.model,
|
||||
commit_date: environment.version.lastCommitTime,
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
getAttribute: (key: string) => {
|
||||
return data.tags[key]
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
export let versionData = {
|
||||
"shortSHA": "6b0c0af26",
|
||||
"SHA": "6b0c0af26fedfb5bf69643358db842ced7cd2487",
|
||||
"shortSHA": "e4a0e4c83",
|
||||
"SHA": "e4a0e4c83b54762a7ba68eed8ae8085972dcb7d7",
|
||||
"branch": "feature/agenda-api-peter",
|
||||
"lastCommitAuthor": "'Peter Maquiran'",
|
||||
"lastCommitTime": "'Thu Jul 25 16:01:02 2024 +0100'",
|
||||
"lastCommitMessage": "cant edit publication without attachment",
|
||||
"lastCommitNumber": "5884",
|
||||
"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",
|
||||
"lastCommitTime": "'Fri Jul 26 12:42:30 2024 +0100'",
|
||||
"lastCommitMessage": "fix swiper",
|
||||
"lastCommitNumber": "5885",
|
||||
"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"
|
||||
}
|
||||
Reference in New Issue
Block a user