-
Notifications
You must be signed in to change notification settings - Fork 199
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
[Question] worldmap general question #47
Comments
Hi, Yes, this is a good place to ask questions! I think what you want to do is possible. Graphite is definitely supported. There is nothing inbuilt for cities but you could build it yourself very easily if you know which cities you want. This file might be a good starting point: https://github.com/grafana/worldmap-panel/blob/master/src/data/probes.json You'll have to look up the latitude and longitude for each city. At the moment, there is no way to upload a custom location file (it's on the backlog). What we do in the WorldPing app is to use the JSON endpoint option to return a custom json file. In our case, the list of cities is dynamic. You would use thresholds to change the colors of the circles. For example, if there are more than 10 errors then the circle should be red. I will try and structure the documentation a bit better so that all this is a bit more obvious. I just released a new version and updated the readme with some more screenshots. |
Hi, thank you for the prompt response. |
Worldmap interpret DE as Delaware and cannot found CZ. I guess it read states.json file only. But when I tried to add CZ and change DE coordinates in states.json files nothing happened. The file is located in two places src/data and dist/data. I tried to change in both places and restarted grafana-server. In both cases nothing changed. Is there any other location of states.json? How to point out which configuration for country codes should be used ? |
The states.json file is saved in the dashboard json when you save the dashboard for the first time. So you will either have to edit the dashboard json manually or just recreate the dashboard (delete it and create a new one). The states.json from the dist/data directory is the one that is used. The probes.json is just sample data that I used for testing our worldPing app. However, if you change one of the included location json files then be aware that they will be overwritten next time you update the plugin. There are a few options for which location data to use: My recommendation is to copy one of the location json files (countries, states or probes), modify it and then serve it using a json endpoint. The only information shown on the popup is the location name and the value of its metric. |
Hey @daniellee , I'm trying to display some custom location (more cities than the stock states/countries) and tried your above suggestion by serving the custom created JSON and using the JSON endpoint location data source. However I'm unable to see any requests being made from the grafana dashboard to my web service serving the location data payload. What else can I try? I've basically modified this file to make it serve the location (with correct lat/lon) that I have. |
@simar7 if you check the network tab in Chrome, can you see if it is calling your endpoint? You are probably getting a Cross Origin (CORS) error and in that case you will have to use the jsonp option. Can you show a screenshot of your worldmap options tab? |
Hey @daniellee the following are my options: But I think the real problem here was the following error (found them through the chrome network inspector logs):
Is there any documentation on how to use the JSONP endpoint? Thanks again for the help! |
Yes, as I thought. CORS problems but I am wondering why localhost:3000? What will the url be in production, will you have cross origin problems there? Or are you just testing? If you're just testing and are getting CORS errors it can be because everything is localhost with different ports which counts as different domains. Then you can use the Allow-Control-Allow-Origin chrome extension to temporarily turn off cross origin checks in Chrome. Just remember to turn it off before visiting other sites :-) For a jsonp endpoint you need to wrap the json document in a callback (you can call it whatever you want) and then put the name of the callback in the Jsonp Callback field in the Worldmap settings. myCallbackThatCanBeCalledAnything(
[
{
"key": "AK",
"latitude": 61.3850,
"longitude": -152.2683,
"name": "Alaska"
}
]); |
Hi, I have read all questions and answers but still cannot point out how I have the circle on a specific city which is also not in probes. Could you please clarify me |
I have a similar issue as @muskahya . I've read everything I can about the worldmap plugin but am having problem with my own custom json endpoint. I have tagged the data in influx with an eui. The tag is "dev_eui". I created a json file as follows: [ I have confirmed that the file is loading in the browser and that there is no CORS problem. I have tried substituting my tag name for "key". That is, renamed "key" as "dev_eui" in the json file. That does not work either. How does the worldmap plugin do the match? What exactly is it matching? |
For anyone else that finds this thread and wondering about the relationship between the metric configuration fields and the database fields I can clarify some of the issues we encountered. We inspected the code and determined that for an influx configuration, the "ALIAS BY" field is mandatory. The contents of this configuration option is used to select the tag to match for the json / jsonp endpoint configuration. This requirement is mentioned in the documentation:
It is a little confusing which alias they are referring to because of the reference to "country code" and "field name". Specifically, for the influx configuration, the "ALIAS BY" metric configuration should be set to $tag_<your influx tag to match to>, not the field name as indicated in the documentation. This tag is then matched against the value of the "key" field in the json file. |
Thank you @sslupsky! This was exactly the info I was looking for and has been trying to figure out for a while :) |
One can create the JSON file in this format:
And place it in a separate folder under 'public' folder of Grafana (public/myfiles/mylocations.json). and query looks like this: |
I guess I will be also unable to visualise my data using worldmap if my database contains a number of time series events that has UK post codes with the associated latitude and Longitude co-ordinates? |
Dear @ukshady, taking the JSON snippet as outlined above by @krishnact as a reference, you would just have to create an appropriate JSON file which uses the UK post code as a With kind regards, |
Hello, I'm not sure if this is a right place to post a question. If it is not right place, please suggest. I'm trying to show statistics on grafana worldmap panel in the following way. I have a list of world cities (Berlin, Prague, Johannesburg, ... ) and for each city a circle should be shown on the corresponding place on the map. The color of circle should indicate if there is a problem or not. Besides that, I want additional information to be displayed when hovering with mouse.
The first question is if it is possible to achieve the mentioned with worldmap-panel plugin :)
2. As data source I use graphite, is it possible to use it for this case? Or I should use other datasources like InfluxDB, ElasticSearch ? in the documentation it is written that in case of graphite, country codes can be used, I tried and it worked, However I need not country codes but cities.
3. Can you point out some documentation or give an advise how to start? It is not very clear from the included documentation.
Thanks in advance,
Zaven.
The text was updated successfully, but these errors were encountered: