-
Notifications
You must be signed in to change notification settings - Fork 12.1k
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
Explore: Display log lines context #17097
Conversation
Looks very promising 🚀 Here is some feedback on what's already there:
Otherwise great stuff! |
This comment has been minimized.
This comment has been minimized.
Looking really good now. More feedback:
Stretch goals:
This feature is really shaping up 🚀 |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works really well. Minor nits here and there, but otherwise good to merge.
/** | ||
* Retrieve context for a given log row | ||
*/ | ||
getLogRowContext?(row: any, limit?: number): Promise<DataQueryResponse>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is a row completely untyped? don't we need the LogsModel and the row model is LogRowModel (and could be good to have both).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree about LogRowModel. Not necessarily abut LogsModel - why do you think it could be helpful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not 100% sure a single row can be enough information to construct a query for the context. You might need labels and the original query & response to create the context query.
@@ -282,6 +287,10 @@ export interface DataQueryResponse { | |||
data: DataQueryResponseData[]; | |||
} | |||
|
|||
export interface LogRowContextQueryResponse { | |||
data: Array<Array<string | DataQueryError>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this response type looks very strange, should this not be SeriesData?
* 'master' of github.com:grafana/grafana: LDAP: add tests for initialBind (#17132) Explore: Adds Live option for supported datasources (#17062) alerting: fix a bunch of lint issues. (#17128) chore: mocks plugin loader for DataSourceSettingsPage tests (#17157) Release: Improved cherry pick task (#17087) Explore: Fix selection/copy of log lines (#17121) Explore: Fix empty space in toolbar on smaller devices (#17110) Explore: display log line context (#17097) Plugins: expose rxjs matching 6.4.0 (#17148) Chore: fix codespell issue with build (#17144)
@dprokop Is it possible to display more than 10 log rows when I click "Load 10 more" ? |
#15140
This PR introduces a possibility to display Loki log line context, meaning that it when clicked on "Show context" in log row, additional log rows for a given row's log stream will be fetched and diaspayed.
react-use
In this PR
react-use
lib is introduced for common react hooks to be available in Grafana's codebase. Main reason for that is usage ofuseAsync
inLogRowContextProvider
to make fetching context and additional context rows easy. Instead of using React's class component lifecycle, hooks take responsibility for managing the context state and delivering it to log context components.TODO: