Datadog
This package provides the functions to report metrics to Datadog.
Usage
Import the required function from the package:
import { ... } form '@shared/datadog'
The list of available functions to report metrics:
const datadogIncrement: (stat: string, tags?: string[], value?: null | number)
const datadogTiming: (stat: string, value: number, tags?: string[])
const datadogHistogram: (stat: string, value: number, tags?: string[])
The package also provides some generally useful functions for reporting:
// The function that tracks the React component loading time based on the isLoading flag changes
const useLoadTimeTracking: (metricName: string, isLoading: boolean, shouldTrackFirstLoad?: boolean)