@grafana/faro-web-tracing
Version:
Faro web tracing implementation.
34 lines (33 loc) • 1.52 kB
TypeScript
import type { ContextManager, TextMapPropagator } from '@opentelemetry/api';
import type { Instrumentation } from '@opentelemetry/instrumentation';
import type { FetchCustomAttributeFunction } from '@opentelemetry/instrumentation-fetch';
import type { XHRCustomAttributeFunction } from '@opentelemetry/instrumentation-xml-http-request';
import type { ResourceAttributes } from '@opentelemetry/resources';
import type { SpanProcessor } from '@opentelemetry/sdk-trace-web';
import type { Patterns } from '@grafana/faro-core';
import type { API } from '@grafana/faro-web-sdk';
export type InstrumentationOption = Instrumentation | Instrumentation[];
export interface FaroTraceExporterConfig {
api: API;
}
export interface TracingInstrumentationOptions {
resourceAttributes?: ResourceAttributes;
propagator?: TextMapPropagator;
contextManager?: ContextManager;
instrumentations?: InstrumentationOption[];
spanProcessor?: SpanProcessor;
instrumentationOptions?: Omit<DefaultInstrumentationsOptions, 'ignoreUrls'>;
}
export type MatchUrlDefinitions = Patterns;
export type DefaultInstrumentationsOptions = {
ignoreUrls?: MatchUrlDefinitions;
propagateTraceHeaderCorsUrls?: MatchUrlDefinitions;
fetchInstrumentationOptions?: {
applyCustomAttributesOnSpan?: FetchCustomAttributeFunction;
ignoreNetworkEvents?: boolean;
};
xhrInstrumentationOptions?: {
applyCustomAttributesOnSpan?: XHRCustomAttributeFunction;
ignoreNetworkEvents?: boolean;
};
};