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

Discover not showing histogram bars #52152

Closed
leandrojmp opened this issue Dec 4, 2019 · 10 comments · Fixed by #53979
Closed

Discover not showing histogram bars #52152

leandrojmp opened this issue Dec 4, 2019 · 10 comments · Fixed by #53979
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:Discover Discover Application Feature:ElasticCharts Issues related to the elastic-charts library Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@leandrojmp
Copy link

Kibana version: 7.5.0-1

Elasticsearch version: 7.5.0-1

Server OS version: CentOS 7.6

Browser version: Chrome 78.0.3904.108

Browser OS version: Ubuntu 18.10

Original install method (e.g. download page, yum, from source, etc.): yum

Describe the bug:
I updated the stack to 7.5 from 7.4 and discover is not showing the histogram bar anymore, I've tested with a data set with timestamp dates spanning years and if the difference from the start date and the end date is wide, it will only show histogram bars when scaling on years. It worked fine on 7.4

Steps to reproduce:

  1. Load a dataset with a wide range of start and end dates.
  2. Test the scale options (seconds, minutes, hours, daily, weekly, monthly, yearly)

Expected behavior:
Histogram bars rendered in the discover page.

Screenshots (if relevant):

kibana-error

@kertal kertal added Feature:Discover Discover Application triage_needed Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Dec 5, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@timroes timroes added the Feature:ElasticCharts Issues related to the elastic-charts library label Dec 9, 2019
@timroes
Copy link
Contributor

timroes commented Dec 9, 2019

Hi,

could you please open your browsers dev tools (F12) and check if there are any errors on the "Console"?

Cheers,
Tim

@leandrojmp
Copy link
Author

Hi,

could you please open your browsers dev tools (F12) and check if there are any errors on the "Console"?

Cheers,
Tim

I got these errors when selecting the interval that I want and trying to refresh.

kibana-error

@timroes
Copy link
Contributor

timroes commented Dec 10, 2019

cc @markov00 @rshen91

@timroes timroes added bug Fixes for quality problems that affect the customer experience and removed feedback_needed labels Dec 10, 2019
@markov00 markov00 self-assigned this Dec 10, 2019
@markov00
Copy link
Member

@leandrojmp could you please share the the request and the response of the failing rendering call? It's available from the top left button Inspect

Screenshot 2019-12-10 at 18 29 42

You can omit the hits on the response and share only the aggregate. If that arise any privacy issue, you can just share the aggs query and the range filter on the request. It will appear something like

 "aggs": {
    "2": {
      "date_histogram": {
        "field": "timestamp",
        "calendar_interval": "1w",
        "time_zone": "Europe/Rome",
        "min_doc_count": 1
      }
    }
  },
...
"query": {
    "bool": {
      "must": [],
      "filter": [
        {
          "match_all": {}
        },
        {
          "range": {
            "timestamp": {
              "gte": "2008-01-01T03:00:00.000Z",
              "lte": "2013-01-01T03:30:00.000Z",
              "format": "strict_date_optional_time"
            }
          }
        }
      ],
      "should": [],
      "must_not": []
    }
  },

Thanks

@leandrojmp
Copy link
Author

leandrojmp commented Dec 10, 2019

Hello,

I have more information about this issue.

My computer is configured to use the America/Sao_Paulo timezone (UTC -0300) and Kibana is using the default configuration for timezone, getting it from the Browser.

So I've made a little test and changed the Kibana timezone to UTC and it rendered the histogram, auto-scaled to 30d, I tested it changing the scale option and almost everything worked, except when I choosed to scale it by monthly, it did not rendered the histogram.

The gif below show this behavior, when the Kibana timezone is set to UTC.

kibana-error-02

Below is the request made by kibana, I compared the request made using the Browser timezone and the one made using UTC timezone and the only difference is in the time_zone field and in the lte field in the range filter.

{
  "version": true,
  "size": 500,
  "sort": [
    {
      "@timestamp": {
        "order": "desc",
        "unmapped_type": "boolean"
      }
    }
  ],
  "_source": {
    "excludes": []
  },
  "aggs": {
    "2": {
      "date_histogram": {
        "field": "@timestamp",
        "fixed_interval": "30d",
        "time_zone": "America/Sao_Paulo",
        "min_doc_count": 1
      }
    }
  },
  "stored_fields": [
    "*"
  ],
  "script_fields": {},
  "docvalue_fields": [
    {
      "field": "@timestamp",
      "format": "date_time"
    },
    {
      "field": "created_at",
      "format": "date_time"
    }
  ],
  "query": {
    "bool": {
      "must": [],
      "filter": [
        {
          "match_all": {}
        },
        {
          "range": {
            "@timestamp": {
              "format": "strict_date_optional_time",
              "gte": "2008-01-01T03:00:00.000Z",
              "lte": "2019-12-10T23:08:42.469Z"
            }
          }
        }
      ],
      "should": [],
      "must_not": []
    }
  },
  "highlight": {
    "pre_tags": [
      "@kibana-highlighted-field@"
    ],
    "post_tags": [
      "@/kibana-highlighted-field@"
    ],
    "fields": {
      "*": {}
    },
    "fragment_size": 2147483647
  }
}

@markov00
Copy link
Member

thanks @leandrojmp, we identified the root cause and we are going to release the fix possibly on 7.5.1

@markov00
Copy link
Member

TO REPRODUCE:
import or generate a dataset that spans few years (containing at least one leap year)

node scripts/makelogs.js -c 2m -d 2200/1

markov00 added a commit to markov00/kibana that referenced this issue Dec 11, 2019
This commit fix the missing bars on the histogram of Discover.
Discover is passing a minInterval parameter in milliseconds that is not
the the minimum interval in milliseconds between the buckets. Calendar intervals
are not fixed and this value change depending on time range and the time zone.
To avoid patching the elastic-chart and upgrading the dependency we applied a temporary patch
to the histogram code. For the feature version this patch will be removed
and a correct minInterval computation will be done directly in elastic-charts.

fix elastic#52152
markov00 added a commit that referenced this issue Dec 12, 2019
This commit fix the missing bars on the histogram of Discover.
Discover is passing a minInterval parameter in milliseconds that is not
the the minimum interval in milliseconds between the buckets. Calendar intervals
are not fixed and this value change depending on time range and the time zone.
To avoid patching the elastic-chart and upgrading the dependency we applied a temporary patch
to the histogram code. For the feature version this patch will be removed
and a correct minInterval computation will be done directly in elastic-charts.

fix #52152
@markov00
Copy link
Member

fixed in #52758, will be released on 7.5.1

@leandrojmp
Copy link
Author

Updated to 7.5.1 and it is working now, thanks!

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 Feature:Discover Discover Application Feature:ElasticCharts Issues related to the elastic-charts library Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants