-
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
Improve usage stats collection - first- and third-party requests #85869
Comments
Pinging @elastic/kibana-security (Team:Security) |
Pinging @elastic/kibana-core (Team:Core) |
Since plugins aren't supposed to access other plugin's HTTP APIs directly, what about exposing the API via two paths, one which uses |
Sure we could do that, it does sound like potentially a lot of work just to improve our usage data though. FWIW, since I opened this issue, all of our docs have been updated to instruct consumers to use |
++ On that. Note that it would also requires changes in all FTR api integration suites to run the suites against both endpoints |
What problem do we want to solve? If we want to prevent |
If the plugin is calling these APIs from the server-side, it won't work properly (from my understanding it will fail but in a non-obvious way). If the plugin is attempting to access from the client-side, they lose out on the benefit of type checking. I have a PR out to document these guidelines here: https://github.com/elastic/kibana/pull/113313/files#diff-3c4e9b75014f3ada216e36cecccffe18d918455747274f9bd8a9d6121d24d793R35
Yea, I agree. I was thinking about the APIs that we want to make internal anyway, and deprecate/remove the public versions. In that case, I think it makes sense to maintain both for a period of time to support a slow migration. |
I don't think we may want this anymore, closing |
#81907 and #85621 added usage stats collection for various APIs. We attempt to differentiate whether a consumer is "first-party" (the Kibana client) or "third-party" (some other integration) by checking for the presence of
kbn-version
andreferer
headers. Originally we also checked fororigin
too, but discovered that not all first-party requests contain this header.As discussed in #85706 (comment):
kbn-xsrf
, notkbn-version
(which is more strict); however, our Reporting docs currently state to usekbn-version
.Additionally, we added a regex in Core to check for a space identifier in the base path (#85706 (comment)). We could consider changing that to an explicit check.
The text was updated successfully, but these errors were encountered: