Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing dependencies for instrumentations when upgrading to v0.31.0 #1107

Closed
adrienrn opened this issue Aug 2, 2022 · 2 comments
Closed
Assignees
Labels
bug Something isn't working priority:p1 Bugs which cause problems in end-user applications such as crashes, data inconsistencies

Comments

@adrienrn
Copy link

adrienrn commented Aug 2, 2022

What version of OpenTelemetry are you using?

I'm updating @opentelemetry/auto-instrumentations-node from 0.27.1 to 0.31.0

What version of Node are you using?

v16.13.1

What did you do?

Dependabot opened a PR to bump @opentelemetry/auto-instrumentations-node from 0.27.1 to 0.31.0, e.g. it only changed the version and updated yarn.lock.

What did you expect to see?

My app is not building when running typescript.

What did you see instead?

Building the app, I'm getting the following errors on types for a few instrumentations. I'd expect them to register their dependencies instead of requiring those to be added to my project package.json.

yarn run v1.22.4
$ tsc
node_modules/@opentelemetry/instrumentation-aws-sdk/build/src/aws-sdk.d.ts:1:27 - error TS2307: Cannot find module 'aws-sdk' or its corresponding type declarations.

1 import type * as AWS from 'aws-sdk';
                            ~~~~~~~~~

node_modules/@opentelemetry/instrumentation-aws-sdk/build/src/types.d.ts:3:27 - error TS2307: Cannot find module 'aws-sdk' or its corresponding type declarations.

3 import type * as AWS from 'aws-sdk';
                            ~~~~~~~~~

node_modules/@opentelemetry/instrumentation-cassandra-driver/build/src/instrumentation.d.ts:4:39 - error TS2307: Cannot find module 'cassandra-driver' or its corresponding type declarations.

4 import type * as CassandraDriver from 'cassandra-driver';
                                        ~~~~~~~~~~~~~~~~~~

node_modules/@opentelemetry/instrumentation-knex/build/src/instrumentation.d.ts:3:28 - error TS2307: Cannot find module 'knex' or its corresponding type declarations.

3 import type * as knex from 'knex';
                             ~~~~~~

node_modules/@opentelemetry/instrumentation-mysql2/build/src/instrumentation.d.ts:2:34 - error TS2307: Cannot find module 'mysql2' or its corresponding type declarations.

2 import type * as mysqlTypes from 'mysql2';
                                   ~~~~~~~~

Additional context

