Skip to content

Commit 5a170f3

Browse files
committed
fix(ignore): fixing status code ignoration
1 parent e7e6abb commit 5a170f3

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/instrumentations/core/http/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ function wrapListener (listener, agent, mustCollectStore) {
101101
agent.rpmMetrics.addStatusCode(response.statusCode)
102102

103103
if (isStatusCodeIgnored(ignoreStatusCodes, response.statusCode)) {
104-
agent.clearTransaction(requestId)
104+
agent.clearRequest(requestId)
105105
return debug('statusCode %s is ignored', response.statusCode)
106106
}
107107

lib/instrumentations/core/http/server.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ describe('The http.Server.prototype wrapper module', function () {
5858
bind: function () {
5959
return this.sandbox.spy()
6060
}.bind(this),
61-
clearTransaction: this.sandbox.spy(),
61+
clearRequest: this.sandbox.spy(),
6262
rpmMetrics: {
6363
addResponseTime: this.sandbox.spy(),
6464
addStatusCode: this.sandbox.spy()
@@ -138,7 +138,7 @@ describe('The http.Server.prototype wrapper module', function () {
138138
response.writeHead()
139139
cb()
140140

141-
expect(agent.clearTransaction).to.be.calledWith(requestId)
141+
expect(agent.clearRequest).to.be.calledWith(requestId)
142142
expect(agent.rpmMetrics.addResponseTime).to.be.calledWith(0)
143143
expect(agent.rpmMetrics.addStatusCode).to.be.calledWith(401)
144144
expect(agent.serverSend).not.to.have.been.called

0 commit comments

Comments
 (0)