-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
test(node): Add integration test for Postgres auto-instrumentation. #4804
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
test(node): Add integration test for Postgres auto-instrumentation. #4804
Conversation
}); | ||
|
||
const client = new pg.Client(); | ||
client.query('test_query', ['a', 'b'], () => transaction.finish()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we look at nested queries? Also simulate actual queries like SELECT * ...
? TIL that we literally on instrument .query
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AbhiPrasad, updated 👍
expect(envelope).toHaveLength(3); | ||
|
||
assertSentryTransaction(envelope[2], { | ||
transaction: 'Test Transaction', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we assert a proper parent-child relationship between the spans?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked again and looks like these are not really nested queries, just serialized. So, each is a child of the main transaction. Sub-queries seem to be handled on query level, and our integration is not covering it.
Part of: #4762
Also, not adding
pg-native
tests, as that package has platform specific dependencies that require separate installations.