autotel
Version:
Write Once, Observe Anywhere
66 lines (65 loc) • 2.15 kB
TypeScript
import { t as ILogger } from "./logger-BauSUhUv.js";
import { Meter, Tracer } from "@opentelemetry/api";
//#region src/config.d.ts
declare const FEATURE_FLAGS: {
/** Enable full auto-instrumentation (expensive, production only) */readonly ENABLE_AUTO_INSTRUMENTATION: boolean; /** Enable verbose logging (development only) */
readonly ENABLE_VERBOSE_LOGGING: boolean; /** Enable metrics collection (production only) */
readonly ENABLE_METRICS_BY_DEFAULT: boolean; /** Enable async resource detection (production only) */
readonly ENABLE_RESOURCE_DETECTION: boolean; /** Enable tracing in all environments (can be disabled via autotel_TRACING=false) */
readonly ENABLE_TRACING: boolean; /** Enable log redaction for sensitive fields (can be disabled via autotel_REDACTION=false) */
readonly ENABLE_REDACTION: boolean;
};
/**
* Runtime configuration for OpenTelemetry instrumentation
*
* This configures the tracer and meter used by autotel's functional API.
* Use `configure()` to set custom tracer/meter instances.
*/
interface RuntimeConfig {
/**
* Tracer name for OpenTelemetry
* @default 'app'
*/
tracerName?: string;
/**
* Meter name for OpenTelemetry metrics
* @default 'app'
*/
meterName?: string;
/**
* Custom tracer instance (for advanced use cases like Datadog direct)
* @default trace.getTracer(tracerName)
*/
tracer?: Tracer;
/**
* Custom meter instance
* @default metrics.getMeter(meterName)
*/
meter?: Meter;
}
/**
* Configure global instrumentation behavior
*
* @example
* ```typescript
* import { configure } from 'autotel/config'
*
* configure({
* tracerName: 'my-app'
* })
* ```
*/
declare function configure(options: RuntimeConfig): void;
/**
* Get current configuration (internal use)
*/
declare function getConfig(): Required<RuntimeConfig> & {
featureFlags: typeof FEATURE_FLAGS;
};
/**
* Reset configuration to defaults (internal use - mainly for testing)
*/
declare function resetConfig(): void;
//#endregion
export { FEATURE_FLAGS, type ILogger, RuntimeConfig, configure, getConfig, resetConfig };
//# sourceMappingURL=config.d.ts.map