newrelic
Version:
New Relic agent
26 lines (21 loc) • 483 B
JavaScript
/*
* Copyright 2024 New Relic Corporation. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/
module.exports = class TraceStacks {
constructor(config) {
this.stack = config?.logging.diagnostics ? [] : null
}
probe(action, data) {
if (this.stack) {
this.stack.push({
stack: new Error(action).stack.split('\n'),
extra: data
})
}
}
serialize(name) {
return { segment: name, stacks: this.stack }
}
}