-
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
Only log deprecation warnings for calls to Saved Objects routes from non-kibana request #152971
Only log deprecation warnings for calls to Saved Objects routes from non-kibana request #152971
Conversation
Pinging @elastic/kibana-core (Team:Core) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -152,3 +153,27 @@ export interface BulkGetItem { | |||
fields?: string[]; | |||
namespaces?: string[]; | |||
} | |||
|
|||
export function getIsKibanaRequest({ headers }: KibanaRequest) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: getIsKibanaRequest
-> isKibanaRequest
💚 Build Succeeded
Metrics [docs]Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…non-kibana request (elastic#152971) Co-authored-by: kibanamachine <[email protected]> (cherry picked from commit e37e834) # Conflicts: # packages/core/saved-objects/core-saved-objects-server-internal/src/routes/index.ts # packages/core/saved-objects/core-saved-objects-server-internal/src/routes/utils.ts # packages/core/saved-objects/core-saved-objects-server-internal/tsconfig.json
… from non-kibana request (#152971) (#153053) # Backport This will backport the following commits from `main` to `8.7`: - [Only log deprecation warnings for calls to Saved Objects routes from non-kibana request (#152971)](#152971) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Christiane (Tina) Heiligers","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-03-09T17:23:21Z","message":"Only log deprecation warnings for calls to Saved Objects routes from non-kibana request (#152971)\n\nCo-authored-by: kibanamachine <[email protected]>","sha":"e37e83428abe9bb8971419672969bcaa9db9918e","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Core","Feature:Saved Objects","release_note:skip","backport:prev-minor","v8.8.0"],"number":152971,"url":"https://github.com/elastic/kibana/pull/152971","mergeCommit":{"message":"Only log deprecation warnings for calls to Saved Objects routes from non-kibana request (#152971)\n\nCo-authored-by: kibanamachine <[email protected]>","sha":"e37e83428abe9bb8971419672969bcaa9db9918e"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/152971","number":152971,"mergeCommit":{"message":"Only log deprecation warnings for calls to Saved Objects routes from non-kibana request (#152971)\n\nCo-authored-by: kibanamachine <[email protected]>","sha":"e37e83428abe9bb8971419672969bcaa9db9918e"}}]}] BACKPORT-->
…non-kibana request (elastic#152971) Co-authored-by: kibanamachine <[email protected]>
follow up to #150775
The logs are generated every time a deprecated route is called and we have extensive use of these routes throughout Kibana.
Since customers can't do anything about the Kibana UI using the saved objects client, logging these warnings so many times may lead to turning off logging completely.
This PR improves that, only logging when a request is external to Kibana.
Risk Matrix