How to use Geomap with Opentsdb?

According to Geomap docu, it supports Opentsdb but I can’t figure out. The following is my testing step.

I first inserted a data point into opentsdb.

{
“metric”: “car_number.opentsdb”,
“timestamp”: 1672706441,
“value”: 18,
“tags”: {
“host”: “web01”,
“country”: “US”,
“lat”: 47.239788,
“lon”: -122.37866
}
}

Then I used Grafana v8.1.5 to create a Geomap panel with Opentsdb as data source.

I chose AUTO option in LOCATION. Nothing shows up in the Geomap. If I switch to table view, I can see query result in a table form. The column name is a time series identifier, i.e., metric name and tag name

Can someone show me an example of how to use Geomap with Opentsdb time series?

More info below:

If I switch AUTO option to COORS in LOCATION, there is a circle in Geomap but it is not accurate.

I expect the latitude and longitude fields dropdown boxes should have list two tags of my data points, “lat” and “lon”. But the boxes show time series identifiers.

Would be good to see what your data view is insread of Table view?
You have the same entry for both?

What is this car_number.opentsdb{country=USA} send you back?

image

Here is the DATA tag in Query Inspector.

thanks

So it seems you have long lat data hence no map

Sorry I don’t understand. By “long lat data” do you refer to “18” in DATA view? “18” is not the value of tag=“lat” of the data point. It is the value of the metric, “car_number.opentsdb”.

FYI. The original data point is:

{
“metric”: “car_number.opentsdb”,
“timestamp”: 1672706441,
“value”: 18,
“tags”: {
“host”: “web01”,
“country”: “US”,
“lat”: 47.239788,
“lon”: -122.37866
}
}

Longitude latitude

lat”: 47.239788,
“lon”: -122.37866

I know these two are lat and lon data. My question is how to apply them in Geomap.

Could you please show me a real example how to create Geomap panel with opentsdb time series query? A few snapshots (e.g., query format, LOCATION option etc) would be great.

Right now your query returns 2 values, a timestamp and a value of 18

Where is the rest of the data? If lon lat are not coming back the rest of what you are asking is irrelevant regardless of data source opentsdb or otherwise

Right. That’s exactly the point. But please note that the query is a standard opentsdb query in Grafana. If Geomap claims to support opentsdb, then how does it work?

FYI. Here is the snapshot of the query result returned by Opentsdb. You can see the result does contain country, latitude, longitude information already, although they don’t appear in data view. But this is what Grafana’s support of opentsdb looks like.

I tried to install opentsdb (very difficult)

So basically you need to provide that lon, lat data to the geomap plugin Data Layer section

image

Not sure how you can get that data from the tags data point?

Ya, opentsdb is very difficult to install since it depends on HBase. I would rather suggest you to use docker. Just run this cmd:

docker run -d --name opentsdb -h opentsdb -p 4242:4242 petergrace/opentsdb-docker

I remember the predecessor of Geomap, i.e., Worldmap, did support Opentsdb. But I can’t find a concrete example anymore.

BTW, are you the co-owner of Geomap? Maybe you can track back what changes have been made since worldmap.

1 Like

no I am not co-owner. I think geomap is data source agnostic so as long as the data source returns what it needs lon,lat it should work let me try podman of this opentsdb

Another question: Since my data have country info, I tried to choose LOOKUP option in LOCATION. But the dropdown menu is empty. What is supposed to be in the menu? What should the data view look like?

image

same thing as lon,lat. grafana is not seeing the tabs data point.

How do I upload data to this db?
Please provide some ingest script or some other means to load your data. without data, it would just back and forth.

I need your data in my opentsdb :wink:

[Yi-MBP EVInventory (main)]$ curl -v -XPOST 'http://localhost:4242/api/put' -d@/tmp/geo.txt
[Yi-MBP EVInventory (main)]$ cat /tmp/geo.txt
{
    "metric": "car_number.opentsdb",
    "timestamp": 1672706441,
    "value": 18,
    "tags": {
       "host": "web01",
       "country": "US",
       "lat": 47.239788,
       "lon": -122.37866
    }
}
1 Like

Looks like it did ingest it but not sure how to fetch data

image

Maybe the better option might be using the rest api?

http://localhost:4242/api/query?start=1h-ago&m=sum:rate:proc.stat.cpu{host=foo,type=idle}

Please provide a sample rest api for fetching data?

For the data point written above, you can query it with this curl:

[Yi-MBP ticktock (refactor.test)]$ curl 'http://localhost:4242/api/query?start=1672706441&m=sum:1h-avg:car_number.opentsdb\{country=US\}'
[{"metric":"car_number.opentsdb","tags":{"host":"web01","country":"US","lon":"-122.37866","lat":"47.239788"},"aggregateTags":[],"dps":{}}]

It means:

start=1672706441: query from 1672706441
metric: car_number.opentsdb
with tag: country=US
1h-avg: 1 data point per 1 hour, taking average value
sum: aggregate all matched time series results into one.

Tacoma/Aroma not far from where I am

image

1 Like