-
Notifications
You must be signed in to change notification settings - Fork 17
Add "elastic-agent' product origin header when running under the Elastic agent. #66
Comments
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
Possibly the repository move would affect this, but if we want to distinguish between beats run under agent and beats run stand alone there would still be a change to beats. |
The simplest way to deal with this is to use the "elastic-agent" header for connections from the shipper. If that doesn't cover all our interactions with Elasticsearch we can open a follow up issue. |
Spotted this in progress and this issue is pretty old relative to the shipper. Just to clarify
The connection I was referencing there is from the shipper to Elasticsearch. We can just hard code the product origin header of the shipper's Elasticsearch output to "elastic-agent" since that is the only place it runs. The existing ES client takes a list of Headers to attach to every request: https://github.com/elastic/beats/blob/7b99a8ec45729107d47f397ec3976f6d0b483903/libbeat/esleg/eslegclient/connection.go#L71 It looks to ensure the product origin header is set and defaults it to beats if it isn't set. When we complete #10 all we should need to do is set the header appropriately when creating the client and we should be done. The only additional thing to do is make Kibana actually under the "elastic-agent" header: https://github.com/elastic/kibana/blob/726ea2823bdda5f29bf1e1980dfdb53fa0691ebf/x-pack/plugins/upgrade_assistant/common/constants.ts#L38. We can consider doing this now so it gets released by the time the shipper is ready. We could consider reporting ourselves as "fleet" as well to use something that is already defined. |
Moved to the shipper repository since this is where we should implement this. |
Describe the enhancement:
In elastic/beats#29966 the Elastic product origin header was added to all requests made to Elasticsearch with the hard coded value "beats". When the code involved is used by or run under the Elastic agent the header value should be changed to "elastic-agent" to properly attribute the source of the request.
This will require adding a new value to the list of known product origins, currently defined here: https://github.com/elastic/kibana/blob/main/x-pack/plugins/upgrade_assistant/common/constants.ts#L50
Describe a specific use case for the enhancement or feature:
Requests made by or under the supervision of the Elastic agent should not be attributed to the beats product.
The text was updated successfully, but these errors were encountered: