@dineroregnskab/datadog-angular v3.0.6
@dineroregnskab/datadog-angular
Datadog integration for Angular projects.
Has built-in unwrapping of HttpErrorResponse
and UncaughtPromiseError
.
Enrichers
Included enrichers for Logs
and RUM
:
@ngrx/store
Enrichers for Logs
can be imported from: @dineroregnskab/datadog-angular/enrichers/logs
Enrichers for RUM
can be imported from: @dineroregnskab/datadog-angular/enrichers/rum
Filters
Included filters for Logs
and RUM
:
- Discard HTTP errors with status code
0
- Discard HTTP errors with
0 Unknown Error
message
Filters for Logs
can be imported from: @dineroregnskab/datadog-angular/filters/logs
Filters for RUM
can be imported from: @dineroregnskab/datadog-angular/filters/rum
Templates:
Enrichers:
Logs:
export const enricher = (log: LogsEvent, injector: Injector | null): void => {
// Append data to log object.
};
RUM:
export const enricher = (
event: RumEvent,
context: RumEventDomainContext,
injector: Injector | null,
): void => {
// Append data to the event context here.
};
- For
Logs
,event
is the captured event object. New log information can be appended to this object. See https://docs.datadoghq.com/logs/log_collection/javascript/#advanced-usage for more information. - For
RUM
, see https://docs.datadoghq.com/real_user_monitoring/guide/enrich-and-control-rum-data/?tab=event for information about theevent
andcontext
properties. - The
injector
parameter is the Angular DI injector. This can be used to extract information from Angular components. The injector will benull
if the log happens beforesetNgInjector
is called.
Filters:
Logs:
export const filter = (
event: RumEvent,
context: RumEventDomainContext,
injector: Injector | null,
): boolean => {
// Return true to discard the log.
};
RUM:
export const filter = (log: LogsEvent, injector: Injector | null): boolean => {
// Return true to discard log.
};
- For
Logs
,event
is the captured event object. New log information can be appended to this object. See https://docs.datadoghq.com/logs/log_collection/javascript/#advanced-usage for more information. - For
RUM
, see https://docs.datadoghq.com/real_user_monitoring/guide/enrich-and-control-rum-data/?tab=event for information about theevent
andcontext
properties. - The
injector
parameter is the Angular DI injector. This can be used to extract information from Angular components. The injector will benull
if the log happens beforesetNgInjector
is called.
Initialization
Initializer will instrument both Logs and RUM.
main.ts
import { setNgInjector } from '@dineroregnskab/datadog-angular';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app';
platformBrowserDynamic()
.bootstrapModule(AppModule)
.then((appRef) => {
// Save a reference to the Angular DI injector for use in logging.
setNgInjector(appRef.injector);
})
.catch((err) => console.error(err));
Error handler
import { ErrorHandler, Injectable } from '@angular/core';
import { DatadogErrorHandler } from '@dineroregnskab/datadog-angular';
@Injectable()
export class CustomErrorHandler
extends DatadogErrorHandler
implements ErrorHandler
{
public constructor() {
super();
}
public handleError(error: any): void {
this.datadogLogger.error(error);
}
}
2 months ago
2 months ago
7 months ago
7 months ago
7 months ago
5 months ago
3 months ago
3 months ago
3 months ago
3 months ago
6 months ago
6 months ago
6 months ago
6 months ago
3 months ago
5 months ago
6 months ago
5 months ago
8 months ago
9 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago