The current V1 code has a Headers() function that returns headerdata used by elasticsearch: https://github.com/elastic/elastic-agent/blob/689aee33c923be6183267c0e45596aa8d758e6eb/internal/pkg/agent/application/info/agent_info.go#L91
This in turn is used by the InjectHeadersRule to add elasticsearch headers. As far as I can tell, this headers data doesn't exist in the V2 client: https://github.com/elastic/elastic-agent-client/blob/main/pkg/client/client_v2.go
I'm not sure where this data comes from in V2, but we need to add it.
The current V1 code has a
Headers()function that returns headerdata used by elasticsearch: https://github.com/elastic/elastic-agent/blob/689aee33c923be6183267c0e45596aa8d758e6eb/internal/pkg/agent/application/info/agent_info.go#L91This in turn is used by the
InjectHeadersRuleto add elasticsearch headers. As far as I can tell, this headers data doesn't exist in the V2 client: https://github.com/elastic/elastic-agent-client/blob/main/pkg/client/client_v2.goI'm not sure where this data comes from in V2, but we need to add it.