Skip to content

fix: normalize Loki data frames in check test button#1566

Merged
VikaCep merged 2 commits into
mainfrom
fix/check-test-button
Jan 29, 2026
Merged

fix: normalize Loki data frames in check test button#1566
VikaCep merged 2 commits into
mainfrom
fix/check-test-button

Conversation

@VikaCep

@VikaCep VikaCep commented Jan 29, 2026

Copy link
Copy Markdown
Contributor

Problem

The check test button was broken when Loki returned data frames using the new schema format (with field names timestamp and body) instead of the old schema format (with field names Time and Line). This caused the ad-hoc check logs to fail to parse, preventing users from seeing the results of their check tests.

This is the same issue that was fixed for the Timepoint Explorer in PR #1540.

Solution

This PR applies the same normalization pattern from PR #1540 to the check test button's log parsing logic.
A new normalizeDataFrameJSON() function has been added that converts old schema field names to new schema field names before processing. This function reuses the existing normalizeLokiDataFrame() logic by converting DataFrameJSON to DataFrame, normalizing, and converting back. This ensures both functions use identical normalization logic and stay in sync.
The useAdHocLogs hook now normalizes incoming frames before extracting log data, allowing it to handle both old and new Loki schema formats seamlessly.

The check test button was broken when Loki returned data frames using
the new schema format (timestamp, body) instead of the old format
(Time, Line). This applies the same normalization pattern from PR #1540.

- Add normalizeDataFrameJSON() that reuses normalizeLokiDataFrame logic
- Update useAdHocLogs to normalize frames before processing
- Use LokiFieldNames enum for consistent field name references
- Add tests for normalizeDataFrameJSON
@VikaCep VikaCep self-assigned this Jan 29, 2026
@VikaCep VikaCep requested a review from a team as a code owner January 29, 2026 15:15
@VikaCep VikaCep requested review from ckbedwell and g3john and removed request for a team January 29, 2026 15:15
@github-actions github-actions Bot added the fix A fix applied to the application. label Jan 29, 2026
@github-actions

github-actions Bot commented Jan 29, 2026

Copy link
Copy Markdown

Script size changes

Name +/- Main This PR Outcome
[263.js] +4.20% 1,646.45 kB 1,715.58 kB
[234.js] New file - 805.52 kB
[datasource/module.js] +1.79% 24.56 kB 25.00 kB
[692.js] -0.06% 20.57 kB 20.56 kB
[663.js] -0.24% 5.84 kB 5.82 kB
[module.js] +0.99% 4.85 kB 4.90 kB
[88.js] Deleted file 984.46 kB -

Totals

Name +/- Main This PR Outcome
[Scripts] -4.07% 2,686.74 kB 2,577.38 kB
[Non-script Assets] +0.10% 2,671.09 kB 2,673.67 kB
[All] -1.99% 5,357.82 kB 5,251.05 kB

Generated by 🚫 dangerJS against 4386560

@ckbedwell ckbedwell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM Thank you for turning this around so fast ❤️

@VikaCep VikaCep merged commit 66af354 into main Jan 29, 2026
36 checks passed
@VikaCep VikaCep deleted the fix/check-test-button branch January 29, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix A fix applied to the application.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants