import type * as ioredisTypes from 'ioredis' ; import { InstrumentationConfig } from '@opentelemetry/instrumentation' ; import { Span } from '@opentelemetry/api' ; export interface IORedisCommand { reject : ( err : Error ) => void ; resolve : ( result : { } ) => void ; promise : Promise < { } > ; args : Array < string | Buffer | number > ; callback : ioredisTypes . CallbackFunction < unknown > ; name : string ; } param cmdName param cmdArgs returns export type DbStatementSerializer = ( cmdName : IORedisCommand [ 'name' ] , cmdArgs : IORedisCommand [ 'args' ] ) => string ; export interface IORedisRequestHookInformation { moduleVersion ? : string ; cmdName : IORedisCommand [ 'name' ] ; cmdArgs : IORedisCommand [ 'args' ] ; } export interface RedisRequestCustomAttributeFunction { ( span , requestInfo ) : void ; } param span param cmdName param cmdArgs param response export interface RedisResponseCustomAttributeFunction { ( span , cmdName , cmdArgs , response ) : void ; } /**
 * Options available for the IORedis Instrumentation (see [documentation](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-instrumentation-ioredis#ioredis-instrumentation-options))
 */ export interface IORedisInstrumentationConfig extends InstrumentationConfig { /** Custom serializer function for the db.statement tag */ dbStatementSerializer ? : DbStatementSerializer ; /** Function for adding custom attributes on db request */ requestHook ? : RedisRequestCustomAttributeFunction ; /** Function for adding custom attributes on db response */ responseHook ? : RedisResponseCustomAttributeFunction ; /** Require parent to create ioredis span, default when unset is true */ requireParentSpan ? : boolean ; }