diff --git a/ui/src/logs/containers/LogsPage.tsx b/ui/src/logs/containers/LogsPage.tsx index ee3d8bcb7..d9ffb547d 100644 --- a/ui/src/logs/containers/LogsPage.tsx +++ b/ui/src/logs/containers/LogsPage.tsx @@ -250,6 +250,7 @@ class LogsPage extends PureComponent { width={width} height={height} colorScale={colorForSeverity} + onBarClick={this.handleBarClick} /> )} @@ -316,6 +317,19 @@ class LogsPage extends PureComponent { this.props.executeQueriesAsync() } + private handleBarClick = (group: BarGroup): void => { + const {data} = group + + if (!data.length) { + return + } + + const unixTimestamp = data[0].time + const timeOption = moment(unixTimestamp).toISOString() + + this.handleSetTimeMarker({timeOption}) + } + private handleSetTimeBounds = async () => { const {seconds, windowOption, timeOption} = this.props.timeRange let lower = `now() - ${windowOption}`