All rules not working when one value mapping rule get the "null" metric
Sunnor opened this issue · 11 comments
Hi Arnaud,
I want to report a bug, would you help to check?
[Issue]: All Text Mapping and Value Mapping rules will be not working when a Value Mapping rule get the "null " metric value.
[Version]: 0.4.0
[Reproduce Steps]:
1. Create a panel and add some mapping rules.
2. Panel display normally.
3. Due to some database networking issue, grafana may query some metrics with "null" value sometimes. If this metric is bonding to a value mapping rule, then all rules will be not working. And there will an error cannot read property "toString" of null
[Desired result]: It should only affect the specific rule that have the problem, instead of broking all rules.
Hi Sunor,
Can you give stack trace in console plz ?
have you try version 0.5.0 ?
BR
Arnaud
Hi Arnaud,
Do you mean this one?
metrics_panel_ctrl.ts:179 Panel data error: TypeError: Cannot read property 'toString' of null
at Rule.getFormattedValue (rule_class.js:697)
at State.setState (state_class.js:92)
at eval (statesHandler.js:256)
at Array.forEach ()
at eval (statesHandler.js:255)
at Array.forEach ()
at eval (statesHandler.js:254)
at Array.forEach ()
at StateHandler.setStates (statesHandler.js:252)
at Flowchart.setStates (flowchart_class.js:143)
And I haven't tried 0.5.0 yet. I'll have a try and update the testing result
what is the type of your value ? string ? number ? date ?
- I can reproduce this issue with version 0.5.0
Panel data error: TypeError: Cannot read property 'toString' of null
at Rule.getFormattedValue (rule_class.js:541)
at State.setState (state_class.js:122)
at eval (statesHandler.js:159)
at Array.forEach ()
at eval (statesHandler.js:158)
at Array.forEach ()
at eval (statesHandler.js:157)
at Array.forEach ()
at StateHandler.setStates (statesHandler.js:155)
at Flowchart.setStates (flowchart_class.js:113)
-
I have number values and string values in this diagram, but the one that leading the issue is a string value with "Value Mappings" rule.
-
BTW, 0.5.0 looks awesome, great job!
I think i fix it during my lunch, can you try it ?
on https://algenty.github.io/flowcharting-repository/ARCHIVES.html
0.6.0 snapshot
You're welcome 👍
I choose '-' when metric is null, i don't know if that is a good choise, you can change that with Value mapping : - => ' ' in rule.
Have you try graph tooltip on your columns Google/facebook ? be carefull histogram test is in progress in 0.6.0, Line Graph works very well for me.
Can i had you screenshot for tweeter and gallery ?
BR
Arnaud
i know why, i think i come back for null value but you can change it into value mapping.
Can you try the last build and map 'null' with 'Error' ?