-
Notifications
You must be signed in to change notification settings - Fork 31
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
Refresh overlay image when the dashboard refreshes manually or automatically #97
Comments
Some additional... &the src/partials/editor.html behind the Overlay URL (from row 562)
&to the src/worldmap_ctrl.ts
The HTML tested - OK, but I cannot build the ts yet (im fighting with dockered grafana srv + yarn + js) sry. @jreyeser: am i on a good way? Shall i ask you to help move forward? |
Dear Tibor, thank you very much for writing in and for proposing this feature. Attaching to @jreyesr's comment at #84 (comment):
We will be very happy to accept any kinds of improvements to this canonical fork of the original Grafana Worldmap Panel which supports the community of Grafana map lovers. With kind regards, |
@falconhome Yeah, those changes are pretty much everything that is required, apart from adding the new option to the README.
Would you like to implement the feature yourself or are you OK with me doing it? I ask because "am i on a good way?" sounds like you want to do it yourself. I can also do it (in fact, I think I have a working implementation). |
@jreyesr Ups. my English grammar need some refreshment.. :) i wanted to say i put this things together for you (if you can use it). So if you have a time to put this changes into your code and make a test build for me i will be very thankful. |
Yes, I can use the code above. I have submitted a PR on #99. Take a look below for a test: the image is swapped every five seconds, and clicking the Refresh button updates it. It works the same with the automatic refresh, since the two refresh methods share functionality. |
@jreyesr: This is the function what i requested! Thank you so much! |
Thank you all of your work! |
@falconhome You may wish to wait for a bit before closing this issue. The functionality is not included yet, since #99 is not merged. After the PR is merged, this issue will be closed automatically, since I included the magic words "closes #97" in the PR description. |
@jreyesr: Thank you! I reopen it (sorry for this) |
Dear Tibor, I will have to look into the linting errors, thanks for the heads up! I will also try to issue a new release soon. Thanks a stack for implementing this feature so quickly, @jreyesr! With kind regards, |
@amotl You're welcome! |
@jreyesr: Hi! Do you have any idea why i got this linting error? (i tired to compile other grafana plugin source and that finished correctly) or if you compiled it could you send me a zip or a link where i can download the builded version? My email address in my profile. |
@falconhome I have opened an issue to track the linting error on #101 |
@jreyesr: thanks for the changes, the build now can finish with no errors! Halleluja! :) |
@falconhome Yeah, I suspect it is a caching issue, as it also happened to me. Here's a quick check:
Here's a capture of the Network tab, when using a server that sets caching headers (I used Python3's Notice that, when reloading, the only new requests are Now, on each reload, there is a request to Sadly, that issue is outside the power of Grafana and grafana-map-panel, I think. That must be fixed in the server, by setting the proper cache headers: either disabling caching completely, or somehow setting the expiration date to be the time at which you know that a new image will be available (for example, if the images are generated at 12:00 every night, set the Expires header to next midnight, which will signal to the browser that the current image will go stale at midnight). |
Hi @jreyesr! I configured my web server cache control. But, if i check the same image over grafana map panel, it looks the cache-control setting does not exist in the "Request header". Shomewhere lost in space... :( Now my hands up in the air... I do not think this is outside of the grafana scope, but now i cannot know which way will be better... |
Dear Tibor, thank you for reporting your observations. I am slightly confused: Wouldn't you have to configure your webserver's response headers accordingly as outlined by @jreyesr? Currently, I don't see anything like that happening when looking at both screenshots you shared with us. With kind regards, |
@falconhome As @amotl said, I am also quite sure that the response would need to have the cache headers. In your first screenshot, the Cache-Control header is set on the request, not on the response. You seem to be using Apache, so something like The headers should appear under the "Response Headers" list both when you access the image directly (by writing its URL on the address bar) and when inspecting the requests fired off by Grafana. This is my Developer Tools when accessing the image directly: |
Dear Andreas! I needs to be more detailed, sorry! Appache restart many time done. And so the very interesting thing: BUT, the interesting is, if i check inside the Grafana map-panel the overlay image Request header has changed, and the Cache-Control: max-age=0 disappear. So here i am, and i do not understand, sorry. Thanks |
**Andreas, @jreyesr ** |
So, if somebody use pytohon3 http.server for hosting the "overlay image" please follow @jreyesr configuration description! For Apache web servers please follow the next steps, for the proper working of the automatic overlay refresh: Step1: Check your httpd.conf file!
(!) both required Step2: Add the following code to your httpd.conf file, or to the .htaccess based on your http management model Step3: Restart your webserver (systemctl restart httpd) Evaluation of the configuration changes For Chrome users:
If all changes in your webserver works, you have to see the followings under the Response Headers
If all done, the image will be refreshing properly. :) |
Dear Support Team!
Thanks for supporting the very useful feature #84 contributed by @jreyesr! My request is a small new feature, based on my conversation with him.
Current implementation
The original code load the overlay image one time, when the dashboard load, and later on only the data points are refreshed.
Feature request
My request is to implement an "overlay configuration setting" where the dasboard developers can decide the overlay image is a static image, or periodically updated and has to be reload when the dasboard refreshed manually or automatically. Functionally, if this feature enabled on the dasboard, the system reload the image defined in the overlay url.
Background
In my case the background image preparation happen in a different application because of the complex math algorithm wich is not supported by Grafana. This is absolutelly understandable, because Grafana primary is a data visualization and exploration tool.
In the end of the line my app periodically rendering the overlay image and put it to the host on a same name, wich reachable over the overlay url. Now, if i want to load the most recent version for the image i have to reload the whole page or open a new tab which is extra load on a grafana server, and uncomfortable if i run the dasboard in kiosk mode.
And finally the reason why I proposed the config settings, because in many cases the users use static images and refreshing only the datapoints. In this case the periodically reload of the image is not required and i do not want to waste capacity for the renderer.
Thank you for your reply.
Br, Tibor.
The text was updated successfully, but these errors were encountered: