@embrace-io/web-sdk
Version:
51 lines • 2 kB
TypeScript
import { EmbraceInstrumentationBaseArgs } from "../../EmbraceInstrumentationBase/types.js";
import "../../EmbraceInstrumentationBase/index.js";
import { Span } from "@opentelemetry/api";
//#region src/instrumentations/document-load/DocumentLoadInstrumentation/types.d.ts
type DocumentLoadCustomAttributeFunction = (span: Span) => void;
type ResourceFetchCustomAttributeFunction = (span: Span, resource: PerformanceResourceTiming) => void;
type DocumentLoadInstrumentationConfig = Pick<EmbraceInstrumentationBaseArgs, 'diag' | 'perf'> & {
/** Function for adding custom attributes on the document load, document fetch and or resource fetch spans */
applyCustomAttributesOnSpan?: {
documentLoad?: DocumentLoadCustomAttributeFunction;
documentFetch?: DocumentLoadCustomAttributeFunction;
resourceFetch?: ResourceFetchCustomAttributeFunction;
};
/** Ignore adding network events as span events for document fetch and resource fetch spans.
* This instrumentation will send the following span events by default:
* connectEnd
* connectStart
* decodedBodySize
* domComplete
* domContentLoadedEventEnd
* domContentLoadedEventStart
* domInteractive
* domainLookupEnd
* domainLookupStart
* encodedBodySize
* fetchStart
* loadEventEnd
* loadEventStart
* navigationStart
* redirectEnd
* redirectStart
* requestStart
* responseEnd
* responseStart
* secureConnectionStart
* unloadEventEnd
* unloadEventStart
*/
ignoreNetworkEvents?: boolean;
/** Ignore adding performance paint span events on document load spans
* This instrumentation will send the following span events by default:
* firstContentfulPaint
* firstPaint
*/
ignorePerformancePaintEvents?: boolean;
/** Whether the instrumentation is enabled */
enabled?: boolean;
};
//#endregion
export { DocumentLoadCustomAttributeFunction, DocumentLoadInstrumentationConfig, ResourceFetchCustomAttributeFunction };
//# sourceMappingURL=types.d.ts.map