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

[Maps] Tooltips with timestamp appear as epoch #95072

Closed
stratoula opened this issue Mar 22, 2021 · 4 comments · Fixed by #95106
Closed

[Maps] Tooltips with timestamp appear as epoch #95072

stratoula opened this issue Mar 22, 2021 · 4 comments · Fixed by #95106
Assignees
Labels
bug Fixes for quality problems that affect the customer experience [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation regression v7.12.1 v7.13.0 v8.0.0

Comments

@stratoula
Copy link
Contributor

Kibana version:
7.11 ++

Describe the bug:
It seems that if I create a new Documents layer and use as a tooltip field a date, the date is not formatted but appears as epoch. I have tested it on 7.10.1 and it worked but it seems to be broken on 7.11

7.10.1
image

7.11.1
image

Steps to reproduce:

  1. Create a new Documents Layer from kibana_sample_data_logs
  2. Add @timestamp as the tooltip field
  3. Hover over the points and see that the date is not formatted
    image
@stratoula stratoula added bug Fixes for quality problems that affect the customer experience [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation labels Mar 22, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis (Team:Geo)

@thomasneirynck
Copy link
Contributor

I can reproduce this on master. this is a regression.

@nreese nreese self-assigned this Mar 22, 2021
@nreese
Copy link
Contributor

nreese commented Mar 22, 2021

Regression caused by #84377.

Maps lazy loads feature tooltip properties. Each time a tooltip is needed for a feature, a search request is generated to fetch the document. Prior to the change, the default search source behavior is used, which formats dates as date_time. After the change, the search source docvalue_fields is generated with the function getDocValueAndSourceFields. The problem is that getDocValueAndSourceFields specifically formats dates as epoch_millis so the value is a number that can be used for ordinal styling. The date field formatter does not work when dates are formatted as epoch_millis.

Prior to 7.11, request to fetch tooltip fields looked like

"docvalue_fields": [
    {
      "field": "@timestamp",
      "format": "date_time"
    }
  ],

After 7.11, request to fetch tooltip fields looks like

"docvalue_fields": [
        {
          "field": "@timestamp",
          "format": "epoch_millis"
        }
      ],

@nreese
Copy link
Contributor

nreese commented Mar 22, 2021

Formatting date's as epoch_millis hits the bug elasticsearch bug elastic/elasticsearch#50622 where dates formatted as epoch_millis are returned as strings instead of numbers. Since the value is string instead of a number, the field formatter can not format it.

The issue has been fixed before for feature labels by converting date epoch millis strings to numbers #63909.

We need to ensure the same thing is done for date fields used in tooltips

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation regression v7.12.1 v7.13.0 v8.0.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants