panodata-map-panel
panodata-map-panel copied to clipboard
ClickThrough issue
Dear developers,
I'm facing an issue using ClickThrough option. I have defined value in datapoint, called link:
[
{
"key": "CPH",
"latitude": 55.6760,
"longitude": 12.5683,
"name": "Copenhagen",
"link": "3"
}
]
According to the manual in https://community.hiveeyes.org/t/grafana-worldmap-panel-ng/1824 it should be possible to add a variable which is called link
into my URL like:
http://10.20.187.38/zabbix/zabbix.php?action=dashboard.view&dashboardid=$__point_link
But it just doesn't work. Eventually, I want it to open this: http://10.20.187.38/zabbix/zabbix.php?action=dashboard.view&dashboardid=3
Thank you for your help in advance.
Dear @rsaifulin,
thanks for writing in. While the revamped version of Worldmap NG is still considered experimental, we can't promise yet that everything works as expected. However, we will be happy to look into this issue.
So, after re-reading the documentation you referenced, especially the section at [1,2], we found that the variable might have to be referenced like $__field_link
instead of $__point_link
, right?
I believe the following section of documentation might apply to your scenario. Please correct me if I'm wrong.
2. Pull variables from data point fields
Add basic variable interpolation based on keys from dataPoint
. Saying that, all metric values have been added to the data point beforehand by prefixing them with "__field_
" (source).
Example I
If there’s a field called station_id
in the current data point, using this inside a panel control option is easy by addressing it with $__field_station_id
.
Example II
# Add clickthrough-link, interpolating the geohash value.
?panel-clickthroughUrl=/path/to/?geohash=$__field_geohash
Maybe I'm mixing things up right now as things are not trivial down there in data transformation land. So, please bear with me and tell me straight ahead if I'm understanding things wrong here.
With kind regards, Andreas.
[1] https://community.hiveeyes.org/t/grafana-worldmap-panel-ng/1824/13 [2] https://community.hiveeyes.org/t/grafana-worldmap-panel-ng/1824/14
Dear @amotl,
Thank you for your quick response. Really appreciate it. I followed your suggestions and unfortunately nothing worked. Here are some option that I tried:
[ { "key": "CPH", "latitude": 55.6760, "longitude": 12.5683, "name": "Copenhagen", "link": "zabbix.php?action=dashboard.view&dashboardid=3" } ]
Example I: Following the template
/path/to/$__field_link
http://10.20.187.38/zabbix/$__field_link - without success
Example II: Following the template
?panel-clickthroughUrl=/path/to/?geohash=$__field_geohash
http://10.20.187.38/zabbix?panel-clickthroughUrl=/$__field_link - instead it opens
http://10.20.187.38/zabbix
ignoring ?panel-clickthroughUrl=/$__field_link
Original link that I'm trying to reach is:
http://10.20.187.38/zabbix/zabbix.php?action=dashboard.view&dashboardid=3
Do you know any way how can I test $__field_link variable? It seems that it is just not being accepted.
Thank you again for your help.
Dear @rsaifulin,
[ { "key": "CPH", "latitude": 55.6760, "longitude": 12.5683, "name": "Copenhagen", "link": "zabbix.php?action=dashboard.view&dashboardid=3" } ]
Would you actually like to use the link referenced in the link
field verbatim without interpolating anything into it?
Then, you might want to use the option outlined in this screenshot.
However, please bear with us again if this is obviously the wrong path. If this does not resonate with what you are aiming at, please tell us again and we will have to sublimate ourselves more deeply into your scenario.
With kind regards, Andreas.
Dear @amotl,
Thank you for your advice. I still keep trying to resolve the issue using your method (obtain json lookup with key value from database). It requires table format and I always get "Format mismatch error" along with "cannot read propery 0":
I tried different formats, but aparently I get the same issue (I'm getting response status 200, which means it sees the json file), so something is wrong with the file format.
Could you please advice how can I convert timeseries json to table json?
[
{
"key": "CPH",
"latitude": 55.6760,
"longitude": 12.5683,
"name": "Copenhagen",
"link": "http://10.20.187.38/zabbix/zabbix.php?action=dashboard.view&dashboardid=3"
}
]
PS I also tried to use official documentation from https://grafana.com/grafana/plugins/grafana-worldmap-panel and convert my json to the following format, but it also did not work:
"series": [
{
"name": "logins.count",
"tags": {
"geohash": "9wvfgzurfzb"
},
"columns": [
"time",
"metric"
],
"values": [
[
1529762933815,
75.654324173059
]
]
}
]
Thank you again for your advices.
Regards, Rafis
Dear @rsaifulin,
sorry for the delay. I have been pretty much swamped for the time being.
If you are still getting the error regarding
It requires table format and I always get "Format mismatch error: timeseries data can not be interpreted as table format"
you might want to switch between timeseries or table format within your metric settings.
Please let us know if that makes any difference for you.
With kind regards, Andreas.
convert my json to the following format
Maybe we are facing a misunderstanding here. Right now, I am unsure whether you are already getting points on your map (or not) or if you are still asking for making the specific click-through thing work. May I humbly ask you about this detail again, @rsaifulin?
Dear @rsaifulin,
may I humbly ask you again how a) the data within your primary data source and b) the data within the JSON file looks like?
Data is combined in totally different ways within the Map Panel and how it actually works is not always transparent to the user due to its complexity. We tried our best to make everything more robust within our work on the overhauled Worldmap Panel.
We are mostly using it by getting the location information from the primary data source (geohash
field) and look up overlay information for the popup from the JSON resource. Are you actually storing the location information within the JSON resource itself?
I am still trying to figure out how your setup exactly looks like in order to be able to pinpoint the issue you are observing. We might have different perspectives here.
So, is this snippet
[
{
"key": "CPH",
"latitude": 55.6760,
"longitude": 12.5683,
"name": "Copenhagen",
"link": "3"
}
]
actually a part of the JSON resource you are addressing? So, the attribute called link
might be better called zabbix_dashboard_id
when trying to interpolate it into the clickthrough URL setting?
I am just trying to get more into the details of your setup here by figuring out which data is coming from where.
With kind regards, Andreas.
hi @amotl, thanks for your explanations above. I would like to pick up from here since i feel i have the same issue. I rely on an elastic query returning a metric (Sum), location reference (bcc.channel.key.keyword) and a geohash. I would like to use the returned location reference in the clickthrough url.
I'm inclined to use
/d/-vF_1OPWk/sw-strategic?var-channel=$channel&var-store=$__field_bcc.channel.key.keyword
but this results in a litteral copy: /d/-vF_1OPWk/sw-strategic?orgId=1&var-channel=Instore&var-store=$__field_bcc.channel.key.keyword
Am I following your advise correctly?
Dear @rsaifulin,
@weedaj and @vmanju123 are observing the same issue when using an Elasticsearch data source, see also #57. May I humbly ask which data source you have been using?
With kind regards, Andreas.
Dear @weedaj and @krzysion,
may I humbly ask you to have a look at https://github.com/panodata/grafana-map-panel/issues/57#issuecomment-599838746? When you believe we are on the right track with that change 99f1810, we might want to try [[__field_bcc.channel.key.keyword]]
for referencing the field. This is an alternative syntax for interpolating template variables, see also [1] and [2].
With kind regards, Andreas.
[1] https://grafana.com/docs/grafana/latest/reference/templating/#interpolation [2] https://github.com/grafana/grafana/issues/525#issuecomment-163198562
I encountered the same problem: See the attached screenshots. The $___field_xxx
works fine in the tables but not in the map-ng. Running Grafana 7.2 latest and the latest map-ng plugin. The clickthrough URL is not replaced with the data in the fields.
Dear guys , I have the same problem as the others, I have a json states.json file with the structure:
[ {
"key" : "RJ",
"name" : "Rio de Janeiro",
"latitude" : -22.9129,
"longitude" : -43.2003,
"link": "http://100.100.20.11/zabbix"
},
]
is it possible to create links to circulo from json on panodata not using data base?
Hello @amotl
I would like to know if it is possible to create links to my grafana panels. I use a json file with zabbix data source. Can someone help me?
I would like to know if it is possible to create links to my grafana panels. I use a json file with zabbix data source. Can someone help me?
Dear Cristiano,
thank you for writing in. This Grafana plugin is not very well maintained these days. Maybe you will be more successful with the native Geomap plugin included in recent Grafana releases?
If this is not an option, and you absolutely need to use Panodata Map Panel, do you have an idea how we could replicate such a setup you are having on our machines? Otherwise, it will be very difficult to work on this issue.
With kind regards, Andreas.
Hello Andreas
I really need Panodata, follow the print screens. I have the latest version of everything zabbix and grafana
logger=context userId=1 orgId=1 uname=admin t=2023-03-06T23:23:24.232531007+01:00 level=error msg="Request Completed" method=POST path=/api/ds/query status=500 remote_addr=192.168.7.106 time_ms=55 duration=55.496058ms size=116 referer=" http://192.168.1.177:3000/d/qItl-sTVz/dashboard?editPanel=8&orgId=1&station_id=%24__station_id%7D" handler=/api/ds/query
Best Regards
Em seg., 6 de mar. de 2023 às 23:24, Andreas Motl @.***> escreveu:
Dear Cristiano,
thank you for writing in. This Grafana plugin is not very well maintained these days. Maybe you will be more successful with the native Geomap plugin included in recent Grafana releases?
If this is not an option, and you absolutely need to use Panodata Map Panel, do you have an idea how we could replicate such a setup you are having on our machines? Otherwise, it will be very difficult to work on this issue.
With kind regards, Andreas.
— Reply to this email directly, view it on GitHub https://github.com/panodata/panodata-map-panel/issues/12#issuecomment-1457107387, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFZCZAA55BOXESDIYQDAUDW2ZPZJANCNFSM4ILU6FWQ . You are receiving this because you commented.Message ID: @.***>
Hello @amotl
Follow Printscreens
https://file.io/mUWyMZanSRje