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

feat(tracing): Add Prisma ORM integration. #4931

Merged
merged 11 commits into from Apr 21, 2022
Merged

Conversation

onurtemizkan
Copy link
Collaborator

@onurtemizkan onurtemizkan commented Apr 13, 2022

Adds Prisma ORM Tracing Integration.

This implementation is not auto-instrumented, as we seem to need the instance of PrismaClient supplied to us.

Followed a similar approach with -> #3143 (comment) , using Prisma Client Middleware.

Resolves: #3143

@github-actions
Copy link
Contributor

github-actions bot commented Apr 13, 2022

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 20.22 KB (+0.8% 🔺)
@sentry/browser - ES5 CDN Bundle (minified) 64.37 KB (-0.28% 🔽)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.85 KB (+0.4% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 58.03 KB (+0.13% 🔺)
@sentry/browser - Webpack (gzipped + minified) 23.4 KB (+0.82% 🔺)
@sentry/browser - Webpack (minified) 81.29 KB (-1.41% 🔽)
@sentry/react - Webpack (gzipped + minified) 23.45 KB (+0.84% 🔺)
@sentry/nextjs Client - Webpack (gzipped + minified) 47.99 KB (-0.03% 🔽)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 26.07 KB (+0.35% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 24.43 KB (+0.11% 🔺)

@vladanpaunovic
Copy link
Contributor

@onurtemizkan can you please fix the lint error?

@onurtemizkan
Copy link
Collaborator Author

@onurtemizkan can you please fix the lint error?

Disabled the max-lines rule for hubextensions.ts, as I can't find a nice way to shorten that file.

@onurtemizkan onurtemizkan force-pushed the onur/prisma-orm-integration branch 2 times, most recently from 9f53c2d to fb6d61f Compare April 19, 2022 12:54
onurtemizkan and others added 2 commits April 19, 2022 15:00
@AbhiPrasad
Copy link
Member

I think we can merge this in, @onurtemizkan mind also making some docs for this?

@onurtemizkan
Copy link
Collaborator Author

@AbhiPrasad, Sure 👍

NODE_MAJOR=$(node -v | cut -c2- | cut -d. -f1)

if [ "$NODE_MAJOR" -lt "12" ]; then
echo "Skipping Prisma tests on Node: $NODE_MAJOR"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think going forward we would like everything to be node scripts. Can we convert this to a TS script (we have ts-node in the repo)?

@@ -0,0 +1,22 @@
{
"name": "sentry-prisma-test",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's move this out into another PR so we can discuss the integration test separately? In the mean time, we can add sanity check unit tests to this PR (similar to what we have for mongo for ex.)

@onurtemizkan onurtemizkan force-pushed the onur/prisma-orm-integration branch 2 times, most recently from 5258b74 to 575d843 Compare April 21, 2022 16:17
@AbhiPrasad AbhiPrasad merged commit 1e0e9d6 into 7.x Apr 21, 2022
@AbhiPrasad AbhiPrasad deleted the onur/prisma-orm-integration branch April 21, 2022 17:40
@AbhiPrasad AbhiPrasad added this to the 7.0.0 milestone Apr 25, 2022
Lms24 pushed a commit that referenced this pull request Apr 26, 2022
Co-authored-by: Abhijeet Prasad <aprasad@sentry.io>
lobsterkatie pushed a commit that referenced this pull request Apr 26, 2022
Co-authored-by: Abhijeet Prasad <aprasad@sentry.io>
lobsterkatie pushed a commit that referenced this pull request Apr 26, 2022
Co-authored-by: Abhijeet Prasad <aprasad@sentry.io>
AbhiPrasad added a commit that referenced this pull request May 30, 2022
Co-authored-by: Abhijeet Prasad <aprasad@sentry.io>
@Noitidart
Copy link

Is it possible to add runInTransaction and args to the data part of the span?

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.

None yet

4 participants