-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
elasticsearch client: allow calling API as a user so that deprecation warnings are surfaced #120201
Comments
Pinging @elastic/kibana-core (Team:Core) |
how about an What do you think? |
We're exposing vanilla instances of |
That is a very strong point! I guess it's not worth overcomplicating this then. So the scope of this issue is to allow the header "reset" and document that this is possible? |
yeah, given the timelines and our architecture that seems like the most pragmatic. |
Hum, I thought we were the ones setting the @delvedor maybe you can help us here? |
It means that plugin setting
IMO we are blurring the responsibility of this header. kibana/src/core/public/http/fetch.ts Line 139 in e527c3f
I'd suggest to use API identical to the client-side to configure system requests: client.seatch({...}, { asSystemRequest: true}) In theory we can extend Another problem that we will need to solve is to enforce
Hm. AFAIK Console app doesn't set |
@delvedor suggested deleting the Unfortunatelly, we can't work around it by setting the header as client.get(..., { headers: { 'x-opaque-id': undefined } }) since the ES client throws class KibanaTransport extends Transport {
request(params: TransportRequestParams, options?: TransportRequestOptions) {
const opts = options || {};
const opaqueId = getExecutionContext();
if (opaqueId && !opts.opaqueId) {
// rewrites headers['x-opaque-id'] if it presents
opts.opaqueId = opaqueId;
}
if (!opts.headers || !('x-elastic-product-origin' in opts.headers)) {
opts.headers = opts.headers || {};
opts.headers['x-elastic-product-origin'] = 'kibana';
}
return super.request(params, opts);
}
After thinking a bit more, I realized it's not the best option because we will have to add this global
UPD: it doesn't set the header. #90123 |
cc @thesmallestduck @arisonl for input on priority for this |
@lukeelmers @rudolf is that something that may come back for 9.0? Or should we close the issue? |
As far as I know there are no other use cases where Kibana should not add it's header, so it's only console. Everywhere else Kibana controls which APIs it calls so it's our responsibility to stop depending on the deprecated APIs before 9. I double checked and what @mshustov wrote is still true, so the console app doesn't need any workarounds, it already doesn't include this header.
So I'll close this. |
Upgrade assistant will hide deprecation warnings for requests made with
x-elastic-product-origin: kibana
. However, deprecations from some API calls should explicitly be surfaced, e.g. api calls from the console app.In order to do this, plugins will need to unset the
x-elastic-product-origin: kibana
header.One way to achieve that would be to change the custom Kibana transport for the Elasticsearch-js client so that when a api request is made with
headers: {'x-elastic-product-origin': null}
we remove the x-elastic-product-origin header from the request altogether.Related: #120043
The text was updated successfully, but these errors were encountered: