knightss27 / grafana-network-weathermap

A fully featured and customizable network weathermap plugin for Grafana (9.0+).
https://grafana.com/grafana/plugins/knightss27-weathermap-panel/
Apache License 2.0
139 stars 7 forks source link

link speed "undefined" #18

Closed andorwestphal closed 1 year ago

andorwestphal commented 2 years ago

Describe the problem I have a grafana installation v8.6.5 My data coming from OpenNMS with the Helm Plugin. In a Graph Daschboard everything works fine. Now to my Issue. I create a query like this: image and create a second query like this image I attach the query B to the Link . image After it i get an undefined message in the link. image As described in your FAQ's i saved the dashboard and reloaded the site. I also load the site in a private tab. But that not fixed the issue.

I have an test enviorment where it works fine. the only difference is the node attribute. here it is DCN_Router:abcgdl1 on the otherenviorment it is DCN_Router:1661954035842

That means that the ForignID is different. But that is the only thing what differs.

Thanks for your help.

knightss27 commented 2 years ago

That's odd. Are you able to confirm that they are actually receiving the right data? You should be able to see the data by clicking on the Panel Title > Inspect > Data. So you can compare between your test / real panels. image

Otherwise it is possible that the formatting of the data differs from what the weathermap is expecting. Are you able to do what I mentioned above, but after clicking Data choose JSON and then change the dropdown to "DataFrame structure" and then send the JSON in your response? This would be really helpful!

image

Also this is actually a different issue from the one listed on the FAQ page, so I'm not surprised that reloading didn't help.

andorwestphal commented 2 years ago

Hello,

the data looks ok for me. i compared it with the test enviorment and the structur looks the same. Also the values are formatted equally i attached the output here. So maybe you can see somthing odd. What i had overseen.

weathermap.txt

knightss27 commented 2 years ago

I think I found it, just for my own reference: https://github.com/knightss27/grafana-network-weathermap/blob/09f5c32771ceb91b655dd4b1543faa5c4c75b48c/src/WeathermapPanel.tsx#L251

I think I'm accessing values properly just above in this file (using .get(0)) and here I've assumed that there are objects with each value, which is at least true for Prometheus but clearly is not with your data source. This should be fixable, so I'll get on it.

knightss27 commented 1 year ago

Nevermind actually, I just noticed something with your data. On further comparison everything looks fine structure-wise, i.e. I am actually accessing things correctly. However, your data seems to have a null value as the last entry? It seems that my code should show a null value as undefined once formatted as a link label, so this is likely the origin of your issue. To add, the weathermap always takes the most recent available value, which is the last value in the data array (here it's null of course).

There's no way the weathermap could be causing this, so it's either an issue with your datasource plugin or your current data. Maybe you can manipulate your query somehow to always return a second-to-last value? That could be an last minute workaround if nothing else works.

"data": {
    "values": [
        [
          1662600900000,
          ...,
          1662621900000,
          1662622200000
        ],
        [
          3591.4479616499443,
          ...,
          3648.0865911843466,
          null
        ]
      ]
    }
andorwestphal commented 1 year ago

Hey i see the null statement also in a time series panel. so i wonder if it is possilble to manipulate the Weathermap in a way to make a 0 out of a null.

Best.

knightss27 commented 1 year ago

I could do that but I don't exactly want to as it's misleading considering a null and an actual 0 would be an important distinction for most people. This doesn't make sense for your data either, since it shouldn't be returning a null unless there actually isn't any data for that value. I will make it just show null for null values, but converting to a 0 would be up to you to do with your queries.