Opentsdb and worldmap panel

Hi,

I have setup opentsdb as data source for grafana and it is working fine. I recently downloaded
worldmap-panel plugin and ran into issue rendering my opentsdb data on the map.

In opentsdb, I added a tags that says “state”:“CA” and in the worldmap panel I added an opentsdb panel and query with key: state, tag: CA. In worldmap data options, I selected “states”.
But nothing shows up on the map. Am I missing something?

Thanks

-James

you need to use an ALIAS format so the series names are only your state tag. in the Alias field in your query specify $tag_state

Thanks Torkel, That worked !

Now for Json endpoint config, if I have an endpoint that outputs something like below:
{
“key”: “south-carolina”,
“latitude”: 33.0723991394043,
“longitude”: -80.03890228271484
},
{
“key”: “tokyo”,
“latitude”: 35.68450164794922,
“longitude”: 139.7559051513672
},
{
“key”: “san-francisco”,
“latitude”: 37.774898529052734,
“longitude”: -122.41940307617188
}

Can I just simply in my query alias field, put “$tag_key”? I did that but it doesn’t seem to render anything.

Cheers

-James

Worldmap will automatically map whatever the ALIAS returns to the key field. You do not need to use $tag_key unless that is what the field is called in your data. What needs to match are the values. Does your query return “south-carolina” or “san-francisco”?

Hi Daniel,

No luck, see the screenshots what I typed in. Any suggestions? Thanks

-James


You are probably getting a Cross Origin (CORS) error (here is an earlier answer ). Can you check the console in Chrome Dev Tools to see if you are getting a No ‘Access-Control-Allow-Origin’ header error.

If that is not the problem then check the result of the query on the Chrome Dev Tools Network tab (here’s a HOWTO). The target field for each series should contain a value that matches the key field in your location data:

Hi Daniel,

Thanks for the feedback. I do not see any “Access-Control-Allow-Origin” error in my Chrome Dev console.

I am a bit unclear on you comment: " The target field for each series should contain a value that matches the key field in your location data"

Here is the screen shot of my Network tab, I feel that my output isn’t similar to your output, you have array in the json but I don’t. However, I got my json from the worldmap github example.

And the data source (opentsdb) of mine looks like this:
{“timestamp”: 1495826187434, “metric”: “Dist”, “value”: “0”, “tags”: {“orientation”: “upright”, “state”: “CA”, “key”: “san-francisco”, “type”: “rz”, “id”: “5446428a”, “recordType”: “Status”}

Do they look alright? Thanks

-James