-
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
feat: enable code_level_metrics by default #1723
Conversation
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 you also PR the docs website please? it's says defaulting to false currently. Also there are some unit tests now failing because this is enabled and the tests assert span attrs
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.
tests are broken. just run npm run unit
and you will see
@bizob2828 I'll take care of the docs. |
'request.parameters.route.biz': 'bang' | ||
'request.parameters.route.biz': 'bang', | ||
'code.filepath': | ||
'/Users/bcanzanella/code/node-newrelic/test/unit/shim/webframework-shim.test.js', |
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.
@bizob2828 any suggestion for how to make this generic? checking the entire object won't work unless the value for code.filepath is modified. could check the length of keys and check each key/value pair with the code.filepath doing an endsWith check? thoughts?
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.
instead of t.same
you could just assert the individual attrs.
const attrs = segment.getAttributes()
t.equal(attrs['request.parameters.route.foo'], 'bar')
t.equal(attrs['request.parameters.route.biz'], 'bang')
I'm ok with that. we have other places asserting CLM data
@@ -618,7 +623,13 @@ test('WebFrameworkShim', function (t) { | |||
const segment = wrapped(req) | |||
|
|||
t.ok(segment.attributes) | |||
t.same(segment.getAttributes(), {}) | |||
t.same(segment.getAttributes(), { | |||
'code.filepath': |
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.
@bizob2828 same comment as the other
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.
i would just update this assertion to make sure there are no request parameters.
const attrs = Object.keys(segment.getAttributes())
const requestParams = /request\.parameters.*/
t.notOk(attrs.some((attr) => requestParameters.test(attr)))
5604274
to
8d01374
Compare
ready for another look @bizob2828 |
Codecov Report
@@ Coverage Diff @@
## main #1723 +/- ##
=======================================
Coverage 96.87% 96.87%
=======================================
Files 200 200
Lines 39181 39181
Branches 24 24
=======================================
Hits 37956 37956
Misses 1225 1225
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 |
@planteater looks like the docs were never updated. #1723 (comment) |
@menocomp this is a docs issues. It looks it was missed 4 months ago. We will get it fixed. |
Oops! Looks like I updated the following page, but didn't catch that reference. I'll take care of it. |
Description
Enables code level metrics by default
How to Test
Please describe how you have tested these changes. Have you run the code against an example application?
What steps did you take to ensure that the changes are working correctly?
Related Issues
Please include any related issues or pull requests in this section, using the format
Closes #<issue number>
orFixes #<issue number>
if applicable.