elastic / elastic/apm-agent-nodejs

Export the default config value

Open
#2,617 3 comments 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

**Is your feature request related to a problem? Please describe.**
Is it possible to get the default value of the `sanitizeFieldNames` config ? I need to append a new value to the default array without having to copy the default value from the doc.

```javascript
import agent from "elastic-apm-node";

const apm = agent.start({
sanitizeFieldNames: [
"password",
"passwd",
"pwd",
"secret",
"*key",
"*token*",
"*session*",
"*credit*",
"*card*",
"*auth*",
"set-cookie",
"pw",
"pass",
"connect.sid",
"MY_NEW_VALUE",
],
});
```

**Describe the solution you'd like**
```javascript
const agent, { getDefaultConfig } from "elastic-apm-node";

const apm = agent.start({
sanitizeFieldNames: [
...getDefaultConfig.sanitizeFieldNames
"MY_NEW_VALUE",
],
});
```

Related to https://github.com/elastic/apm-agent-dotnet/issues/1294

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.