import { FhirError } from "../fhir/errors"; type TelemetryEventKey = "zusTelemetryClick" | "zusTelemetryFocus"; /** * Bootstrap APM Tracing * * @description Starts up DataDog RUM and tracing. Depending on the configuration the * RUM client will decorate requests to allowed origins with x-datadog-trace-id * headers, profile the in-browser app and optionally even record sessions. * Visit the docs for important configuration options. * * https://docs.datadoghq.com/real_user_monitoring/browser/#configuration */ export declare class Telemetry { private static accessToken; private static get telemetryIsAvailable(); private static datadogLoggingEnabled; private static unauthorizedAnalyticBuffer; private static unauthorizedMetricBuffer; static logger: import("@datadog/browser-logs").Logger; static environment: string; static ehr: string; /** * We need to normalize environment name in order to effectively use template * variables on dashboards in Datadog. Otherwise, users of the dashboard would * need to know to select all variations of an environment. */ static setEnv(environment: string): void; static init(environment: string, ehr?: string, allowDataDogLogging?: boolean): void; static setEHR(ehr: string): void; static setBuilder(builderId?: string): void; static setPatientUPID(upid?: string): void; static setUser(accessToken?: string): void; static clearUser(): void; static trackView(viewName: string): void; static logError(error: Error, overrideMessage?: string): Error; static logFhirError(error: FhirError, message: string): void; static trackInteraction(action: string, metadata?: Record & { datadogMetricName?: string; }): void; /** * Metrics names are alphanumeric, lowercase, seperated by only "." or "_" */ private static normalizeMetricName; static shouldSkipSendingMetrics(): boolean; private static deferAnalyticEvent; private static deferMetricEvent; private static flushUnauthorizedAnalyticBuffer; /** * Report a metric to CTW */ static reportMetric(type: string, metric: string, value: number, additionalTags?: string[]): Promise; /** * Report User analytic events */ static analyticsEvent(eventName: string, eventProperties?: Record): Promise; static countMetric(name: string, value?: number, tags?: string[]): void; static histogramMetric(name: string, value: number, tags?: string[]): void; static timeMetric(metric: string, tags?: string[]): () => void; static reportActionSuccess(metric: string, tags?: string[]): void; static reportActionFailure(metric: string, tags?: string[]): void; static processHTMLEvent(target: HTMLElement, telemetryKey: TelemetryEventKey, explicitTargetName?: string): void; private static closestHTMLElement; static reportActiveSession(): Promise; } /** * Wrapper to time a function * * @example * ``` * withTimerMetric(async (requestContext, patient) => { * const data = await getData(requestContext, patient); * return applyTransform(data); * }, "req.data_transform") * ``` */ export declare const withTimerMetric: (fn: (...args: Args) => Promise, name: string, tags?: string[]) => (...args: Args) => Promise; export {}; //# sourceMappingURL=telemetry.d.ts.map