How to Build a Grafana Geomap Tracking Web Traffic and Threat Scores by Country

A developer tutorial on DEV Community outlines how to build a Grafana Geomap panel that visualises web traffic by country and colours it by threat score, with the full pipeline taking roughly an hour to set up. The guide warns that the widely used Worldmap plugin is now broken, as it relies on AngularJS support that was completely removed in Grafana 12, making the built-in Geomap panel the only viable option. Log enrichment — adding country codes and risk scores to each request — is identified as the core challenge, achievable either via local MaxMind MMDB files read by an Nginx module or by batch-querying an IP data API with caching. The article also flags that Promtail has been removed from Loki as of version 3.7.3 and must be replaced with Alloy, which offers a single-command migration tool. Several practical gotchas are highlighted, including that latitude and longitude values arrive as strings and that the X-Forwarded-For header can be spoofed by malicious clients.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in