Two current workaround:

  • If I add these packages to my own package.json, works!
  • Use skipLibCheck: true in the TS config, works!
{
  "name": "xxxxx",
  "private": true,
  "version": "0.0.0",
  "description": "xxxxx",
  "main": "index.ts",
  "engines": {
    "node": ">=14.16.0"
  },
  "engineStrict": true,
  "scripts": {
    "build": "tsc",
  },
  "keywords": [
    "graphql",
    "api",
    "gateway"
  ],
  "license": "ISC",
  "devDependencies": {
    "@babel/core": "^7.18.6",
    "@babel/preset-env": "^7.18.9",
    "@graphql-codegen/cli": "2.5.0",
    "@graphql-codegen/typescript": "2.4.2",
    "@graphql-codegen/typescript-resolvers": "2.4.3",
    "@openapitools/openapi-generator-cli": "^2.4.26",
    "@types/express": "^4.17.13",
    "@types/ioredis": "^4.28.10",
    "@types/jaeger-client": "^3.18.3",
    "@types/jest": "^27.4.0",
    "@types/lodash": "^4.14.178",
    "@types/node": "^17.0.14",
    "@types/ws": "^8.2.2",
    "@urql/core": "^2.5.0",
    "babel-core": "7.0.0-bridge.0",
    "commander": "^8.3.0",
    "concurrently": "^7.2.2",
    "contentful-management": "^7.53.0",
    "contentful-migration": "^4.7.1",
    "husky": "^7.0.4",
    "imurmurhash": "^0.1.4",
    "nodemon": "^2.0.19",
    "prettier": "^2.6.2",
    "pretty-quick": "^3.1.3",
    "ts-jest": "^27.1.2",
    "typescript": "^4.5.4",
    "urql": "^2.2.0",
    "wait-on": "^6.0.0"
  },
  "dependencies": {
    "@apollo/utils.keyvadapter": "^1.1.1",
    "@apollo/utils.keyvaluecache": "^1.0.1",
    "@bmatei/apollo-prometheus-exporter": "^2.1.1",
    "@graphql-tools/graphql-file-loader": "^7.4.0",
    "@graphql-tools/load": "^7.7.0",
    "@graphql-tools/merge": "^8.2.1",
    "@graphql-tools/utils": "^8.6.12",
    "@keyv/redis": "^2.3.9",
    "@lukeed/uuid": "^2.0.0",
    "@opentelemetry/api": "^1.0.4",
    "@opentelemetry/auto-instrumentations-node": "^0.31.0",
    "@opentelemetry/core": "^1.0.0",
    "@opentelemetry/exporter-jaeger": "^1.0.1",
    "@opentelemetry/sdk-trace-base": "^1.0.0",
    "@opentelemetry/sdk-trace-node": "^1.3.0",
    "@sesamecare/model": "22.20220729123435.0",
    "@sesamecare/tracing-tools": "^1.20211227040030.0",
    "apollo-datasource-rest": "^3.6.1",
    "apollo-server-express": "^3.10.0",
    "contentful": "^9.1.28",
    "cookie-parser": "^1.4.6",
    "dataloader": "^2.0.0",
    "dotenv": "^14.3.2",
    "esm": "^3.0.84",
    "express": "^4.17.2",
    "express-prom-bundle": "^6.4.1",
    "fast-sort": "^2.2.0",
    "geo-tz": "^7.0.1",
    "graphql": "^15.8.0",
    "graphql-jit": "^0.7.4",
    "graphql-query-complexity": "^0.11.0",
    "graphql-scalars": "^1.17.0",
    "graphql-tools": "^8.2.12",
    "haversine-js": "^1.0.0",
    "ip": "^1.1.5",
    "jaeger-client": "^3.19.0",
    "jest": "^27.5.0",
    "keyv": "^4.3.3",
    "lodash": "^4.17.21",
    "lodash.get": "^4.4.2",
    "module-alias": "^2.2.2",
    "moment": "^2.29.3",
    "moment-timezone": "^0.5.34",
    "node-fetch": "~2.6.7",
    "prom-client": "^14.0.1",
    "superagent": "^8.0.0",
    "superagent-mock": "^4.0.0",
    "superagent-response-time": "^1.0.3",
    "superagent-use": "^0.1.0",
    "tiny-lru": "^7.0.6",
    "util": "^0.12.4",
    "winston": "^3.5.1"
  },
  "resolutions": {
    "babel-core": "7.0.0-bridge.0",
    "ioredis": "^4"
  },
  "optionalDependencies": {
    "fsevents": "^2.3.2"
  },
}
@adrienrn adrienrn added the bug Something isn't working label Aug 2, 2022
@dyladan
Copy link
Member

dyladan commented Aug 2, 2022

Right now skip lib check is probably your best workaround. I think the true solution for this is to either use optional peer dependencies (but that requires npm 7+ which is not bundled with node 14) or to remove dependencies on the vendor types in our instrumentation code.

@dyladan dyladan added the priority:p1 Bugs which cause problems in end-user applications such as crashes, data inconsistencies label Sep 14, 2022
@rauno56
Copy link
Member

rauno56 commented Sep 22, 2022

#1066 fixed this.

@rauno56 rauno56 closed this as completed Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:p1 Bugs which cause problems in end-user applications such as crashes, data inconsistencies
Projects
None yet
Development

No branches or pull requests

3 participants