change open telemetry endpoint

This commit is contained in:
Peter Maquiran
2024-06-17 14:38:31 +01:00
parent 596bd09f93
commit 58eee3ff93
2 changed files with 28 additions and 23 deletions
@@ -13,7 +13,7 @@ function createProvider(serviceName) {
provider.addSpanProcessor(new SimpleSpanProcessor(new ConsoleSpanExporter()));
provider.addSpanProcessor(new SimpleSpanProcessor(new ZipkinExporter({
url: 'https://5.180.182.151/zipkin-endpoint/api/v2/spans',
url: 'http://5.180.182.151:9411/api/v2/spans',
serviceName: serviceName,
// Uncomment and customize the following if needed
// getExportRequestHeaders: () => {
@@ -216,31 +216,36 @@ export class EventsToApprovePage implements OnInit {
userId = this.selectedUserCalendar
}
let allEvents = await this.AgendaDataRepositoryService.eventToApproveList({
userId,
status: EEventFilterStatus.Pending
}, tracing)
if(allEvents.isOk()) {
tracing.setAttribute('outcome', 'success')
if(userId) {
let allEvents = await this.AgendaDataRepositoryService.eventToApproveList({
userId,
status: EEventFilterStatus.Pending
}, tracing)
if(allEvents.isOk()) {
tracing.setAttribute('outcome', 'success')
if(allEvents.value.length >= 1) {
this.eventsList = this.sortService.sortArrayByDate(allEvents.value).reverse();
this.eventoaprovacaostore.save(segment, this.eventsList)
} else {
this.eventoaprovacaostore.save(segment, [])
if(allEvents.value.length >= 1) {
this.eventsList = this.sortService.sortArrayByDate(allEvents.value).reverse();
this.eventoaprovacaostore.save(segment, this.eventsList)
} else {
this.eventoaprovacaostore.save(segment, [])
}
this.showLoader = false;
} else {
tracing.setAttribute('outcome', 'failed')
tracing.bugFlag()
if(!isHttpError(allEvents.error)) {
this.toastService._badRequest('Pedimos desculpa mas não foi possível executar a acção. Por favor, contacte o apoio técnico. #4')
}
this.showLoader = false;
}
this.showLoader = false;
} else {
tracing.setAttribute('outcome', 'failed')
tracing.bugFlag()
if(!isHttpError(allEvents.error)) {
this.toastService._badRequest('Pedimos desculpa mas não foi possível executar a acção. Por favor, contacte o apoio técnico. #4')
}
this.showLoader = false;
} else {
console.warn('calling to early Events-to-approve/LoadToApproveEvents')
}
}
getFromDB() {}