Skip to content
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

Use @timestamp instead of timestamp.us and switch to type date_nanos #1678

Open
simitt opened this issue Dec 19, 2018 · 8 comments
Open

Use @timestamp instead of timestamp.us and switch to type date_nanos #1678

simitt opened this issue Dec 19, 2018 · 8 comments

Comments

@simitt
Copy link
Contributor

simitt commented Dec 19, 2018

Switch to @timestamp from timestamp.us:

  • drop writing to timestamp.us in favor of @timestamp
  • change @timestamp type to date_nanos with a default format of epoch_millis
  • add a runtime field for timestamp.us until we can move fully onto @timestamp.

The UI uses the fields API to query @timestamp with format strict_date_optional_time_nanos, and also queries timestamp.us and uses that if it exists (elastic/kibana#108908). We would stop mapping and indexing the latter, this would just be for backwards compatibility.

There are known issues in Kibana with supporting date_nanos types, which needs further attention before we can move forward with this change.


Known issues that require further discussions:

Related issues:

@jalvz
Copy link
Contributor

jalvz commented Mar 11, 2019

we are not going do this now, right?

@jalvz jalvz closed this as completed Aug 23, 2019
@jalvz
Copy link
Contributor

jalvz commented Aug 23, 2019

we can reopen by 8.0 timeframe

@simitt simitt changed the title Investigate using @timestamp instead of timestamp.us and span.start. Use @timestamp instead of timestamp.us and switch to type date_nanos Aug 18, 2021
@simitt
Copy link
Contributor Author

simitt commented Aug 18, 2021

Reopening and targeting 8.0; updated the description to reflect current status and plans.

@simitt simitt reopened this Aug 18, 2021
@simitt
Copy link
Contributor Author

simitt commented Aug 18, 2021

Next steps:

@simitt simitt added the v8.0.0 label Aug 20, 2021
@simitt simitt added this to the 8.0 milestone Aug 20, 2021
@zube zube bot added the [zube]: Backlog label Aug 20, 2021
@axw
Copy link
Member

axw commented Aug 23, 2021

The APM app itself appears to have no problems with date_nanos. I installed the integration, edited the index templates (changing date to date_nanos for @timestamp), and modified #5970 to encode events with nanosecond precision.

I then sent some events and the APM app does not appear to have any problems with this.

I've found a couple of issues so far:

What we could do to work around this (temporarily, until the Logs app is fixed) is:

  • use date_nanos for traces data streams
  • use date for @timestamp in logs data streams, and index a sub-millisecond timestamp offset separately

For trace events, I think we'll probably need a runtime field for accessing sub-millisecond precision, similar to the example in https://www.elastic.co/guide/en/elasticsearch/reference/master/date_nanos.html

@axw
Copy link
Member

axw commented Aug 23, 2021

For trace events, I think we'll probably need a runtime field for accessing sub-millisecond precision, similar to the example in https://www.elastic.co/guide/en/elasticsearch/reference/master/date_nanos.html

Given that we'll need this anyway, I guess there's not much point in removing timestamp.us.

My new proposal is:

I'll run some more tests to check that this works out.

@axw
Copy link
Member

axw commented Aug 24, 2021

Found a bug in Kibana/Fleet: elastic/kibana#109764

when we move @timestamp to date_nanos, update timestamp.us to be a runtime field, possibly defined in the Data View

I believe the UI is currently extracting all fields from _source, rather than using the Fields API. We would need to migrate to the Fields API to make use of runtime fields: elastic/kibana#84507

@axw axw added 8.1-candidate and removed v8.0.0 labels Nov 17, 2021
@axw axw removed this from the 8.0 milestone Nov 17, 2021
@axw
Copy link
Member

axw commented Nov 21, 2021

Another option occurs to me now: we can continue to store @timestamp as a date field, but encode it using strict_date_optional_time_nanos. The UI can pull that out of _source and parse it for ordering things on the waterfall.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants