Reintroduce support for `fields` configuration
- Dominant language
- Go
- Stars
- 1.3k
- Forks
- 543
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 109
Description
When we switched to the new ES output in 8.0, we dropped support for adding statically defined fields to all events received by apm-server. Beats has this configuration:
```
# Optional fields that you can specify to add additional information to the
# output.
#fields:
# env: staging
```
This can be used for setting environment-wide fields, such as `service.environment` or `orchestrator.cluster.name`. The only practical alternative that I can think of would be to set global labels on all agents feeding into the apm-server in that environment.
We should consider reintroducing this configuration. There would likely need to be two implementations of this -- one for libbeat outputs, and one for the docappender output. For the latter, it can be implemented by using `sjson` (or similar) after marshalling an event to JSON: https://github.com/elastic/apm-server/blob/52cf775fa30903591edf5c58e5b10fd7478dfe23/internal/beater/processors.go#L96-L99
Contributor guide
Assessment
This issue has not been assessed yet.