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

fix(instrumentation-knex): Support better-sqlite3 errors #2650

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
179 changes: 87 additions & 92 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
Expand Up @@ -48,7 +48,8 @@
"@opentelemetry/sdk-trace-node": "^1.8.0",
"@types/mocha": "7.0.2",
"@types/node": "18.18.14",
"knex": "0.95.9",
"better-sqlite3": "11.0.0",
"knex": "3.1.0",
"nyc": "15.1.0",
"rimraf": "5.0.10",
"sqlite3": "5.1.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ export class KnexInstrumentation extends InstrumentationBase<KnexInstrumentation
const formatter = utils.getFormatter(this);
const fullQuery = formatter(query.sql, query.bindings || []);
const message = err.message.replace(fullQuery + ' - ', '');
const clonedError = utils.cloneErrorWithNewMessage(err, message);
span.recordException(clonedError);
const exc = utils.otelExceptionFromKnexError(err, message);
span.recordException(exc);
span.setStatus({ code: api.SpanStatusCode.ERROR, message });
span.end();
throw err;
Expand Down
Loading
Loading