Exciting news!Announcing our $4.6M Series Seed. Learn more
Socket
LoveBlogFAQ
Install
Log in

@dineroregnskab/datadog

Package Overview
Dependencies
2
Maintainers
2
Versions
6
Issues
File Explorer

Advanced tools

@dineroregnskab/datadog

Datadog instrumentation of Logs and RUM

    0.2.5latest

Version published
Maintainers
2

Readme

Source

@dineroregnskab/datadog-angular

Datadog integration for Angular projects.

Enrichers

Included enrichers for Logs and RUM:

  • None

These can be imported from: @dineroregnskab/datadog-angular/enrichers

Filters

Included filters for Logs and RUM:

  • Discard HTTP errors with status code 0
  • Discard HTTP errors with 0 Unknown Error message

These can be imported from: @dineroregnskab/datadog-angular/filters

Templates:

Logs:

export const enricher = (event: LogsEvent): void => { // Append data to log object. }; export const filter = (event: LogsEvent): boolean => { // Return true to discard log. };
  • 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.

RUM:

export const enricher = ( event: RumEvent, context: RumEventDomainContext, ): void => { // Append data to the event context here. }; export const filter = ( event: RumEvent, context: RumEventDomainContext, ): boolean => { // Return true to discard the log. };

Initialization

Initializer will instrument both Logs and RUM.

import type { LogsEvent } from '@datadog/browser-logs'; import type { RumEvent, RumEventDomainContext } from '@datadog/browser-rum'; import { initLogging } from '@dineroregnskab/datadog-angular'; initLogging({ applicationId: '<DATADOG_APPLICATION_ID>', clientToken: '<DATADOG_CLIENT_TOKEN>', site: '<DATADOG_SITE>', service: 'my-web-application', version: '1.0.0', sampleRate: 100, environments: { production: { host: 'app.prod-domain.com', tracingOrigin: 'prod-domain.com', }, test: { host: /^app\.([0-9]+)\.test-domain\.com$/, tracingOrigin: '$1.test-domain.com', }, }, logs: { filters: [], enrichers: [], beforeSend: (log: LogsEvent) => { // Do stuff here before shipping to Logs. } }, rum: { filters: [], enrichers: [], beforeSend: (event: RumEvent, context: RumEventDomainContext) => { // Do stuff here before shipping to RUM. } }, });

Publishing

Before publishing, you will need to run one of the following commands to increment the package version:

npm version patch # will increment to a higher patch npm version minor # will increment to a higher minor npm version major # will increment to a higher major npm version <version> # will set a specific version

Then publish using the following command:

npm run publish:dist
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc