elastic / elastic/apm

Agents re-configure applications to replace plain-text formatters with ECS formatters

Open
#373 2 comments 0 reactions 0 assignees View on GitHub
apm-agents meta
Dominant language
Gherkin
Stars
427
Forks
125
PR merge metrics
No merged PRs in 30d

Description

Users can set a configuration option to make APM Agents automatically re-configure logging for them. After opting into it, agents instrument the construction of log appenders (such as file or stdout appenders) and replace the default plain-text formatter (such as `PatternLayout`) with the equivalent from the ECS logger that formats the logs to ECS-compliant JSON.

This is an interesting option when manually changing the logging setup of an application is not a trivial task such as when there are long dev release cycles, onboarding logs for legacy applications, or standard off-the-shelf applications.
Users still have to manually configure Fleet/Filebeat to ship the logs.

This is only feasible for agents that support some kind of instrumentation. This is the result of an early feasibility check per agent:

| Agent | | Comment |
|---|---|---|
| .NET core | ❓ | 1-liner code change is needed. Potentially doable with no code changes via runtime IL manipulation with profiler |
| .NET Framework | ❌ | 1-liner code change needed, Possible for biggest frameworks Serilog and NLog |
| Go | ❌ | 3-liner code change needed |
| Java | ✅ | POC exists |
| Node.js | ✅ | seems feasible |
| PHP | ✅ | seems feasible |
| Python | ✅ | seems feasible |
| Ruby | ✅ | seems feasible |

## Spec issue
- [ ] https://github.com/elastic/apm/issues/403 Milestone

## Agent issues

### Extend ECS logging documentation

- [x] https://github.com/elastic/apm-agent-java/issues/1617 Milestone
- [x] https://github.com/elastic/apm-agent-dotnet/issues/1130 Milestone
- [x] https://github.com/elastic/apm-agent-go/issues/869 Milestone
- [ ] https://github.com/elastic/apm-agent-php/issues/321 Milestone
- [x] https://github.com/elastic/apm-agent-ruby/issues/931 Milestone
- [ ] https://github.com/elastic/apm-agent-nodejs/issues/1943 Milestone
- [x] https://github.com/elastic/apm-agent-python/issues/1007 Milestone

### Support replacement of plain-text formatters with ECS formatters

- [x] https://github.com/elastic/apm-agent-java/issues/1616 Milestone
- [ ] https://github.com/elastic/apm-agent-dotnet/issues/1129 Milestone
- [ ] https://github.com/elastic/apm-agent-go/issues/868 Milestone
- [ ] https://github.com/elastic/apm-agent-php/issues/320 Milestone
- [x] https://github.com/elastic/apm-agent-ruby/issues/930 Milestone
- [ ] https://github.com/elastic/apm-agent-nodejs/issues/1942 Milestone
- [x] https://github.com/elastic/apm-agent-python/issues/1006 Milestone

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.