Skip to content

Commit 1d90e33

Browse files
mattcolegatetobespc
authored andcommitted
Move http(s) timing contexts into the request level (#592)
1 parent 7fde6cc commit 1d90e33

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

probes/http-probe.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,11 @@ HttpProbe.prototype.attach = function(name, target) {
4545
// Filter out urls where filter.to is ''
4646
var traceUrl = that.filterUrl(httpReq);
4747
if (traceUrl !== '') {
48-
that.metricsProbeStart(probeData, httpReq.method, traceUrl);
49-
that.requestProbeStart(probeData, httpReq.method, traceUrl);
50-
aspect.after(res, 'end', probeData, function(obj, methodName, args, probeData, ret) {
48+
// Issue #590 - need to keep the probedata context separate from other requests
49+
var context = {};
50+
that.metricsProbeStart(context, httpReq.method, traceUrl);
51+
that.requestProbeStart(context, httpReq.method, traceUrl);
52+
aspect.after(res, 'end', context, function(obj, methodName, args, probeData, ret) {
5153
that.metricsProbeEnd(probeData, httpReq.method, traceUrl, res, httpReq);
5254
that.requestProbeEnd(probeData, httpReq.method, traceUrl, res, httpReq);
5355
});

probes/https-probe.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@ HttpsProbe.prototype.attach = function(name, target) {
4747
// Filter out urls where filter.to is ''
4848
var traceUrl = that.filterUrl(httpsReq);
4949
if (traceUrl !== '') {
50-
that.metricsProbeStart(probeData, httpsReq.method, traceUrl);
51-
that.requestProbeStart(probeData, httpsReq.method, traceUrl);
52-
aspect.after(res, 'end', probeData, function(obj, methodName, args, probeData, ret) {
50+
// Issue #590 - need to keep the probedata context separate from other requests
51+
var context = {};
52+
that.metricsProbeStart(context, httpsReq.method, traceUrl);
53+
that.requestProbeStart(context, httpsReq.method, traceUrl);
54+
aspect.after(res, 'end', context, function(obj, methodName, args, probeData, ret) {
5355
that.metricsProbeEnd(probeData, httpsReq.method, traceUrl, res, httpsReq);
5456
that.requestProbeEnd(probeData, httpsReq.method, traceUrl, res, httpsReq);
5557
});

0 commit comments

Comments
 (0)