trying to instrument my nodejs application but I g...
# support
m
trying to instrument my nodejs application but I get this.
src/public/utils/redis.ts:15:40 - error TS2769: No overload matches this call.
#11 37.34   The last overload gave the following error.
#11 37.34     Argument of type '{ host: string; port: string; }' is not assignable to parameter of type 'ClientOpts'.
#11 37.34       Types of property 'port' are incompatible.
#11 37.34         Type 'string' is not assignable to type 'number'.
#11 37.34
#11 37.34 15 const redisClient = redis.createClient(redisClientConfig);
each time I try to start the application
p
@maduabuchi Can you share what steps are you using to instrument your nodejs application?
@Prashant Shahi Do you have any idea on possible causes for this?
p
@maduabuchi it seems like unrelated to OpenTelemetry instrumentation but redis. Anyways, it looks like
port
is set as
string
, it is required to be of type
number
For example:
Copy code
const redisClientConfig: redis.ClientOpts = {
    host: '127.0.0.1',
    port: 6379
};
m
this only happens once I install the following dependencies as stated in the website under instrumenting applications •
@opentelemetry/api
@opentelemetry/auto-instrumentations-node
@opentelemetry/exporter-otlp-grpc
@opentelemetry/sdk-node
@Pranay I install the following dependecies •
@opentelemetry/api
@opentelemetry/auto-instrumentations-node
@opentelemetry/exporter-otlp-grpc
@opentelemetry/sdk-node
then I created a tracing.js page and added the instrumentation code
N/B I am trying to dockerize the application also
p
@Vishal Sharma any idea on this?