elastic / elastic/ecs-dotnet

Adding the field `container.id` to the logs through the log correlation feature

Open
#461 1 comment 1 reaction 0 assignees View on GitHub
agent-dotnet enhancement
Dominant language
HTML
Stars
137
Forks
70
PR merge metrics
No merged PRs in 30d

Description

I believe it would be beneficial to enhance the logs by incorporating `container.id` alongside `ElasticApmTransactionID` and `ElasticApmTraceId` when using the log correlation feature. Currently, the Elastic Agent exclusively includes the `container.id` field in traces and metrics sent to the APM server. While this certainly helps with correlation for linking traces back to logs and also certain metrics back to the infrastructure panel, there are some UI elementals such as `Overview > Instances` and `Transactions > Trace sample > Investigate` where you can click into the container logs and these only work if the `container.id` field is present in the logs

**Describe alternatives you've considered**
The only way to do this currently would be to handle the collection and injection of the container id yourself on the application side but it seems wasteful to perform the same operation twice when the elastic Agent already performs this step and I believe it would be a small but effective addition.

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.