-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[UA] Filter out elastic products deprecation logs #121389
[UA] Filter out elastic products deprecation logs #121389
Conversation
Pinging @elastic/kibana-stack-management (Team:Stack Management) |
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.
Thanks for working no this @sebelga! Code changes lgtm, left a few comments in a few tests.
While I was testing this out I noticed a few things:
- On an empty cluster with today's snapshot there's one deprecation showing in the count:
- The data view that we use in external links does not have
elasticsearch.elastic_product_origin
so we end up with an empty filter on the generated url which leads to having no filters applied in the discovery app:
- When generating new deprecations I ended up with 4 in the count but only 3 being shown in the observability app:
Screen.Recording.2021-12-20.at.10.09.01.mov
Unsure if the last two are side effects of perhaps the same problem.
x-pack/test/api_integration/apis/upgrade_assistant/es_deprecation_logs.ts
Outdated
Show resolved
Hide resolved
x-pack/test/api_integration/apis/upgrade_assistant/es_deprecation_logs.helpers.ts
Show resolved
Hide resolved
Thanks for the review @sabarasaba ! I addressed your 2 suggestions from the CR.
Have you looked if it contained the elastic-product origin in the log? If not that's the reason it still appears in UA and we should try to find the team responsible. It wouldn't be a UA bug then. Looking at your screenshot it looks like a deprecated "legacy index template", is it possible that it was Console that triggered it?
That is OK, if there are no log with that field defined then the Data view field does not exist and we don't pass a filter. There wouldn't be anything to filter if there aren't any log containing that field 😊
That needs to be investigated as indeed the count should match the logs in Observability. Mabe it is a mismatch in the @timestamp position? I will try to reproduce it on my side. |
@elasticmachine merge upstream |
@sebelga The log was there without going to console, just open up kibana login and go directly to UA, I'll see if I can figure out what's causing it then! Also, let me know if you had any luck replicating the count mismatch, otherwise I'm happy to zoom see if we can find it together! |
@sabarasaba The initial deprecation log is generated by the security team when starting Kibana. They've opened an issue to fix it (#121311). Once that issue get resolved there shouldn't be any log when starting with an empty cluster. |
cea448a
to
53e9ceb
Compare
616b6ac
to
4303981
Compare
@elasticmachine merge upstream |
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.
The mismatch in the deprecations count and what was shown in the Observability app was due to my mistake of putting a future date in the timestamp when generating the deprecation. Since the count API doesn't have an upper time boundary it grabs all deprecations since the last checkpoint forward, but the Observability app grabs all the deprecations from the last checkpoint until now
.
Thanks for looking into the issue @sabarasaba ! I've updated the count search to discard deprecation in the future (they should theoretically never happen). fe2de31 |
Dumb question... what if a log is created in a timezone that's ahead of the one you're currently in? Are all timestamps normalized somehow, for example by storing all timestamps as UTC? |
Not a dumb question, it made me realise that I need to add timezone information to the search From what I see in different Discuss yes ES saves all timestamp in UTC and Kibana expects @timestamp in UTC and then converts to the local timezone for display. |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
This PR adds the filters to not display deprecation logs coming from Elastic products in Upgrade Assistant.
How to test
yarn es snapshot --license trial)
with KibanaTest the filters
"elasticsearch.elastic_product_origin" : "kibana"
Known issue
During the testing I realised that simply by entering the Console app we are generating deprecation logs. It seems that we have decided not to add the product origin header for requests coming from console but I do think we should add the header there too.
@sabarasaba pointed out that under the hood console make the following requests for the autocomplete functionality
which would be the cause of the deprecation being generated
Request made in console that are deprecated in
8.0
will throw an error if the user executes them after upgrading. So it seems that we don't need to display deprecation logs for those requests made by Console in7.x
.Fixes #120152