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

Add specs for host.id and profiler registration message #853

Closed JonasKunz closed 8 months ago

JonasKunz commented 8 months ago

The UI for profiling data relies on the host.id field for certain calculations, including the cost and CO2-consumption estimates. In order to correctly provide those values for profiling data stored on transaction documents, those need to have the host.id too.

Therefore this spec adds the host.id as an optional, new metadata field for IntakeV2. The field is only required to be populated when an agent actually is correlating transactions with profiling data.

Because the otel-compliant host.id can sometimes only be derived correctly with root permissions, this spec change also adds a way of receiving the host.id directly from the profiling host agent.

trentm commented 7 months ago

As mentioned at https://github.com/elastic/beats/issues/38689#issuecomment-2039311012 using host.id for host correlation is probably the best path for future host correlation. Should we get a meta issue so agents other than the Java agent start adding host.id?

JonasKunz commented 7 months ago

The agent also won't always collect the host.id, it only does so if the profiler is active and the profiler provides the host.id. The problem with host.id is that sometimes it might not be possible to discover the host.id without root permissions, at least accoding to the Otel SemConv specs.

xrmx commented 7 months ago

The agent also won't always collect the host.id, it only does so if the profiler is active and the profiler provides the host.id.

That's not what I get from the specs. If we shouldn't provide it ourselves without the profiler it would be nice to write it explicitly.

JonasKunz commented 7 months ago

The agent also won't always collect the host.id, it only does so if the profiler is active and the profiler provides the host.id.

Sorry, I was referring to the planned implementation details of the java-agent.

The current wording is

APM agents MAY collect the host.id as an unique identifier for the host.

This means agents are not required to do so, but might if they want to. It should be changed to MUST if we desire to force all agents to provide the host.id.