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

Add support for nanosecond timestamps #15871

Closed
8 of 21 tasks
urso opened this issue Jan 27, 2020 · 24 comments · Fixed by #31553
Closed
8 of 21 tasks

Add support for nanosecond timestamps #15871

urso opened this issue Jan 27, 2020 · 24 comments · Fixed by #31553
Assignees
Labels
meta Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team v8.3.0

Comments

@urso
Copy link

urso commented Jan 27, 2020

The @timestamp field only has microsecond precisions. Internally, or when collecting from external sources, timestamps might have higher precisions. Elasticsearch supports the date_nano type, and allows to store timestamps with higher precision even if date is used.

The feature-timestamp-nano branch is used for development.
In progress PR merging the feature branch into master: #15872

Other related issues:

@urso urso added meta test-plan Add this PR to be manual test plan Team:Beats v7.7.0 labels Jan 27, 2020
@urso urso self-assigned this Jan 27, 2020
@urso urso mentioned this issue Jan 28, 2020
5 tasks
@urso urso removed their assignment Feb 20, 2020
@urso urso added candidate Candidate to be added to the current iteration [zube]: Ready and removed [zube]: In Progress labels Feb 20, 2020
@andresrc andresrc added Team:Integrations Label for the Integrations team and removed Team:Beats labels Mar 6, 2020
@LotoQ
Copy link

LotoQ commented Apr 21, 2020

Hi guys, was just wondering if there was a planned release date for this feature? I was just noticing that it looked like most of the tasks were complete, so really looking forward to being able to use it soon! :^)

@pytimer
Copy link

pytimer commented Jun 15, 2020

filebeat docker-json timestamp support nanoseconds? #17660

Like issue #17660, libbeat docker-json reader not support nanoseconds, it maybe occur some problem, because i have a container and this container logs like below, i have no way to sort by the correct @timestamp. So filebeat support nanoseconds is necessary for me.

{"log": "Starting web...", "stream":"stderr", "time":"2020-06-15T05:26:22.521012484Z"}
{"log": "Starting web middleware...", "stream":"stderr", "time":"2020-06-15T05:26:22.521012490Z"}

@pytimer
Copy link

pytimer commented Jun 15, 2020

filebeat docker-json timestamp support nanoseconds? #17660

Like issue #17660, libbeat docker-json reader not support nanoseconds, it maybe occur some problem, because i have a container and this container logs like below, i have no way to sort by the correct @timestamp. So filebeat support nanoseconds is necessary for me.

{"log": "Starting web...", "stream":"stderr", "time":"2020-06-15T05:26:22.521012484Z"}
{"log": "Starting web middleware...", "stream":"stderr", "time":"2020-06-15T05:26:22.521012490Z"}

I read the source code about docker_json.go, i found parse docker log via time.RFC3339, it can parse 2020-06-15T05:26:22.521012484Z to 2020-06-15 05:26:22.521012484 +0000 UTC . I also test time.Parse() it return nanoseconds, so i think docker-json reader can support nanoseconds. If something wrong, please point out.

@botelastic
Copy link

botelastic bot commented Jan 27, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@botelastic botelastic bot added the Stalled label Jan 27, 2022
@mtheck
Copy link

mtheck commented Jan 27, 2022

Running on Kubernetes and still limited to milliseconds precision for log timestamps is a bit embarrassing!

@botelastic botelastic bot removed the Stalled label Jan 27, 2022
@jlind23 jlind23 added the v8.3.0 label Mar 23, 2022
@jlind23
Copy link
Collaborator

jlind23 commented Mar 23, 2022

8.3 goal - understand where we are at and take a decision based on it.

@jlind23 jlind23 added Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team and removed Team:Integrations Label for the Integrations team test-plan Add this PR to be manual test plan v7.7.0 labels Apr 27, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@jlind23 jlind23 removed the candidate Candidate to be added to the current iteration label Apr 27, 2022
@jlind23
Copy link
Collaborator

jlind23 commented Apr 27, 2022

@kvch as you will be working on the analysis of that one, could you please provide us as an outcome:

cc @ph @cmacknz in case you see something else to add

@kvch
Copy link
Contributor

kvch commented May 9, 2022

I have opened a new PR #31553 in favour of the old one (#15872). At the moment it is a draft because the tests are still failing.

I tested a few modules in Filebeat and Metricbeat manually. Pipelines and visualizations seem to work. I am confident once the tests pass on the CI we could get this in a few days. However, I would like to ask for additional manual testing from either QA source or others on our team.

