@ogcio/o11y-sdk-react
Version:
Opentelemetry standard instrumentation SDK for React based project
75 lines • 2.47 kB
TypeScript
import { BasicRedactor } from "../../sdk-core/lib/redaction/basic-redactor.js";
import type { MetaApp } from "@grafana/faro-core/dist/types/metas/index.js";
interface SDKConfig {
/**
* The opentelemetry collector entrypoint GRPC url.
* If the collectoUrl is null or undefined, the instrumentation will not be activated.
* @example http://alloy:4317
*/
collectorUrl: string;
/**
* Name of your application used for the collector to group logs
*/
serviceName?: string;
/**
* Diagnostic log level for the internal runtime instrumentation
*
* @type string
* @default INFO
*/
diagLogLevel?: SDKLogLevel;
/**
* Collector signals processing mode.
* signle: makes an http/grpc request for each signal and it is immediately processed inside grafana
* batch: sends multiple signals within a time window, optimized to reduce http/grpc calls in production
*
* @type string
* @default batch
*/
collectorMode?: SDKCollectorMode;
/**
* Custom app metadata fields to be added to the signal.
* see https://grafana.com/docs/grafana-cloud/monitor-applications/frontend-observability/architecture/metas/ for more details
*
* @type MetaApp
* @default { name: this.serviceName }
*/
appMeta?: MetaApp;
}
export interface FaroSDKConfig extends SDKConfig {
/**
* String with single or multiple URLs separated by comma used by the instrumentation to ignore CORS errors and send signals through it
* @example http://localhost:9000,http://localhost:8000
* @example http://localhost:9000
*/
corsTraceHeaders?: string;
/**
* Enable/Disable PII detection for GDPR data
*/
detection?: {
/**
* Redact email addresses
* @default true
*/
email?: boolean;
/**
* Redact ip addresses
* @default true
*/
ip?: boolean;
/**
* Redact ppsn (personal public service number)
* @default true
*/
ppsn?: boolean;
/**
* Custom redactors to be added together with the default ones
* @default []
*/
custom?: BasicRedactor[];
};
}
export type SDKCollectorMode = "single" | "batch";
export type SDKLogLevel = "NONE" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "VERBOSE" | "ALL";
export * from "./hooks/index.js";
//# sourceMappingURL=index.d.ts.map