10000 test(node): Add integration test for Postgres auto-instrumentation. by onurtemizkan · Pull Request #4804 · getsentry/sentry-javascript · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 3 commits into from
Mar 28, 2022

Conversation

onurtemizkan
Copy link
Collaborator
@onurtemizkan onurtemizkan commented Mar 28, 2022

Part of: #4762

Also, not adding pg-native tests, as that package has platform specific dependencies that require separate installations.

@onurtemizkan onurtemizkan added this to the Release Stability milestone Mar 28, 2022
@AbhiPrasad AbhiPrasad mentioned this pull request Mar 28, 2022
19 tasks
});

const client = new pg.Client();
client.query('test_query', ['a', 'b'], () => transaction.finish());
Copy link
Member

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.

Copy link
Collaborator Author

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',
Copy link
Member

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?

Copy link
Collaborator Author

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.

@AbhiPrasad AbhiPrasad enabled auto-merge (squash) March 28, 2022 16:25
@AbhiPrasad AbhiPrasad merged commit 4260f12 into master Mar 28, 2022
@AbhiPrasad AbhiPrasad deleted the onur/node-int-tests-postgres-auto-instrument branch March 28, 2022 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0