Measuring the performance of a request
As a development team, we must always seek to offer the best experience for our users, and, in addition to developing quality products, we must allow the application to be monitored to maintain quality during production.
There are several tools available on the market, and many of them need some level of instrumentation to accurately measure the user experience. We will develop a simpler telemetry example, but it can be applied to the monitoring tool your team uses.
Using the Angular CLI, we will create a new interceptor:
ng g interceptor telemetry/telemetry
In the file generated by the Angular CLI, we will develop our interceptor:
@Injectable() export class TelemetryInterceptor implements HttpInterceptor { intercept( request: HttpRequest<unknown>, next: HttpHandler ): Observable<HttpEvent<unknown>> { if (request.headers...