File tree 3 files changed +8
-8
lines changed
plugins/node/opentelemetry-plugin-redis/src
3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 15
15
*/
16
16
17
17
import { BasePlugin } from '@opentelemetry/core' ;
18
- import type * as redis from 'redis' ;
18
+ import type * as redisTypes from 'redis' ;
19
19
import * as shimmer from 'shimmer' ;
20
20
import {
21
21
getTracedCreateClient ,
@@ -24,7 +24,7 @@ import {
24
24
} from './utils' ;
25
25
import { VERSION } from './version' ;
26
26
27
- export class RedisPlugin extends BasePlugin < typeof redis > {
27
+ export class RedisPlugin extends BasePlugin < typeof redisTypes > {
28
28
static readonly COMPONENT = 'redis' ;
29
29
readonly supportedVersions = [ '^2.6.0' ] ; // equivalent to >= 2.6.0 <3
30
30
Original file line number Diff line number Diff line change 14
14
* limitations under the License.
15
15
*/
16
16
17
- import type { Callback } from 'redis' ;
17
+ import type * as redisTypes from 'redis' ;
18
18
19
19
// exported from
20
20
// https://github.com/NodeRedis/node_redis/blob/master/lib/command.js
21
21
export interface RedisCommand {
22
22
command : string ;
23
23
args : string [ ] ;
24
24
buffer_args : boolean ;
25
- callback : Callback < unknown > ;
25
+ callback : redisTypes . Callback < unknown > ;
26
26
call_on_write : boolean ;
27
27
}
28
28
Original file line number Diff line number Diff line change 14
14
* limitations under the License.
15
15
*/
16
16
17
- import type { RedisClient } from 'redis' ;
17
+ import type * as redisTypes from 'redis' ;
18
18
import { Tracer , SpanKind , Span , CanonicalCode } from '@opentelemetry/api' ;
19
19
import { RedisCommand , RedisPluginClientTypes } from './types' ;
20
20
import { EventEmitter } from 'events' ;
@@ -37,8 +37,8 @@ const endSpan = (span: Span, err?: Error | null) => {
37
37
} ;
38
38
39
39
export const getTracedCreateClient = ( tracer : Tracer , original : Function ) => {
40
- return function createClientTrace ( this : RedisClient ) {
41
- const client : RedisClient = original . apply ( this , arguments ) ;
40
+ return function createClientTrace ( this : redisTypes . RedisClient ) {
41
+ const client : redisTypes . RedisClient = original . apply ( this , arguments ) ;
42
42
return tracer . bind ( client ) ;
43
43
} ;
44
44
} ;
@@ -47,7 +47,7 @@ export const getTracedCreateStreamTrace = (
47
47
tracer : Tracer ,
48
48
original : Function
49
49
) => {
50
- return function create_stream_trace ( this : RedisClient ) {
50
+ return function create_stream_trace ( this : redisTypes . RedisClient ) {
51
51
if ( ! this . stream ) {
52
52
Object . defineProperty ( this , 'stream' , {
53
53
get ( ) {
You can’t perform that action at this time.
0 commit comments