Allow components (specifically Beats sub-processes) to determine if they are connected to a standalone or a Fleet managed agent so that they can add this information to the User-Agent string. Additionally include whether the agent is unprivileged since it is cheap to add as part of this change.
Determining the privilege level is a single function call, for example see
|
Unprivileged: agentInfo.Unprivileged(), |
Adding this information to the AgentInfo message in the control protocol is likely the best choice. https://github.com/elastic/elastic-agent-client/blob/ac72c3488d26b2b319cec87536d45eea35b81d17/elastic-agent-client.proto#L197-L210
// Agent information that the component might want to use for its events,
// including the package version, which components should report instead
// of their own version.
//
// Sent on component start up as part of StartUpInfo and on the first checkin
// expected response to the component.
message AgentInfo {
// ID is the Elastic Agent's unique ID.
string id = 1;
// Version is the package version of the running Elastic Agent.
string version = 2;
// Snapshot is true when the running Elastic Agent is a snapshot version.
bool snapshot = 3;
}
User-Agentbeats#39403 (comment)Allow components (specifically Beats sub-processes) to determine if they are connected to a standalone or a Fleet managed agent so that they can add this information to the User-Agent string. Additionally include whether the agent is unprivileged since it is cheap to add as part of this change.
Determining the privilege level is a single function call, for example see
elastic-agent/pkg/control/v2/server/server.go
Line 401 in eaf3c43
Adding this information to the
AgentInfomessage in the control protocol is likely the best choice. https://github.com/elastic/elastic-agent-client/blob/ac72c3488d26b2b319cec87536d45eea35b81d17/elastic-agent-client.proto#L197-L210