Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Add Grafana 7 compatibility #18

Closed
Alkarex opened this issue Jul 20, 2020 · 23 comments · Fixed by #24
Closed

Add Grafana 7 compatibility #18

Alkarex opened this issue Jul 20, 2020 · 23 comments · Fixed by #24
Assignees

Comments

@Alkarex
Copy link
Member

Alkarex commented Jul 20, 2020

At the moment, it does not look like this plugin works with Grafana 7

More precisely, might be related to Removes variableSrv grafana/grafana#24779

When coming to this plug-in, it looks like it is failing at compile time
https://github.com/grafana/grafana/blob/43033ddf7471bb005a8d24f4fda137441043cd2c/public/app/features/plugins/plugin_component.ts#L223

In the Web page:

An unexpected error happened: TypeError: this.events is undefined

image

In the browser console:

Plugin component error Error: [$injector:unpr] Unknown provider: variableSrvProvider <- variableSrv
http://errors.angularjs.org/1.6.9/$injector/unpr?p0=variableSrvProvider%20%3C-%20variableSrv
    Angular 11
        i
        injector
        a
        u
        a
        s
        invoke
        get
        it
        ct
        ut
    f plugin_component.ts:219
    f plugin_component.ts:254
    link plugin_component.ts:262
plugin_component.ts:265:18
@shreyasisinha
Copy link

I am still facing the same issue. Has this been resolved yet?

@Alkarex
Copy link
Member Author

Alkarex commented Aug 30, 2020

There is some work in progress. Hopefully by next week.

@shreyasisinha
Copy link

I am still facing the same issue. Has this been resolved yet?

What is the expected date of getting this issue fixed?

@Alkarex
Copy link
Member Author

Alkarex commented Sep 24, 2020

We have a new version about to be released. However, this new version will most likely drop support for Grafana 6 and older...

@Alkarex Alkarex linked a pull request Sep 25, 2020 that will close this issue
@Alkarex
Copy link
Member Author

Alkarex commented Sep 25, 2020

@shreyasisinha Would you be able to test this release candidate? #24

@alchuk
Copy link

alchuk commented Sep 28, 2020

@Alkarex I would like to test your RC against Grafana 7.2.0. How do I do it?

@Alkarex
Copy link
Member Author

Alkarex commented Sep 28, 2020

@alchuk You can for instance download the RC from https://github.com/alexandrainst/alexandra-trackmap-panel/archive/%2318_add_grafana_7_compatibility.zip and use it to replace the old version (after doing a backup).
See https://grafana.com/docs/grafana/latest/plugins/installation/

@Alkarex
Copy link
Member Author

Alkarex commented Sep 28, 2020

@alchuk We might have found an issue. Another of my colleagues is testing at the moment

@alchuk
Copy link

alchuk commented Sep 28, 2020

@Alkarex At least it stopped from crashing right after changing the visualisation type to TrackMap. I need to tune my backend as I have never used your plugin before. Will get back right away.

@j-or
Copy link
Collaborator

j-or commented Sep 28, 2020

@alchuk You can put the entire plugin in the grafana/data/plugins folder and run yarn install and yarn dev (see readme) - or if it's easier, just place the dist folder in grafana/data/plugins without any need for yarn. That should work too. Note: I just updated the RC branch.
install_track_map

@alchuk
Copy link

alchuk commented Sep 28, 2020

It doesn't seem to work for me. I'm using InfluxDB as a backend.
The following query gives 't is null' under the red error triangle:
SELECT median("lat") AS latitude, median("long") AS longitude FROM "Latlong" WHERE ("DID" = '117593705') AND time >= now() - 24h GROUP BY time(5m) fill(null)
The query itself gives a decent looking array of data. Is Influx supported by your product?

@j-or
Copy link
Collaborator

j-or commented Sep 28, 2020

It doesn't seem to work for me. I'm using InfluxDB as a backend.
The following query gives 't is null' under the red error triangle:
SELECT median("lat") AS latitude, median("long") AS longitude FROM "Latlong" WHERE ("DID" = '117593705') AND time >= now() - 24h GROUP BY time(5m) fill(null)
The query itself gives a decent looking array of data. Is Influx supported by your product?

Is the query in Grafana formatted as "Table"?

@alchuk
Copy link

alchuk commented Sep 28, 2020

Is the query in Grafana formatted as "Table"?

Yes

@ZhongyuWang
Copy link
Contributor

It doesn't seem to work for me. I'm using InfluxDB as a backend.
The following query gives 't is null' under the red error triangle:
SELECT median("lat") AS latitude, median("long") AS longitude FROM "Latlong" WHERE ("DID" = '117593705') AND time >= now() - 24h GROUP BY time(5m) fill(null)
The query itself gives a decent looking array of data. Is Influx supported by your product?

I have tried with Influx with no problem. Could you please try fill(0) instead?

@alchuk
Copy link

alchuk commented Sep 28, 2020

I have tried with Influx with no problem. Could you please try fill(0) instead?

Yeah. Thanks. Finally it helped me to get it working. Seems to be a bug.
By the way, "fill(none)" is what I've chosen to use as Influx always returns empty values for the first array entry no matter how deep I look back in time. As for fill(0), it gives a wrong starting point for the track (zero lat/zero lon).

