Skip to content

Commit

Permalink
Runtime dep @opentelemetry/sdk-trace-base package (#685)
Browse files Browse the repository at this point in the history
In PR #659 we tried to import the OpenTelemetry types at compile time
and include them in our own package, but that's not how TypeScript's
`import type` turns out to work.

This breaks the app for non-OpenTelemetry users as reported in #684. The
easiest fix we can ship right now is to add the package as a runtime
dependency rather than only a development dependency.

Ideally though, we do not ship additional dependencies for thing not all
our users use, but we can figure that out after this immediate fix.

I had missed this in PR #659, but we've also already included the
`@opentelemetry/api` as a dependency since PR #651. Already doing the
same this change does for the `@opentelemetry/sdk-trace-base` package.
  • Loading branch information
tombruijn committed Jun 8, 2022
1 parent f9018df commit 1731c8e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
12 changes: 2 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
bump: "patch"
type: "fix"
---

Add `@opentelemetry/sdk-trace-base` package runtime dependency. Our OpenTelemetry SpanProcessor needs this package at runtime, not just at compile time.
4 changes: 2 additions & 2 deletions packages/nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@appsignal/core": "^1.1.4",
"@appsignal/types": "^3.0.0",
"@opentelemetry/api": "^1.0.4",
"@opentelemetry/sdk-trace-base": "^1.2.0",
"node-addon-api": "^3.1.0",
"node-gyp": "^9.0.0",
"require-in-the-middle": "^5.1.0",
Expand All @@ -30,8 +31,7 @@
"@types/semver": "*",
"nock": "^13.2.2",
"pg": "*",
"redis": "*",
"@opentelemetry/sdk-trace-base": "^1.2.0"
"redis": "*"
},
"scripts": {
"build": "tsc -p tsconfig.json",
Expand Down

0 comments on commit 1731c8e

Please sign in to comment.