Skip to content
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

All rules not working when one value mapping rule get the "null" metric #65

Closed
Sunnor opened this issue Oct 29, 2019 · 11 comments
Closed
Labels
bug Something isn't working Fixed

Comments

@Sunnor
Copy link

Sunnor commented Oct 29, 2019

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.
image
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
image
image

[Desired result]: It should only affect the specific rule that have the problem, instead of broking all rules.

@algenty
Copy link
Owner

algenty commented Oct 29, 2019

Hi Sunor,
Can you give stack trace in console plz ?
have you try version 0.5.0 ?

BR
Arnaud

@Sunnor
Copy link
Author

Sunnor commented Oct 29, 2019

Hi Arnaud,

Do you mean this one?
image

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

@algenty
Copy link
Owner

algenty commented Oct 29, 2019

what is the type of your value ? string ? number ? date ?

@Sunnor
Copy link
Author

Sunnor commented Oct 29, 2019

  1. 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)

  1. 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.

  2. BTW, 0.5.0 looks awesome, great job!

algenty added a commit that referenced this issue Oct 29, 2019
@algenty
Copy link
Owner

algenty commented Oct 29, 2019

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

@algenty algenty added bug Something isn't working Fixed labels Oct 29, 2019
@Sunnor
Copy link
Author

Sunnor commented Oct 30, 2019

It's good now with your 0.6.0 snapshot.

One or two value mapping rules getting "null" value will not break all rules now. it will show a "-" instead.
image

Thanks a lot for quick fix.

Looking forward to having the 0.6.0 version.

@Sunnor Sunnor closed this as completed Oct 30, 2019
@algenty
Copy link
Owner

algenty commented Oct 30, 2019

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

@Sunnor
Copy link
Author

Sunnor commented Oct 30, 2019

Hi Arnaud,

  1. I tried map "-" to other string like "Error", but it seems not working, it still display "-".

image

  1. Yes, I've tried graph tooltip in both 0.5.0 and 0.6.0, it works fine. This feature looks awesome.

  2. Sorry, I didn't get your meaning of "tweeter and gallery", may I know what they are?

@algenty
Copy link
Owner

algenty commented Oct 30, 2019

i know why, i think i come back for null value but you can change it into value mapping.

@algenty
Copy link
Owner

algenty commented Oct 30, 2019

Can you try the last build and map 'null' with 'Error' ?

@Sunnor
Copy link
Author

Sunnor commented Oct 31, 2019

I tried 0.6.0, still show "-".


image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Fixed
Projects
None yet
Development

No branches or pull requests

2 participants