#53390·beats

[beatreceiver] Agent info is empty in OTel mode

Author: khushijain21Created Sep 24, 2026Updated Sep 28, 2026
LabelsbugTeam:Elastic-Agent-Data-PlaneBeatReceiver:MakeItRight

Summary

In OTel mode, OtelManager exposes no Agent information:

go
// x-pack/otel/otelmanager/manager.go
func (n *OtelManager) Enabled() bool                   { return false }
func (n *OtelManager) AgentInfo() management.AgentInfo { return management.AgentInfo{} }

As a result, anything in a beat receiver that depends on Agent info is wrong on main.

Bugs

1. User-Agent reports Standalone

userAgentMode() in libbeat/beat/beat.go returns Standalone when Enabled() is false, so every receiver sends:

Elastic-metricbeat/9.6.0 (darwin; arm64; Standalone)

even though it runs under Elastic Agent. The privilege mode is also dropped. This header is used by Metricbeat module HTTP requests (metricbeat/helper/http.go).

2. Version override never runs

The if b.Manager.AgentInfo().Version != "" block in NewBeatForReceiver (x-pack/libbeat/cmd/instance/beat.go) is dead code, because AgentInfo() is always empty. It's harmless today only because the Beat and Agent versions come from the same build.

Watch out when fixing

Replacing Enabled() with management.UnderAgent() (as in #53348) makes it worse. The zero value of AgentInfo means ManagedMode = MANAGED and Unprivileged = false, so every receiver would report Managed; Privileged, whatever the real Agent setup is.

Proposed fix

  • Short term: return Unknown for both modes when running under Agent without control-protocol info, so they're omitted from the User-Agent. Add a TestUserAgentString case for OTel mode.
  • Long term: have Elastic Agent pass managed mode, privilege mode and version to beat receivers, and return them from OtelManager.AgentInfo().

Related