Add bool to show when execution tracker gets created.

This commit is contained in:
Sam Rose 2024-01-08 09:52:07 +00:00
parent 6c20799b92
commit d5850d59de
No known key found for this signature in database
1 changed files with 4 additions and 1 deletions

View File

@ -12,10 +12,13 @@ export function init() {
const perRequestLimit = env.JS_PER_REQUEST_TIME_LIMIT_MS
let track: TrackerFn = f => f()
if (perRequestLimit) {
tracer.trace("runJS.setupTracker", {}, span => {
tracer.trace<any>("runJS.setupTracker", {}, span => {
const bbCtx = context.getCurrentContext()
if (bbCtx) {
if (!bbCtx.jsExecutionTracker) {
span?.addTags({
createdExecutionTracker: true,
})
bbCtx.jsExecutionTracker =
timers.ExecutionTimeTracker.withLimit(perRequestLimit)
}