Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Console] Missing "user-agent" header when sending requests #183180

Open
yuliacech opened this issue May 10, 2024 · 3 comments
Open

[Console] Missing "user-agent" header when sending requests #183180

yuliacech opened this issue May 10, 2024 · 3 comments
Labels
Feature:Console Dev Tools Console Feature Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more

Comments

@yuliacech
Copy link
Contributor

A post on discuss has revealed that in some setups, the requests via Dev tools Console fail due to them not having the correct user-agent header set. In the current implementation of the Console proxy, all headers except those specified in the elasticsearch.requestHeadersWhitelist are filtered out (see this code). The header user-agent can't be added to that config though as Kibana has its own logic regarding this header (#141003).

To fix the failing requests, we could maybe copy the existing header user-agent when proxying the requests via Console?

@yuliacech yuliacech added Feature:Console Dev Tools Console Feature Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more labels May 10, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-management (Team:Kibana Management)

@yuliacech yuliacech changed the title [Console] Include "user-agent" header when sending requests [Console] Missing "user-agent" header when sending requests May 10, 2024
@lukeelmers
Copy link
Member

From an observability perspective it might be helpful to set a different UA for console than we do from Kibana... sometimes it is helpful to understand what requests originate from Kibana (i.e. we have some level of control over the queries), and which ones are raw queries written by users.

We have the product-origin header which could also be used for this purpose, but I'm wondering if we would still risk confusion by using the same UA in the console proxy.

Any thoughts on this @elastic/kibana-core?

@pgayvallet
Copy link
Contributor

I think it would be fine for requests performed from the dev console to be sending a user-agent header, and I agree that for observability purposes, it could be a good think to have a different header than the one used by the "programatic" ES client used by Kibana.

I would, however, avoid copying the browser's user agent, as it doesn't really reflect the reality of the product that performs the request.

FWIW, the user-agent header used by the Kibana ES client is following a Kibana/{version} format:

If we were to follow the user-agent's spec, we could imagine something like this for the dev console:

Kibana/8.12.0 (DevConsole)

or even a totally different product identifier

KibanaDevConsole/8.12.0

of course those are only example from the top of my mind, we would probably be fine with any naming, as long as we can distinguish it from the "normal" client's user agent (and that it follows the header's spec).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Console Dev Tools Console Feature Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Projects
None yet
Development

No branches or pull requests

4 participants