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

Add support for viewing search results in context for text logs (clp-text). #489

Merged
merged 31 commits into from
Jul 28, 2024

Conversation

junhaoliao
Copy link
Collaborator

@junhaoliao junhaoliao commented Jul 22, 2024

Description

These hyperlinks redirect users to the Log Viewer WebUI, which will:

  1. Submit an IR extraction job to the backend.
  2. As the job is being submitted, the state / any error message is displayed in the web view.
  3. Automatically redirect users to YScope's Log Viewer which opens the extracted file in IR format for further analysis.

This integration streamlines the workflow, making it easier for users to navigate from search results to detailed log analysis.

Validation performed

  1. Built and started the CLP package.
  2. Compressed sample log files.
  3. Started a sample search with search string "1" in the CLP WebUI (http://localhost:4000).
  4. Clicked on any results and observed a new browser tab was opened which displayed the loading state of the IR extraction job.
  5. When the job finished, YScope's Log Viewer was loaded with the log message selected in Step 4 being centered in a segment of log messages.

@@ -22,6 +22,14 @@ const plugins = [
];

const config = {
devServer: {
proxy: [
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proxy added to avoid CORS issues during development.

@@ -77,6 +78,12 @@ const SearchResultsTable = ({
}
};

const handleSearchResultClick = (ev) => {
const {orig_file_id: origFileId, log_event_ix: logEventIx} = ev.currentTarget.dataset;
window.open(`${Meteor.settings.public.LogViewerWebuiClientUrl
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future, we can open the Log Viewer in a split pane so users can see both the CLP search results and the log context at the same time. For the MVP, we can open the Log Viewer WebUI client in a new tab. Feel free to object.

@junhaoliao junhaoliao changed the title WIP - Add hyperlinks to CLP WebUI search results for IR extraction and Log Viewer integration. Add hyperlinks to CLP WebUI search results for IR extraction and Log Viewer integration. Jul 23, 2024
@junhaoliao junhaoliao requested a review from kirkrodrigues July 23, 2024 07:15
@junhaoliao junhaoliao changed the title Add hyperlinks to CLP WebUI search results for IR extraction and Log Viewer integration. Add hyperlinks to CLP WebUI search results for viewing log context in Log Viewer. Jul 23, 2024
@junhaoliao
Copy link
Collaborator Author

hey @haiqi96 , could you help triage this review?

@haiqi96
Copy link
Contributor

haiqi96 commented Jul 24, 2024

hey @haiqi96 , could you help triage this review?

The change looks reasonable to me, didn't notice any obvious issue

@@ -786,6 +786,7 @@ def start_webui(instance_id: str, clp_config: CLPConfig, mounts: CLPDockerMounts
},
"public": {
"ClpStorageEngine": clp_config.package.storage_engine,
"LogViewerWebuiClientUrl": f"http://{clp_config.log_viewer_webui.host}:{clp_config.log_viewer_webui.port}",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe just LogViewerWebuiUrl?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sg

/**
* Renders the main application.
*
* @return {JSX.Element}
*/
const App = () => {
return (
<h1>Hello world!</h1>
<CssVarsProvider modeStorageKey={"uiTheme"}>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create a const for string "uiTheme"

@@ -13,6 +13,7 @@
"AggregationResultsCollectionName": "aggregation-results",
"ClpStorageEngine": "clp",
"CompressionJobsCollectionName": "compression-jobs",
"LogViewerWebuiClientUrl": "http://localhost:8080",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about QueryStatus.jsx?

*
* @return {React.ReactElement}
*/
const Query = () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we name this the same as the file?

components/log-viewer-webui/client/src/ui/Loading.jsx Outdated Show resolved Hide resolved
components/log-viewer-webui/client/src/ui/Loading.jsx Outdated Show resolved Hide resolved
components/log-viewer-webui/client/src/ui/QueryState.jsx Outdated Show resolved Hide resolved
components/log-viewer-webui/client/public/index.html Outdated Show resolved Hide resolved
@junhaoliao junhaoliao requested a review from kirkrodrigues July 26, 2024 04:45
@junhaoliao junhaoliao changed the title Add hyperlinks to CLP WebUI search results for viewing log context in Log Viewer. Add redirect links to CLP WebUI search results for log context viewing with Log Viewer. Jul 26, 2024
Copy link
Member

@kirkrodrigues kirkrodrigues left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more suggestions.

components/log-viewer-webui/client/src/typings/query.js Outdated Show resolved Hide resolved
*
* @enum {QueryLoadState}
*/
const QUERY_LOAD_STATE = Object.freeze({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QUERY_LOADING_STATES?

/**
* Descriptions for query states.
*/
const QUERY_STATE_DESCRIPTIONS = Object.freeze({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QUERY_LOADING_STATE_DESCRIPTIONS?

/**
* @typedef {number} QueryLoadState
*/
let enumQueryLoadState;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enumQueryLoadingState?

junhaoliao and others added 4 commits July 27, 2024 13:19
Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com>
…ggestions from code review

Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com>
Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com>
@junhaoliao junhaoliao requested a review from kirkrodrigues July 27, 2024 17:48
Copy link
Member

@kirkrodrigues kirkrodrigues left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the PR title, how about:

Add support for viewing search results in context for text logs (clp-text).

@junhaoliao junhaoliao changed the title Add redirect links to CLP WebUI search results for log context viewing with Log Viewer. Add support for viewing search results in context for text logs (clp-text). Jul 28, 2024
@junhaoliao junhaoliao merged commit 2c99375 into y-scope:main Jul 28, 2024
4 checks passed
jackluo923 pushed a commit to jackluo923/clp that referenced this pull request Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants