Skip to content

Conversation

@markjmeier
Copy link
Contributor

What this PR does / why we need it:

Introduces a toggle to only show error logs. For checks with lots of logs, these can be hard to find/surface.

It's worth considering if we should default this to on, if there are any error logs present. We should also consider if theres potentially a better way to filter logs. this is a quick and dirty fix for users with a large number of logs lines in a check

Which issue(s) this PR fixes:

n/a

Fixes #

Special notes for your reviewer:

image

@markjmeier markjmeier requested a review from a team as a code owner November 26, 2025 20:25
@markjmeier markjmeier requested review from ckbedwell and w1kman and removed request for a team November 26, 2025 20:25
@github-actions github-actions bot added the feature A feature added to the application. label Nov 26, 2025
@github-actions
Copy link

Script size changes

Name +/- Main This PR Outcome
[502.js] = 1,736.41 kB 1,736.41 kB
[224.js] +0.10% 955.08 kB 956.00 kB
[datasource/module.js] = 24.49 kB 24.49 kB
[692.js] = 20.41 kB 20.41 kB
[663.js] = 5.84 kB 5.84 kB
[module.js] = 4.92 kB 4.92 kB

Totals

Name +/- Main This PR Outcome
[Scripts] +0.03% 2,747.15 kB 2,748.07 kB
[Non-script Assets] = 2,660.26 kB 2,660.26 kB
[All] +0.02% 5,407.41 kB 5,408.32 kB

Generated by 🚫 dangerJS against ffd4b80

Copy link
Contributor

@w1kman w1kman left a comment

Choose a reason for hiding this comment

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

The component explodes when "Error logs only" is enabled at the same time as "Raw logs".

explosion.mp4

IF we intend to fix the raw logs switch, I'd suggest moving the state outside of the two components, so that they share the state of the Switch. It somewhat frustrating to toggle the switch again when switching to raw and vice versa.

The switch

  • The label for the switch has a pointer, but clicking it does nothing.
  • The label text/color does not follow the styles of a form field
switch-pointer.mp4

Suggestion: Use an InlineField (with appropriate flex-box styling) with a Switch as child. It will allow for the label to be clickable as well as styling the label.

Image

No empty state
When there are no error logs, there is "nothing".
Consider adding an empty state that clearly indicates that stuff is hidden and can be displayed

Image Image

Thoughts
Ideally, it should be possible to filter on any log level.


export const LogsRaw = <T extends UnknownParsedLokiRecord>({ logs }: { logs: T[] }) => {
const [width, setWidth] = useState(0);
const [errorOnly, setErrorOnly] = useState(false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit-ish: errorLogsOnly seems like a better fit, based on what it controls.

<div>
<Box paddingBottom={1} display="flex" justifyContent="flex-end">
<InlineSwitch
label="Error logs only"
Copy link
Contributor

Choose a reason for hiding this comment

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

Enabling this will throw an error

mainKey: string;
}) => {
const styles = useStyles2(getStyles);
const [errorOnly, setErrorOnly] = useState(false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit-ish: errorLogsOnly seems like a better fit, based on what it controls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature A feature added to the application.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants