-
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
[Logs UI] The UI throws error when @timestamp format is date_nanos #88290
Comments
Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui) |
related: #40183 |
Note: from @weltenwort -- Discover and some other places in Kibana have solved how to handle the nanosecond format for bigint, we should look into those implementations for guidance on how to fix this in Logs UI. |
@Kerry350 Has there been any progress on this? We are exploring supporting nanoseconds in Beats/Agent and would need to be sure Kibana fully supports this. |
Hi @joshdover, there hasn't been any progress on this to date. Do you know what the timeframe would be for adding the support in Beats / Agent? This would allow us to try and reprioritise the support. |
If it's of any help here, there is a way of getting date nanos as a string instead of a timestamp so it can be safely used for |
Adding some more links for context here:
To reproduce it, here some Dev Tools command:
Going to Discover and include the time range, the sorting works as expected. Going to Logs UI and including the time range with the timestamp above shows the error |
Some thoughts and hints for anyone picking this up in the future: As @jughosta pointed out we need to fetch the timestamp as a string because a numeric nanosecond timestamp exceeds the value range of normal ECMAScript numbers. In contrast to Discover, the Logs UI interprets the timestamp in several places, though, and even performs date math on it. So while switching the
|
I timeboxed this ticket and quickly tried an approach similar to the one discover applied using Adding to what @weltenwort mentioned and the places that need to be modified we also need to take care of:
I wasn't able to spend much time to be more precise on exact expected time that we need to get this fixed but the change doesn't seem to be a quick one. One question though, do we just need the UI to not break with date_nanos, or do we also need to display and make use of the date_nanos in the Stream page? Because one option we might have is that we retrieve the timestamp as date_nanos but remove the precision of the nano_seconds when we get the response and continue using it in number as before. Sounds a bit hacky and not sure about the consequences of this in the code until we spend more time into it but could be an option here. date_nanos.mov |
I think step one should be to get the Logs UI not working when there is a nano timestamp in the data. If there is a quick fix to this through rounding, I suggest we do it and follow up with the more detailed fix in step 2. |
After discussing this further with @weltenwort we concluded that it would be best to solve this in a proper way and address all places where the timestamp is being used. Otherwise, it would be hacky to do a quick fix as it might introduce inconsistent behaviors where for example documents are retrieved twice or even not retrieved at all because of the rounding issues. Given that, the ET for getting this fixed would be around a week to address the places that were clear during the timeboxed investigation and also other places that came up during the discussion with @weltenwort. @ruflin wdyt? should we proceed with implementing the fix? |
++ on moving forward with this. |
Pinging @elastic/obs-ux-logs-team (Team:obs-ux-logs) |
closes #88290 ## 📝 Summary As described in #88290 we need to add `date_nanos` support to the Stream UI page. In this PR the necessary changes have been made all over the Stream UI and the usages of it. ## ✅ Testing⚠️ Testing the Stream UI with old timestamp indices is important to make sure that the behavior is still as before and not affected at all. This can be done by running local env from the PR and simulating all interactions on edge-lit cluster for example, to make sure that the behavior is not changed. For testing the new changes with support of `date_nano`: 1. You can use [the steps here](#88290 (comment)) to create and ingest documents with nano precision. 2. Navigate to the stream UI and the documents should be displayed properly. 3. Sync with the URL state should be changed from timestamp to ISO string date. 4. Changing time ranges should behave as before, as well as Text Highlights. 5. Open the logs flyout and you should see the timestamp in nano seconds. 6. Play around with the minimap, it should behave exactly as before. ### Stream UI: <img width="2556" alt="Screenshot 2023-11-02 at 14 15 49" src="https://github.com/elastic/kibana/assets/11225826/596966cd-0ee0-44ee-ba15-f387f3725f66"> - The stream UI has been affected in many areas: - The logPosition key in the URL should now be in ISO string, but still backward compatible incase the user has bookmarks with timestamps. - The minimap should still behave as before in terms of navigation onClick and also highlighting displayed areas ### Stream UI Flyout: <img width="2556" alt="Screenshot 2023-11-02 at 14 15 23" src="https://github.com/elastic/kibana/assets/11225826/6081533c-3bed-43e1-872d-c83fe78ab436"> - The logs flyout should now display the date in nanos format if the document is ingested using a nano format. ### Anomalies: <img width="1717" alt="Screenshot 2023-11-01 at 10 37 22" src="https://github.com/elastic/kibana/assets/11225826/b6170d76-40a4-44db-85de-d8ae852bc17e"> -Anomalies tab under logs as a navigation to stream UI which should still behave as before passing the filtration and time. ### Categories: <img width="1705" alt="Screenshot 2023-11-01 at 10 38 19" src="https://github.com/elastic/kibana/assets/11225826/c4c19202-d27f-410f-b94d-80507542c775"> -Categories tab under logs as a navigation to stream UI which should still behave as before passing the filtration and time. ### External Links To Stream: - All links to the Stream UI should still work as before: - APM Links for traces, containers, hosts - Infra links in Inventory and Hosts views ## 🎥 Demo https://github.com/elastic/kibana/assets/11225826/9a39bc5a-ba37-49e0-b7f2-e73260fb01f0
Kibana version:
master
Elasticsearch version:
master
Describe the bug:
When
@timestamp
is set todate_nanos
the date formatter throws an error.Steps to reproduce:
@timestamp
todate_nanos
(contact @simianhacker for help)Expected behavior:
It should render properly without errors.
Screenshots (if relevant):
The text was updated successfully, but these errors were encountered: