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

[Logs UI] Analysis charts don't show the full selected time interval #48385

Closed
weltenwort opened this issue Oct 16, 2019 · 4 comments · Fixed by #48754
Closed

[Logs UI] Analysis charts don't show the full selected time interval #48385

weltenwort opened this issue Oct 16, 2019 · 4 comments · Fixed by #48754
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v7.5.0

Comments

@weltenwort
Copy link
Member

Problem description

When rendering a time interval with incomplete data, the chart's x axis only shows the interval for which there is data:

grafik

This means that the axis boundaries and the bucket size jump on auto-reload as newly processed data come in.

Proposed solution

The x axis is always scaled to match the selected interval.

@weltenwort weltenwort added bug Fixes for quality problems that affect the customer experience Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v7.5.0 labels Oct 16, 2019
@Kerry350 Kerry350 self-assigned this Oct 17, 2019
@Kerry350
Copy link
Contributor

@markov00 Would it be possible to get clarification about something regarding annotations in elastic-charts. I'm seeing a situation where series are rendering, but annotations aren't. This is in a sitation where all the values are 0, but even so I'd expect the annotations to render, and they do if I copy one of the simpler examples from the elastic-charts storybook page.

The chart in it's rendered form:

Screenshot 2019-10-21 10 40 21

(My timezone is 1 hour ahead of the code snippets).

The time range:

Start: 1570688816594 // (Thursday, 10 October 2019 06:26:56.594)
End: 1570690141590 // (Thursday, 10 October 2019 06:49:01.590)

Which is fed to the settings component as xDomain={{ min: timeRange.startTime, max: timeRange.endTime }}.

The following data snippets focus on a single partition (redis.slowlog in this instance).

The series for the partition look as follows, and render correctly:

[
  {
    "time": 1570689000000, // Thursday, 10 October 2019 06:30:00
    "value": 0
  },
  {
    "time": 1570689900000, // Thursday, 10 October 2019 06:45:00
    "value": 0
  }
]

The anomaly entries for the partition look as follows:

Anomaly entry for bucket 1:

actualLogEntryRate	0
anomalyScore	7.39312
duration	900000
startTime	1570689000000 // Thursday, 10 October 2019 06:30:00
typicalLogEntryRate	55.67994661967715

Anomaly entry for bucket 2:

actualLogEntryRate	0
anomalyScore	8.252227
duration	900000
startTime	1570689900000 // Thursday, 10 October 2019 06:45:00
typicalLogEntryRate	55.67678191433922

The data for the above anomalies in annotation form look like the following:

{
  coordinates: {
    x0: 1570689000000 // Thursday, 10 October 2019 06:30:00
    x1: 1570689900000 // Thursday, 10 October 2019 06:45:00
  },
  details: "Max anomaly score: 7"
}
{
  coordinates: {
    x0: 1570689900000 // Thursday, 10 October 2019 06:45:00
    x1: 1570690800000 // Thursday, 10 October 2019 07:00:00
  },
  details: "Max anomaly score: 8"
}

However, despite there being series rendered on the chart, and annotations with overlapping x0 and x1 values, the annotations don't render. I initially thought this was just because of all the 0 values, but that's not the case with other examples. The chart code powering this lives here. Is there something I'm missing there?

@weltenwort
Copy link
Member Author

Maybe we need to specify a minimum interval on the y axis as well? Like, always show at least [0, 1]?

@Kerry350
Copy link
Contributor

Maybe we need to specify a minimum interval on the y axis as well? Like, always show at least [0, 1]?

Yep - that would work. But I'm still interested to know why other examples work without that 🤔

@markov00
Copy link
Member

@Kerry350 sorry for the late reply. I think that is a bug that needs to be solved on our end.
As identified by @weltenwort the problem is that the min value correspond to max value of your dataset. In that case, the chart max height is equal to the chart min height. A rectangle annotation is rendered using the existing data yScale (because if you want to can draw an annotation that with that start at a different y position). With this edge case the annotation is drawn but has 0 height.
Can you please open an issue in the elastic-chart repo https://github.com/elastic/elastic-charts to track that? thanks

FYI to have a better and quicker support for elastic-charts you can also ping the @elastic/elastic-charts team

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:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v7.5.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants