elastic / elastic/apm-agent-nodejs

stackTraceLimit: 0 removes the stacktraces outside of elastic APM

Open
#2,558 1 comment 0 reactions 0 assignees View on GitHub
agent-nodejs community
Dominant language
JavaScript
Stars
594
Forks
244
Avg merge
1d 8h
Merged PRs (30d)
16

Description

**To Reproduce**

The following program :

```js
const apmModule = require('elastic-apm-node');
apmModule.start({
stackTraceLimit: 0,
serverUrl: 'xxx',
secretToken: 'yyy',
active: true,
centralConfig: false,
});

const main = () => {
console.trace('abcd')
console.log(new Error().stack)
}

main()
```

prints :
```
[object Object]
Error
```
(ie. it doesn't print the stack frames)

**Expected behavior**

- `stackTraceLimit: 0` should only disable the stack trace collection for elastic APM, but still show the stack frame in Error.stack or console.trace.
- When doing `console.trace(message)`, the message should be printed instead of `[object Object]`

**Environment (please complete the following information)**

- OS: macOS 11.6.2
- Node.js version:
- APM Server version:
- Agent version: 3.27.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.