Skip to content

LogLine: Add Explain in Assistant option to explain single log lines #108387

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

Merged
merged 16 commits into from
Jul 23, 2025

Conversation

svennergr
Copy link
Contributor

@svennergr svennergr commented Jul 21, 2025

*What is this feature?

Adds an Explain in Assistant option to explain single log lines in each logs panel.

Screen.Recording.2025-07-22.at.13.43.05.mov

@svennergr svennergr added no-backport Skip backport of PR no-changelog Skip including change in changelog/release notes labels Jul 22, 2025
@svennergr svennergr marked this pull request as ready for review July 22, 2025 11:43
@svennergr svennergr requested review from a team and grafanabot as code owners July 22, 2025 11:43
@svennergr svennergr requested review from gabor and removed request for a team, grafanabot and gabor July 22, 2025 11:43
@github-actions github-actions bot added this to the 12.1.x milestone Jul 22, 2025
@gtk-grafana gtk-grafana requested a review from matyax July 22, 2025 12:21
@matyax
Copy link
Contributor

matyax commented Jul 22, 2025

What do you think if we do the same thing in the panel and explose this everywhere? I can give it a try later today.

@svennergr
Copy link
Contributor Author

What do you think if we do the same thing in the panel and expose this everywhere? I can give it a try later today.

Do you mean in the panel menu?

@matyax
Copy link
Contributor

matyax commented Jul 22, 2025

Ah you already did it! 😆 . I saw this while having lunch and assumed Logs Drilldown. Amazing!

@@ -81,6 +84,43 @@ export const LogLineMenu = ({ log, styles }: Props) => {
}
}, [log, onPinLine, onUnpinLine, pinned]);

const openAssistant = useCallback(async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be moved to https://github.com/grafana/grafana/blob/main/public/app/features/logs/components/panel/LogListContext.tsx, exposing both isAssistantAvailable and openMainAssistant through useLogListContext(), allowing this to be used here and in the new Log Details: https://github.com/grafana/grafana/blob/main/public/app/features/logs/components/panel/LogLineDetailsHeader.tsx

Copy link
Contributor

@matyax matyax left a comment

Choose a reason for hiding this comment

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

Looks great to me! Feel free to decide whether to keep it in the Line menu, or also add it to details through context.

@svennergr svennergr requested review from a team as code owners July 22, 2025 19:45
@svennergr svennergr requested review from konsalex, ivanortegaalba and bfmatei and removed request for a team July 22, 2025 19:45
@svennergr svennergr requested review from matyax and removed request for a team, konsalex, ivanortegaalba and bfmatei July 22, 2025 20:06
@svennergr
Copy link
Contributor Author

Sorry for the spam here. @matyax I moved to the context - that's cool. Would appreciate another look!

Copy link
Contributor

@matyax matyax left a comment

Choose a reason for hiding this comment

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

👏 👏

@svennergr svennergr merged commit f657044 into main Jul 23, 2025
96 of 97 checks passed
@svennergr svennergr deleted the svennergr/explain-log-lines branch July 23, 2025 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/backend area/frontend no-backport Skip backport of PR no-changelog Skip including change in changelog/release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants