diff --git a/lib/config/default.js b/lib/config/default.js index ec0b6e5d0e..fc9141ae13 100644 --- a/lib/config/default.js +++ b/lib/config/default.js @@ -1221,7 +1221,7 @@ defaultConfig.definition = () => ({ code_level_metrics: { enabled: { formatter: boolean, - default: false + default: true } }, diff --git a/test/unit/config/config-defaults.test.js b/test/unit/config/config-defaults.test.js index 54ae8e955a..69d23f58cd 100644 --- a/test/unit/config/config-defaults.test.js +++ b/test/unit/config/config-defaults.test.js @@ -266,8 +266,8 @@ tap.test('with default properties', (t) => { t.end() }) - t.test('should default `code_level_metrics.enabled` to false', (t) => { - t.equal(configuration.code_level_metrics.enabled, false) + t.test('should default `code_level_metrics.enabled` to true', (t) => { + t.equal(configuration.code_level_metrics.enabled, true) t.end() }) diff --git a/test/unit/shim/webframework-shim.test.js b/test/unit/shim/webframework-shim.test.js index 932ddbc8ef..5cd325c881 100644 --- a/test/unit/shim/webframework-shim.test.js +++ b/test/unit/shim/webframework-shim.test.js @@ -599,10 +599,14 @@ test('WebFrameworkShim', function (t) { const segment = wrapped(req) t.ok(segment.attributes) - t.same(segment.getAttributes(), { - 'request.parameters.route.foo': 'bar', - 'request.parameters.route.biz': 'bang' - }) + const attrs = segment.getAttributes() + t.equal(attrs['request.parameters.route.foo'], 'bar') + t.equal(attrs['request.parameters.route.biz'], 'bang') + const filePathSplit = attrs['code.filepath'].split('/') + t.equal(filePathSplit[filePathSplit.length - 1], 'webframework-shim.test.js') + t.equal(attrs['code.function'], 'getActiveSegment') + t.equal(attrs['code.lineno'], 37) + t.equal(attrs['code.column'], 50) t.end() }) }) @@ -618,7 +622,10 @@ test('WebFrameworkShim', function (t) { const segment = wrapped(req) t.ok(segment.attributes) - t.same(segment.getAttributes(), {}) + const attrs = Object.keys(segment.getAttributes()) + const requestParameters = /request\.parameters.*/ + + t.notOk(attrs.some((attr) => requestParameters.test(attr))) t.end() }) })