mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
add open telemetry
This commit is contained in:
@@ -39,6 +39,8 @@ import { Observable } from 'rxjs';
|
||||
import { TableSharedCalendar } from 'src/app/services/Repositorys/Agenda/agenda-local-data-source.service';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { EEventFilterStatus } from 'src/app/services/Repositorys/Agenda/model/enums';
|
||||
import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer';
|
||||
import { isHttpError } from 'src/app/services/http.service';
|
||||
@Component({
|
||||
selector: 'app-agenda',
|
||||
templateUrl: './agenda.page.html',
|
||||
@@ -673,7 +675,10 @@ export class AgendaPage implements OnInit {
|
||||
});
|
||||
};
|
||||
|
||||
async loadRangeEventRun(startTime: Date, endTime: Date) {
|
||||
@XTracerAsync({name:'AgendaPage/loadRangeEventRun', log: false, bugPrint: false})
|
||||
async loadRangeEventRun(startTime: Date, endTime: Date, tracing?: TracingType) {
|
||||
|
||||
tracing.addEvent('load range start')
|
||||
|
||||
if (SessionStore.user.OwnerCalendars.length == 0 && SessionStore.user.SharedCalendars.length == 0) {
|
||||
return false
|
||||
@@ -707,7 +712,7 @@ export class AgendaPage implements OnInit {
|
||||
endDate: endTime.toISOString(),
|
||||
startDate: startTime.toISOString(),
|
||||
status: EEventFilterStatus.Approved
|
||||
})
|
||||
}, tracing)
|
||||
|
||||
if(response.isOk()) {
|
||||
let label;
|
||||
@@ -735,7 +740,13 @@ export class AgendaPage implements OnInit {
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
this.updateEventListBox()
|
||||
tracing.setAttribute('outcome', 'success')
|
||||
|
||||
} else {
|
||||
|
||||
tracing.setAttribute('outcome', 'failed')
|
||||
tracing.bugFlag()
|
||||
|
||||
load++
|
||||
if (load == (selectedCalendarIds).length) {
|
||||
this.showLoader = false;
|
||||
@@ -750,8 +761,14 @@ export class AgendaPage implements OnInit {
|
||||
} else {
|
||||
/* alert('sekip '+ JSON.stringify(selectedCalendar)) */
|
||||
console.log('not user', JSON.stringify(selectedCalendar))
|
||||
tracing.setAttribute('outcome', 'failed')
|
||||
tracing.setAttribute('error', 'selectedCalendar.wxUserId')
|
||||
tracing.bugFlag()
|
||||
}
|
||||
|
||||
|
||||
tracing.addEvent('load range end')
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user