Skip to content

Commit 806663b

Browse files
author
Naseem
committed
fix: address cr -- import entire module rather than only used exports
Signed-off-by: Naseem <[email protected]>
1 parent 91213fa commit 806663b

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

plugins/node/opentelemetry-plugin-redis/src/redis.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
import { BasePlugin } from '@opentelemetry/core';
18-
import type * as redis from 'redis';
18+
import type * as redisTypes from 'redis';
1919
import * as shimmer from 'shimmer';
2020
import {
2121
getTracedCreateClient,
@@ -24,7 +24,7 @@ import {
2424
} from './utils';
2525
import { VERSION } from './version';
2626

27-
export class RedisPlugin extends BasePlugin<typeof redis> {
27+
export class RedisPlugin extends BasePlugin<typeof redisTypes> {
2828
static readonly COMPONENT = 'redis';
2929
readonly supportedVersions = ['^2.6.0']; // equivalent to >= 2.6.0 <3
3030

plugins/node/opentelemetry-plugin-redis/src/types.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
* limitations under the License.
1515
*/
1616

17-
import type { Callback } from 'redis';
17+
import type * as redisTypes from 'redis';
1818

1919
// exported from
2020
// https://github.com/NodeRedis/node_redis/blob/master/lib/command.js
2121
export interface RedisCommand {
2222
command: string;
2323
args: string[];
2424
buffer_args: boolean;
25-
callback: Callback<unknown>;
25+
callback: redisTypes.Callback<unknown>;
2626
call_on_write: boolean;
2727
}
2828

plugins/node/opentelemetry-plugin-redis/src/utils.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import type { RedisClient } from 'redis';
17+
import type * as redisTypes from 'redis';
1818
import { Tracer, SpanKind, Span, CanonicalCode } from '@opentelemetry/api';
1919
import { RedisCommand, RedisPluginClientTypes } from './types';
2020
import { EventEmitter } from 'events';
@@ -37,8 +37,8 @@ const endSpan = (span: Span, err?: Error | null) => {
3737
};
3838

3939
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);
4242
return tracer.bind(client);
4343
};
4444
};
@@ -47,7 +47,7 @@ export const getTracedCreateStreamTrace = (
4747
tracer: Tracer,
4848
original: Function
4949
) => {
50-
return function create_stream_trace(this: RedisClient) {
50+
return function create_stream_trace(this: redisTypes.RedisClient) {
5151
if (!this.stream) {
5252
Object.defineProperty(this, 'stream', {
5353
get() {

0 commit comments

Comments
 (0)