elastic / apm

Elastic Application Performance Monitoring - resources and general issue tracking for Elastic APM.
https://www.elastic.co/apm
Apache License 2.0
384 stars 114 forks source link

Enhance ECS logging correlation fields #765

Closed SylvainJuge closed 1 year ago

SylvainJuge commented 1 year ago

Out of scope for now

felixbarny commented 1 year ago

question: should we include the container.id in the agents specification too ?

I think it doesn't hurt mentioning it but there's nothing that agents need to do as they already send the container.id as part of the metadata. The container.id correlation is more relevant when shipping the logs with Filebeat and when there's no service.name within the logs.

documentation: document the log correlation fields (both service-level and trace-level) in the "log-correlation" section:

+1 on improving the docs to point out how service/log correlation works and how to configure Filebeat or Elastic Agent to add service.name/service.environment metadata. The guide also focusses mainly on the semi-deprecated Filebeat and misses to mention Elastic Agent.

SylvainJuge commented 1 year ago

I've added a mention of container.id in https://github.com/elastic/apm/pull/766/commits/6b9968f8a21a81a85ba8c7820f082dc76f771082

+1 for the documentation part, I will add it to the shopping list in this issue description, same for providing the configuration options to set those fields in the filebeat configuration and maybe in ECS-logging. When the APM agent is combined with ECS-logging library I would recommend to let the agent provide its own values though to avoid inconsistencies.

For the fact that Elastic Agent isn't mentioned, I think it would be better handled as a follow-up once this part is done. I haven't tried using "Custom logs" integration yet, but that should not be very different from the filebeat configuration that we currently offer.

SylvainJuge commented 1 year ago

Closing as specs and documentation are complete, implementation in agents is not 100% complete for service environment correlation see https://github.com/elastic/apm/issues/773 for details.