Skip to content

Commit

Permalink
Log error on appsignal.tracer function call
Browse files Browse the repository at this point in the history
We notice that some people, after upgrading to version 3 of our package,
run into crashes with undescriptive error messages.
This happens when `appsignal.tracer()` is called.

To help with the upgrade process, log a message with a link to the
upgrade guide.
  • Loading branch information
tombruijn committed Jan 4, 2023
1 parent dcf78f1 commit 89f5cad
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changesets/log-error-for-appsignal-tracer-function-calls-.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
bump: "patch"
type: "change"
---

Log an error for appsignal.tracer function calls. Inform the user to update instrumentation code to be compatible with the latest version of our package.
6 changes: 6 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,4 +386,10 @@ export class Client {
private storeInGlobal(): void {
global.__APPSIGNAL__ = this
}

tracer(): void {
console.error(
"The `appsignal.tracer()` function was called, but it has been removed in AppSignal for Node.js package version 3.x. Please read our migration guide to upgrade to this new version of our package: https://docs.appsignal.com/nodejs/3.x/migration-guide.html. It is also possible to downgrade to version 2.x, after which this code will work again."
)
}
}

0 comments on commit 89f5cad

Please sign in to comment.