@jlind23
Copy link
Collaborator

jlind23 commented May 10, 2022

@dikshachauhan-qasource could you please consider it for the 8.3 testing scope?

@dikshachauhan-qasource
Copy link

Hi @jlind23 Thanks for the update on requirement for testing. We will check this out and let you know progress in comments.

Thanks
Diksha

@amolnater-qasource
Copy link

Hi @jlind23 @kvch
As per our understanding we have validated this by installing Metricbeat with System module enabled on latest 8.3 Snapshot Kibana cloud environment.
Further, we have observed the data from Metricbeat under Discover tab.

  • Currently data is available with @timestamp: 10:09:03.365Z

Screenshots:
6
7

Queries:

Could you please confirm:

  • If these changes are just for Beats and no impact on Elastic-Agent logs.
  • Validation requires to be covered only Discover tab.

Please let us know if we are missing any other scenario to be covered.
Thanks

@kvch
Copy link
Contributor

kvch commented May 11, 2022

The feature hasn't been merged to main yet. Or did you try test it with my feature branch?

@amolnater-qasource
Copy link

Hi @kvch
Thanks for looking into this, we haven't validated this upon feature branch. We attempted to test current behaviour of @timestamp on cloud-staging kibana for metricbeat and wanted to confirm if this is the testing area.

Further we had few queries related to this feature which we have shared under #15871 (comment)
We will be retesting this once the related PR will be merged.

Thanks

@amolnater-qasource
Copy link

Hi @kvch
We have attempted to validate this on 8.3 Snapshot Kibana cloud environment and followed below steps:

  1. Setup Kibana cloud environment.
  2. Installed Metricbeat with system module enabled and Auditbeat.
  3. Observed data with @timestamp under Discover tab.
    7
  4. We observed that data is still available with timestamp: @ 17:22:57.955

Build details:
BUILD: 52935
COMMIT: 5d5603a57237d8fe9cf186916c713b9ddddf039d
(MAY 19, 2022 3:42 PM)

Question

Could you please share some more testing details or could confirm if we are missing anything here?

cc: @jlind23
Thanks

@kvch
Copy link
Contributor

kvch commented May 25, 2022

By default Beats still use millisecond precision. You have to set timestamp.precision in the configuration, see the reference:

# Configure the precision of all timestamps in Metricbeat.
# Available options: millisecond, microsecond, nanosecond
#timestamp.precision: millisecond

@joshdover
Copy link
Contributor

Were metricbeat mappings changed in this release? If not, I believe the @timestamp field will still show at millisecond precision in Discover. You'll need to look at the _source.@timestamp field in the JSON tab of the "Expanded document" flyout.

@amolnater-qasource
Copy link

Hi @kvch @joshdover
Thanks for the feedback.
We have revalidated this on latest 8.3 Snapshot kibana cloud environment and followed below steps:

  • We have added timestamp.precision: nanosecond under metricbeat-reference.yml and winlogbeat-reference.yml.
  • We then observed the data under Discover>JSON tab of the "Expanded document" flyout.
  • We observed nanosecond data under _source: @timestamp.

OS& Beats covered:
Platform: Windows 10 x64
Winlogbeat
Metricbeat

Screenshots:
2
3

Question:

Please let us know if we need to validate this on any other beats or platforms.

Thanks

@stephan-erb-by
Copy link

Would it make sense to change the default mappings as part of this release as well? Or is this out of scope in any case?

In my mind beats could generate templates where @timestamp uses date_nanos if timestamp.precision is set to nanosecond.

@joshdover
Copy link
Contributor

@cmacknz should we do this mappings change?

@cmacknz
Copy link
Member

cmacknz commented Jun 1, 2022

It sounds reasonable to me to switch to date_nanos in the templates. Likely we can do this with a follow up issue.

@kvch does this sound reasonable to you?

@axw
Copy link
Member

axw commented Jun 2, 2022

There are still some open issues regarding date_nanos in Kibana. Shouldn't we wait for them to be addressed before switching field types?

@cmacknz
Copy link
Member

cmacknz commented Jun 6, 2022

Thanks Andrew, I've created an issue to support date_nanos in the future: #31838

@kvch
Copy link
Contributor

kvch commented Jun 7, 2022

I agree with @axw. Also, the default @timestamp granularity is still milliseconds, so we do not have to hurry with the change.
Also, all of the vizualizations work with the current template even if the timestamp precision is set to nanoseconds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team v8.3.0
Projects
None yet