Now there's another problem:
What could be wrong with Hexbin if it throws an exception "L.HexbinLayer is not a constructor"

@grootwitbaas
Copy link

testing this seems there is some offset on the long
Map below is centred near the location.
on error i see some small red triangle with some message, and to clear this i have to deselect tracmap in visulaisation and reselect it.
small extract from data in table:

Time | lat | lon
-- | -- | --
26/09/2020 12:06 | 4.113.506 | 953.636
26/09/2020 12:11 | 4.113.505 | 953.636
26/09/2020 12:16 | 4.113.506 | 953.636
26/09/2020 12:21 | 4.113.506 | 953.636
26/09/2020 12:26 | 4.113.506 | 953.636
26/09/2020 12:31 | 4.113.506 | 953.638
26/09/2020 12:36 | 4.113.505 | 953.637

image
Greetings from Germany
Groot

@grootwitbaas
Copy link

Sorry correcting the mallformated table
`

Time lat lon
26/09/2020 12:06 41.135 9.536
26/09/2020 12:11 41.135 9.536
26/09/2020 12:16 41.135 9.536
26/09/2020 12:21 41.135 9.536
26/09/2020 12:26 41.135 9.536
26/09/2020 12:31 41.135 9.536
26/09/2020 12:36 41.135 9.536
26/09/2020 12:41 41.135 9.536
26/09/2020 12:46 41.135 9.536

`

@ZhongyuWang
Copy link
Contributor

testing this seems there is some offset on the long
Map below is centred near the location.
on error i see some small red triangle with some message, and to clear this i have to deselect tracmap in visulaisation and reselect it.
small extract from data in table:

Time | lat | lon
-- | -- | --
26/09/2020 12:06 | 4.113.506 | 953.636
26/09/2020 12:11 | 4.113.505 | 953.636
26/09/2020 12:16 | 4.113.506 | 953.636
26/09/2020 12:21 | 4.113.506 | 953.636
26/09/2020 12:26 | 4.113.506 | 953.636
26/09/2020 12:31 | 4.113.506 | 953.638
26/09/2020 12:36 | 4.113.505 | 953.637

image
Greetings from Germany
Groot

Could you please confirm whether the center position is wrong. I check with Google Maps and it seems to be the same place as the center in your image.

Capture

@grootwitbaas
Copy link

yes this is the problem the cntre of map is where the location should be ploted, but it is far to the left like you can see. google maps shows corectly. I set the centre of map so as to see where it should plot.

@j-or
Copy link
Collaborator

j-or commented Sep 29, 2020

@grootwitbaas Have you tried switching visualisation type to Markers and clicking on a marker? That way, you can see what coordinates the data points are given on the map.

@grootwitbaas
Copy link

grootwitbaas commented Sep 29, 2020

so seems my b point is not taken, it shows 0
my 2 queries:
A: SELECT mean("value") AS "lat" FROM "GPS" WHERE ("metric" = 'Lat' AND "name" =~ /^somename$/) AND time >= now() - 2d GROUP BY time(5m) fill(none).
B: SELECT mean("value") AS "lon" FROM "GPS" WHERE ("metric" = 'Long' AND "name" =~ /^somename$/) AND time >= now() - 2d GROUP BY time(5m) fill(none)

response:Object
results:Array[2]
0:Object
statement_id:0
series:Array[1]
0:Object
name:"iDirect GPS"
columns:Array[2]
0:"time"
1:"lat"
values:Array[12]
0:Array[1601396240000,42.09065]
1:Array[1601396540000,42.09068]
2:Array[1601396840000,42.09066]
3:Array[1601397140000,42.09069]
4:Array[1601397440000,42.09068]
5:Array[1601397740000,42.09066]
6:Array[1601398040000,42.09072]
7:Array[1601398340000,42.09065]
8:Array[1601398640000,42.09069]
9:Array[1601398940000,42.09063]
10:Array[1601399240000,42.09064]
11:Array[1601399540000,42.09066]
1:Object
statement_id:1
series:Array[1]
0:Object
name:"iDirect GPS"
columns:Array[2]
0:"time"
1:"lon"
values:Array[12]
0:Array[1601396240000,11.78947]
1:Array[1601396540000,11.78948]
2:Array[1601396840000,11.78948]
3:Array[1601397140000,11.78947]
4:Array[1601397440000,11.78946]
5:Array[1601397740000,11.78948]
6:Array[1601398040000,11.78946]
7:Array[1601398340000,11.78948]
8:Array[1601398640000,11.78946]
9:Array[1601398940000,11.78948]
10:Array[1601399240000,11.78948]
11:Array[1601399540000,11.78948]

Alkarex added a commit that referenced this issue Oct 20, 2020
* Add Grafana 7 compatibility

* Update license in package.json

* Update README.md

Co-authored-by: Alexandre Alapetite <alexandre.alapetite@alexandra.dk>

* Add dist, update gitignore

* Fix map not updating on panel resize

Co-authored-by: Alexandre Alapetite <alexandre.alapetite@alexandra.dk>
@raul-parada
Copy link

I still get the error An unexpected error happened TypeError: this.events is undefined I've installed the plugin through terminal

@Alkarex
Copy link
Member Author

Alkarex commented Dec 22, 2020

@raul-parada Which exact version have you installed?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants