Clickthrough URLs with $__field_ variables don't work with Elasticsearch data source
amotl opened this issue · comments
@vmanju123 reported at grafana#257:
I am using 0.9.0 map panel with Grafana 6.5.2.
I am trying to pass the URL as below
https://xyz.com/d/xyz-monitor/xyz-monitor?&from=${__from}&to=${__to}&var-Filter=clientGeo|=|${__field_clientGeo}&var-Filter=applicationDescription|=|${__field_applicationDescription}
In the above URL,
clientGeo
is the geo hashpoint andapplicationDescription
is another field. Both fields coming from elastic search query.I can see
__from
and__to
built in variables picking up the time fields form the main panel butclientGeo
andapplicationDescription
are not resolving to values. BothclientGeo
andapplicationDescription
fields are in the elastic query and returning data to main panel as I can see data on map panel, but not getting resolved to values in the click through URL.Looking at he clickthrough URL information I saw that we need to prefix with
$__field_
with each data field in URL, but it does not seem to be working or I am doing something wrong. Any help is appreciated.thanks
@vmanju123 added a remark:
The same issue is being discussed within #12.
Dear @vmanju123,
thanks for writing in. Apparently, this feature is only implemented within setTableValues
, so it will probably only work when using data in table format. Bummer.
Am I correct to assume data from Elasticsearch is not using table format?
With kind regards,
Andreas.
P.S.: If only #56 would work for you. Then you could add this feature on your own behalf and send a pull request so that we could comfort @rsaifulin, @weedaj and @krzysion, who are probably observing the same issue (#12).
I can confirm now that it is indeed working for Table format, since i have time series data in es database
78882ec adds a test for checking "clickthroughUrl" interpolation when using table format.
I can confirm now that it is indeed working for Table format, since i have time series data in es database.
Does this mean you have been able to make it work by switching to "table format" while still using the same Elasticsearch data source as before?
Dear @vmanju123,
I haven't used the Elasticsearch location data source - as of "geohash: An ElasticSearch query that returns geohashes" - yet. Now, c800ca3 improves the test suite by adding tests for checking the corresponding code path through setGeohashValues()
.
On top of that, 99f1810 adds the __field_
interpolation feature, now also for the Elasticsearch data source.
Would that [also] improve your situation? As we are not using Grafana with Elasticsearch, I can't tell if this makes any sense and will be happy about any feedback from you. Please let me know when I should build a new release which includes these changes.
With kind regards,
Andreas.
cc @rsaifulin, @weedaj, @krzysion
as i mentioned i am using the _field variables in URL and its working fine for my elastic queries
Any updates on the issue?
Any updates on the issue?
Dear Rob,
I believe it would work with data coming from InfluxDB in table format as outlined within #57 (comment) already. We are using InfluxDB, so this was obvious to have at the first place.
Apart from that, I've added support for data coming from Elasticsearch the other day, see #57 (comment).
Apparently, @vmanju123 confirmed it worked for them. However, I only see now that @matschaffer replied at 99f1810#commitcomment-40707078 and that he might also be struggling. Sorry to hear that.
Maybe you can share more details from the edit screen of your dashboard?
With kind regards,
Andreas.
Hi Rob,
See attached screenshot how we implemented the setup.
Can not see it.
Cheers,
Andreas.
Andreas,
Sorry. I replied in an email with attachments. Seems that did not wok for GitHub.
Uploaded them here just before.
Regards,
rob
Thanks Rob. Is $device_urn
coming from a Grafana Variable or from the database? If it is coming from the database, you probably should use $__field_device_urn
there within the Clickthrough URL
.
Andreas,
We tried both with and without. Same results.
Any other idea how to fix it?
regards,
rob
Hi Rob,
I just reviewed the changelog [1] and found
- Interpolate datapoint field values with
__field
prefix into transformation data, now also for elasticsearch queries. (99f1810)
apparently not to be part of an official release yet. Are you running a custom build or did you just install 0.9.0? If so, that might be an easy explanation why that would not work for you, yet.
With kind regards,
Andreas.
[1] https://github.com/panodata/grafana-map-panel/blob/develop/CHANGELOG.md
Andreas,
We are running 0.9.0 as far as I know. I will check to be sure.
Sorry for my innocent, but how to run a custom build?
regards
Rob Oudendijk
OOPs. maybe not true.
We are running a script :/usr/sbin/grafana-cli --pluginUrl https://github.com/panodata/grafana-map-panel/archive/4f4765b68b2c02ca7de2b36dcc24349b5e10ef47.zip plugins install grafana-worldmap-panel-ng
not sure what version that is.
regards,
rob
Andreas,
Installed the latest development code from https://github.com/panodata/grafana-map-panel/archive/develop.zip and restarted the Grafana server. Results are still the same.
Any other suggestions?
BTW how to check what version of the plugin the browser is using?
regards,
rob
Dear Rob,
downloading the sources will definitively not work. You will have to build/compile them. If you dare to, you might find some pointers how to do that within [1].
Sorry that I am too busy right now to deliver that for you. Please let me know how that goes for you in general. On the other hand, I will try to come back to giving some love to that repository again. There are also some great contributions from @JonasProgrammer still lingering within pull requests.
With kind regards,
Andreas.
[1] https://github.com/panodata/grafana-map-panel/blob/develop/CONTRIBUTING.md
BTW how to check what version of the plugin the browser is using?
I don't know from the top of my head. Maybe that command will also display the plugin version(s)?
grafana-cli plugins ls
I did run the command
Excellent. Now we know how one would find out about that.
However, to run the most recent development build, you will have to follow the guidelines referenced at #57 (comment).
Also, you might want to uninstall the original grafana-worldmap-panel
. While I can't remember this detail exactly, it could be that they get in the way of each other (shouldn't happen, but still worth a try).
You have a link?
Downloading the sources will definitively not work. You will have to build/compile them. If you dare to, you might find some pointers how to do that within [1].
[1] https://github.com/panodata/grafana-map-panel/blob/develop/CONTRIBUTING.md
hi @amotl - thanks for the help so far. I downloaded and built 3f77d55 and it's the same behavior (looks like maybe some CSS is a little off and src/data_formatter.test.ts
throws prettier warnings). Here's what it looks like.
The clickthrough url is set to /d/DFSxrOLWk/safecast-device-details?orgId=1&from=now-2d&to=now&var-device_urn=$__field_device_urn
and if I click on a point I get http://grafana.127.0.0.1.nip.io:8000/d/DFSxrOLWk/safecast-device-details?orgId=1&from=now-2d&to=now&var-device_urn=$__field_device_urn&refresh=15m
Looks like the replacement just doesn't happen at all.
ah.... looks like I didn't have the docker set up quite right. I think that's probably 0.9.0 still
Actually who needs a proper pipeline? ;) I pushed a zip to https://github.com/matschaffer/worldmap-panel/releases/tag/0.10.0-pre1 and popped it up on http://grafana-dev.safecast.cc/d/u5-KaDEWk/air-data?orgId=1
Nice job!! . One more request. to get multiple values on the hover panel. That would be a big help for me and probably also other people.
Dear @robouden and @matschaffer,
thanks a bunch for all your involvement to check the current state of the repository and for making an interim release. Sorry for missing out to bring the required features to an official release.
Now, the official release 0.10.0 has been made, see https://github.com/panodata/grafana-map-panel/releases/tag/0.10.0.
With kind regards,
Andreas.
P.S.:
One more request. to get multiple values on the hover panel. That would be a big help for me and probably also other people.
Let's track this within another issue? Maybe #28 already reflects what you are asking for?
Thanks! Closing this now.