elastic / elastic-agent

Elastic Agent - single, unified way to add monitoring for logs, metrics, and other types of data to a host.
Other
131 stars 141 forks source link

APMConfig SamplingRate binary float formatting breaks apm-agent-go tracer instrumentation #5711

Closed 1pkg closed 2 weeks ago

1pkg commented 2 weeks ago

Description

The changes to support configurable sampling rate for APMConfig in https://github.com/elastic/elastic-agent-client/pull/123 seem to now work as expected. During the course of integrating the change to APM Server in PR, I discovered that sampling_rate is formatted as a binary (hex) with exponent instead of decimal literal without exponent, this breaks subsequent call in apm-agent-go when tracer is initialized via ELASTIC_APM_TRANSACTION_SAMPLE_RATE with a custom sampling rate.

A quick stripped down go playground snippet with the problem.

Steps to Reproduce

On the latest agent build set non empty value to agent.monitoring.apm.sampling_rate for example "0.1".

Image

Related Issues

elasticmachine commented 2 weeks ago

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)