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

send activation_method only for 8.7.1+ #781

Closed SylvainJuge closed 1 year ago

SylvainJuge commented 1 year ago

Description

Only send the service.agent.activation_method when APM server is AT LEAST `8.7.1 or unknown (assume it's not 8.7.0 by default).

Specification changes: #780 #783

I found only the following agents are impacted as their code already reference this field: java, dotnet, nodejs and python

Agent Issues

trentm commented 1 year ago

FWIW, this likely means that a fast first Lambda invocation will not send activation_method in metadata, because it will have data to send on before the APM server version check request has time to respond.

SylvainJuge commented 1 year ago

That's a very good point, and it would also be problematic for all the features that depend on agent version.

felixbarny commented 1 year ago

Maybe it's better to optimistically assume that the APM Server version is not 8.7.0 and only disable sending activation_method when the version info request returns. As the bug that leads to document rejection only affects internal metrics which are, by default, scheduled every 30s, there's a good chance that we know about the version of the server before sending the first metrics.

SylvainJuge commented 1 year ago

+1 to send this field when the server version is unknown, and only explicitly omit it when we know it's 8.7.0. Do you think it's worth re-modify the spec for this small but important implementation detail ?

felixbarny commented 1 year ago

yes

SylvainJuge commented 1 year ago

second take for specification: PR #783

SylvainJuge commented 1 year ago

Closing this issue as all impacted agents have been updated.