Skip to content

Commit 6c0b200

Browse files
author
Stephen Belanger
committed
feat(transaction): inform context of sampling decision
1 parent 3b4c4a1 commit 6c0b200

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/instrumentation/transaction.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ function Transaction (agent, name, type) {
6464
}
6565
})
6666

67-
this.context = TraceContext.create()
6867
this._defaultName = name || ''
6968
this._customName = ''
7069
this._user = null
@@ -87,6 +86,8 @@ function Transaction (agent, name, type) {
8786
agent.logger.debug('start transaction %o', {id: this.id, name: name, type: type})
8887

8988
this._timer = new Timer()
89+
90+
this.context = TraceContext.create(this.sampled)
9091
}
9192

9293
Transaction.prototype.setUserContext = function (context) {

0 commit comments

Comments
 (0)