grafana/public/app/features/explore
David 57abf39f25
Logs: Use result range instead of timepicker range for log histogram (#25027)
* Logs: Use result range instead of timepicker range for log histogram

If a logs datasource does not send histogram data for the requested
time range, the logs model computes a timeseries based on the log row
counts, bucketed by an automcatically calculated time interval. Even
when this histogram time series did not span the whole requested time
range it was still rendered in the graph across the whole range, leaving
an empty area at its start. Users find this confusing and are lead to
believe their log data is missing.

This change fixes this by anchoring the start of the timeseries on the
first log row's timestamp from the result, and adds this smaller range
as `visibleRange` to the logs model and passes it through to the logs
component that optionally takes it into account to not render the empty
area.
The interval (bucket size) is also adjusted to account for a potentially
finer resolution on the shorter visible time interval.
The bucketsize multiplier was also changed from 10 to 20 to account for
the space between the chart's bars.

* Aligned visible range with buckets

* Extract bucket size calculation and add test
2020-05-29 15:39:13 +02:00
..
__mocks__ Chore: Bumps prettier version for new typescript syntax support (#20463) 2019-11-19 13:59:39 +00:00
__snapshots__ Explore: Fix query rows styles (#23973) 2020-04-27 23:53:15 +02:00
RichHistory Query history: Add keyboard shortcut support for commenting (#24736) 2020-05-21 14:51:18 +02:00
slate-plugins/prism Chore: Moves QueryField to @grafana/ui (#19678) 2019-10-31 08:27:01 +00:00
state Explore: fix update url on mode change (#25084) 2020-05-26 14:54:18 +02:00
TraceView Tracing: Remove collapsing of header (#24153) 2020-05-05 12:30:16 +02:00
utils Logs: Use result range instead of timepicker range for log histogram (#25027) 2020-05-29 15:39:13 +02:00
AdHocFilter.tsx Forms migration: Old Select to Legacy namespace (#23200) 2020-04-02 10:57:35 +02:00
AdHocFilterField.test.tsx TSLint → ESLint (#21006) 2020-02-08 02:40:04 +01:00
AdHocFilterField.tsx Theme: Typography variables overhaul, theme cleanup, improvents to storybook ThemeColors component (#23531) 2020-04-14 11:32:14 +02:00
ElapsedTime.tsx React: refactor away from unsafe lifecycle methods (#21291) 2020-05-18 18:03:29 +02:00
ErrorContainer.test.tsx Explore: adds QueryRowErrors component, moves error display to QueryRow (#22438) 2020-03-11 10:01:58 +01:00
ErrorContainer.tsx @grafana/ui: Replace various icons using Icon component (#23442) 2020-04-12 22:20:02 +02:00
Explore.test.tsx Explore: Prevents sizing issue when split (#23596) 2020-04-16 14:28:46 +02:00
Explore.tsx Datasource/CloudWatch: Switch to metrics mode, logs API, when choosing stats query from cheatsheet (#24398) 2020-05-11 17:43:53 +01:00
ExploreGraphPanel.tsx DateTime: adding support to select preferred timezone for presentation of date and time values. (#23586) 2020-04-27 15:28:06 +02:00
ExploreTimeControls.tsx Dashboard: new updated time picker (#20931) 2019-12-20 15:31:58 +01:00
ExploreToolbar.tsx Explore: No longer changes run button red with "cancel" text when live tailing (#24106) 2020-05-05 09:40:47 +01:00
JSONViewer.tsx Chore: noImplicitAny Sub 500 errors (#18287) 2019-07-30 15:49:32 +02:00
LiveLogs.test.tsx Explore: fixes log entries sorting - changes milliseconds to nanoseconds (#24303) 2020-05-07 13:53:24 +02:00
LiveLogs.tsx React: refactor away from unsafe lifecycle methods (#21291) 2020-05-18 18:03:29 +02:00
LiveTailButton.tsx @grafana/ui: Various smaller Icon updates (#23588) 2020-04-16 13:49:58 +02:00
Logs.tsx Logs: Use result range instead of timepicker range for log histogram (#25027) 2020-05-29 15:39:13 +02:00
LogsContainer.tsx Logs: Use result range instead of timepicker range for log histogram (#25027) 2020-05-29 15:39:13 +02:00
MetaInfoText.test.tsx Explore: adds MetaInfoText tests 2020-01-30 12:02:50 +00:00
MetaInfoText.tsx Explore: adds export of MetaItem and its props 2020-01-30 12:02:50 +00:00
NoDataSourceCallToAction.tsx @grafana/ui: Replace various icons using Icon component (#23442) 2020-04-12 22:20:02 +02:00
QueryEditor.tsx Chore: Remove several instances of non-strict null usage (#20563) 2019-11-26 09:01:32 +00:00
QueryRow.test.tsx Explore: Fix rendering of react query editors (#24593) 2020-05-13 15:56:22 +02:00
QueryRow.tsx Explore: Fix rendering of react query editors (#24593) 2020-05-13 15:56:22 +02:00
QueryRowActions.test.tsx @grafana/ui: Replace various icons using Icon component (#23442) 2020-04-12 22:20:02 +02:00
QueryRowActions.tsx @grafana/ui: Various smaller Icon updates (#23588) 2020-04-16 13:49:58 +02:00
QueryRows.tsx Explore: Revert QueryRows refactor (#24444) 2020-05-08 17:49:47 +02:00
QueryStatus.test.tsx Chore: Reorg packages (#20111) 2019-10-31 10:48:05 +01:00
QueryStatus.tsx React: refactor away from unsafe lifecycle methods (#21291) 2020-05-18 18:03:29 +02:00
ResponsiveButton.tsx Datasource/Cloudwatch: Adds support for Cloudwatch Logs (#23566) 2020-04-25 22:48:20 +02:00
RunButton.tsx Explore: No longer changes run button red with "cancel" text when live tailing (#24106) 2020-05-05 09:40:47 +01:00
SecondaryActions.test.tsx Explore: Add trace UI to show traces from tracing datasources (#23047) 2020-04-02 13:34:16 +02:00
SecondaryActions.tsx Theme: Typography variables overhaul, theme cleanup, improvents to storybook ThemeColors component (#23531) 2020-04-14 11:32:14 +02:00
TableContainer.test.tsx Explore: adds basic tests to TableContainer checking the render and output on 0 series returned 2020-01-30 12:02:50 +00:00
TableContainer.tsx Trace UI demo (#20297) 2020-03-25 12:25:39 +01:00
Time.tsx React: refactor away from unsafe lifecycle methods (#21291) 2020-05-18 18:03:29 +02:00
TimeSyncButton.test.tsx Explore: Add unit test to TimeSyncButton (#19836) 2019-10-16 11:48:10 +02:00
TimeSyncButton.tsx @grafana/ui: Various smaller Icon updates (#23588) 2020-04-16 13:49:58 +02:00
useLiveTailControls.ts Explore: Sync timepicker and logs after live-tailing stops (#20979) 2019-12-11 14:14:39 +01:00
Wrapper.tsx Tracing: Adds header and minimap (#23315) 2020-04-08 17:16:22 +02:00