-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
Inspector: Show transformation query errors #73344
Conversation
@@ -67,7 +67,7 @@ export const InspectErrorTab = ({ errors }: InspectErrorTabProps) => { | |||
return ( | |||
<> | |||
{errors.map((error, index) => ( | |||
<Alert title={error.refId || `Query ${index + 1}`} severity="error" key={index}> | |||
<Alert title={error.refId || `Error ${index + 1}`} severity="error" key={index}> |
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.
changing the text here because the error has no relation to query index
@@ -41,6 +41,10 @@ export const heatmapTransformer: SynchronousDataTransformerInfo<HeatmapTransform | |||
|
|||
transformer: (options: HeatmapTransformerOptions) => { | |||
return (data: DataFrame[]) => { | |||
if (1 === 1) { | |||
data[200].fields = []; // will throw an exception! |
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.
^^^ DO NOT MERGE... this just forces an error for testing
const [dataOptions, setDataOptions] = useState<GetDataOptions>({ | ||
withTransforms: false, | ||
withTransforms: defaultTab === InspectTab.Error, |
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.
previously this would mask any xform errors since they are not run
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.
yea, working on the new inspector for scenes and I looked at this code and its very confusing that the data options that live under the Data tab can affect the data passed to other tabs. (Not doing that for scene inspect drawer)
@@ -63,8 +63,10 @@ export const usePanelLatestData = ( | |||
|
|||
return { | |||
data: latestData, | |||
error: latestData && latestData.error, |
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 was only checking the deprecated property... not the other flavors that will show alerts in the panel
@@ -272,6 +272,8 @@ describe('PanelQueryRunner', () => { | |||
|
|||
ctx.runner.getData({ withTransforms: true, withFieldConfig: true }).subscribe({ | |||
next: (data: grafanaData.PanelData) => { | |||
console.log('XFORM', data); |
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.
TODO... not yet sure how to test this :(
@@ -228,7 +228,7 @@ export class PanelQueryRunner { | |||
return of({ | |||
...data, | |||
state: LoadingState.Error, | |||
error: toDataQueryError(err), | |||
errors: [toDataQueryError(err)], |
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 PR fixes the inspector so it also shows errors when the array is set... that is good because the single error flavor is deprecated in favor of using the array
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.
Hey Ryan 👋🏾 , I took a look at the PR, codewise looks good. I tested locally and from the user perspective, I think it makes sense.
I left a small comment about an edge case.
Thanks for helping with this ⭐
public/app/features/dashboard/components/Inspector/InspectContent.tsx
Outdated
Show resolved
Hide resolved
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.
🥳
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.
if (1 === 1) { | ||
data[200].fields = []; // will throw an exception! | ||
} | ||
|
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.
😬 - just want to make sure we remember to remove this before merging
if (1 === 1) { | |
data[200].fields = []; // will throw an exception! | |
} |
What is this feature?
While working on #73451, I discovered that the inspect error tab will not show transformation errors
Why do we need this feature?
Currently when transforms have an error you can not see them in the inspector. With this PR they will now show up:
This is more important when multiple errors may exist and the inspector is the only way to know what happened