Skip to content

Commit b043dff

Browse files
committed
fix(mustCollect): place mustCollect setting to the right place
1 parent a4da5ea commit b043dff

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/providers/httpTransaction/wraps/http.Server.prototype.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ function wrapListener(listener, collector, config) {
6464
*/
6565
function instrumentedFinish () {
6666

67-
mustCollect = mustCollect || response.statusCode > 399;
68-
6967
var collectorDataBag = {
7068
mustCollect: mustCollect,
7169
id: requestId,
@@ -86,6 +84,7 @@ function wrapListener(listener, collector, config) {
8684

8785
response.writeHead = function () {
8886
serverSendTime = microtime.now();
87+
mustCollect = mustCollect || response.statusCode > 399;
8988

9089
/* Service name may be unavailable due to uninitialized reporter */
9190
var serviceName = collector.getService();

0 commit comments

Comments
 (0)