-
Notifications
You must be signed in to change notification settings - Fork 399
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
Prisma instrumentation #1517
Prisma instrumentation #1517
Conversation
…inContext functionality works on datastore-shim
Codecov Report
@@ Coverage Diff @@
## main #1517 +/- ##
==========================================
+ Coverage 96.39% 96.41% +0.01%
==========================================
Files 196 197 +1
Lines 38198 38350 +152
Branches 23 23
==========================================
+ Hits 36822 36974 +152
Misses 1376 1376
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
database_name: parsedUrl.path && decodeURIComponent(parsedUrl.path.split('/')[0]) | ||
} | ||
} catch (err) { | ||
logger.warn('Failed to parse connection string for %s: %s', provider, err.message) |
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.
Is there a reason to prefer format strings over template literals?
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.
not really. template strings are newer and sometimes I'm just used to doing this when logging
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.
Seems alright, should probably just keep the one added symbol with all of the others we already have.
@@ -5,7 +5,7 @@ | |||
|
|||
'use strict' | |||
|
|||
/* eslint sonarjs/cognitive-complexity: ["error", 52] -- TODO: https://issues.newrelic.com/browse/NEWRELIC-5252 */ | |||
/* eslint sonarjs/cognitive-complexity: ["error", 57] -- TODO: https://issues.newrelic.com/browse/NEWRELIC-5252 */ |
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.
revert
Proposed Release Notes
Huge shoutout to @osmanmrtacar for the original contribution 🙏🏻
Links
Details
You can see here the span names. It also connects the app with db.
When using
prisma.$executeRaw
we will name the spans asDatastore/statement/Prisma/$executeRaw(<sql cmd>)/<database name>
I also had to extend the datastore shim which I plan on writing unit tests for to take advantage of the
inContext
method to set the params for the database host/port/db.Lastly, the original PR instrumented
_request
but_executeRequest
seems more appropriate as it's a higher level function that gets called