Open
Description
Currently, we copy headers such as X-Opaque-Id
, X-elastic-product-origin
, etc., when creating a new task. In ES|QL, we would like to add the user to these headers so that we can identify which users are running heavy queries. However, we need to discuss the safety and feasibility before implementing the change.
- How sensitive is it to add the user to the task headers?
- We don't store the user directly in ThreadContext but rather the authentication token. Therefore, we need to deserialize when accessing the user, which can be expensive for every task/query.
- Should we add the user to all tasks or just ES|QL root task?
- An alternative is Kibana adding users when sending queries, and in Elasticsearch, we just add a new header for the user and copy it like the existing headers.
I might be missing something obvious here.