add monitoring

This commit is contained in:
Peter Maquiran
2024-06-18 09:14:22 +01:00
parent 157ecdd10b
commit 62c6afbe5b
19 changed files with 190 additions and 114 deletions
@@ -19,6 +19,7 @@ import { AttachmentsService } from 'src/app/services/attachments.service';
import { AgendaDataRepositoryService } from 'src/app/services/Repositorys/Agenda/agenda-data-repository.service';
import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer';
import { isHttpError } from 'src/app/services/http.service';
import { EventsService } from 'src/app/services/events.service';
@Component({
selector: 'app-approve-event',
@@ -61,7 +62,8 @@ export class ApproveEventPage implements OnInit {
private httpErrorHandle: HttpErrorHandle,
public TaskService: TaskService,
private attachmentsService: AttachmentsService,
public AgendaDataRepositoryService: AgendaDataRepositoryService
public AgendaDataRepositoryService: AgendaDataRepositoryService,
public EventsService: EventsService
) {
this.activatedRoute.paramMap.subscribe(params => {
//
@@ -111,6 +113,14 @@ export class ApproveEventPage implements OnInit {
tracing.setAttribute('outcome', 'success')
} else if(isHttpError(res.error)) {
tracing.setAttribute('eventId', this.serialNumber)
if(res.error.status == 404) {
this.toastService._badRequest('Este evento já não existe')
} else {
this.httpErrorHandle.httpStatusHandle(res.error)
}
tracing.setAttribute('outcome', 'failed')
tracing.bugFlag()
@@ -243,7 +243,7 @@ export class EventListPage implements OnInit {
let allEvents = await this.AgendaDataRepositoryService.eventToApproveList({
userId,
status: EEventFilterStatus.Pending
})
}, tracing)
if(allEvents.isOk()) {
tracing.setAttribute('outcome', 'success')