Using the Worldmap Panel with Prometheus

Using the Worldmap Panel with Prometheus

Brian Brazil April 2, 2018git

The Worldmap Panel for Grafana allows displaying of metrics on a map.github

 

Grafana has many plugins, the one I’m going to look at today is the Worldmap Panel. First off install it in your Grafana if you don’t have it already:express

grafana-cli plugins install grafana-worldmap-panel

and then restart Grafana to pick it up.ide

Let’s say you had a metric that looked like:this

a_metric{country="GB"} 4
a_metric{country="IE"} 10
a_metric{country="DE"} 15
a_metric{country="FR"} 7

If you add a Worldmap panel in you dashboard you can then use this by setting the query to a_metric, setting the Legend Format to {{country}} so that the plugin will look at the country label, and also check the Instant checkbox. This will look like:spa

In addition to ISO 3166 two-letter codes, you can also change the Location Data option on the Worldmap tab to support ISO 3166 three-letter codes and US states. It’s also possible to provide a custom set of location labels via a HTTP endpoint serving JSON.rest

You can of course use any PromQL expression here, so you could aggregate up usage by country for example.code

相關文章
相關標籤/搜索