Skip to content
DevOps AI ToolKit
Newsletter
All prompts
AI for Grafana Difficulty: Intermediate ClaudeChatGPT

Grafana Geomap Panel Design Prompt

Design a Grafana Geomap panel to plot geospatial metrics with markers, heatmaps, and layers driven by lat/lon or geohash fields.

Target user
Dashboard authors visualizing location-based metrics
Difficulty
Intermediate
Tools
Claude, ChatGPT

The prompt

You are a senior observability engineer who builds Grafana Geomap panels to plot geospatial data — POP latency, CDN edge health, fleet locations — with layers over a base map.

I will provide:
- The location data (lat/lon, geohash, or a lookup key)
- The metric that colors/sizes each point
- Whether you want markers, heatmap, or route layers

Your job:

1. **Location mode**: set the data layer's location mode — `coords` (lat/lon fields), `geohash`, `lookup` (against a gazetteer), or `auto`; map the correct fields.
2. **Base layer**: choose a base map (`osm-standard`, `carto`, `xyz` tiles, or ArcGIS) and set default `view` (`lat`, `lon`, `zoom`) or `fit` to data.
3. **Data layers**: add a `markers` layer sized/colored by a value field, a `heatmap` layer for density, or a `route`/`geojson` layer; layers stack with opacity.
4. **Style by data**: bind marker `size` and `color` to fields with thresholds so a slow POP shows large and red.
5. **Tooltips + links**: enable tooltips showing the metric and add data links so a marker click opens the region dashboard.
6. **Query shape**: return one row per location with `lat`, `lon`, and the metric; use transformations to reshape time series into a per-location table first.
7. **Performance**: cap point count and pre-aggregate; thousands of markers hurt render time.
8. **Projection/tiles**: for air-gapped setups, self-host tiles (`xyz` server) since public OSM tiles may be blocked.

Mark DESTRUCTIVE: none — display-only. Flag if custom tile/XYZ URLs send internal location data to a third-party tile provider.

---

Location data: [DESCRIBE]
Metric to color/size: [DESCRIBE]
Layer style: [DESCRIBE]

Why this prompt works

Geomap looks simple but fails in specific ways: 0,0 points from the wrong location mode, blank maps in air-gapped setups, and time-series data that was never reshaped to per-location rows. This prompt pins the location mode, base layer, data reshaping, and threshold-driven styling so hotspots actually stand out.

How to use it

  1. State the location field format (coords vs geohash vs lookup).
  2. Confirm the metric that sizes/colors markers.
  3. Reshape queries to one row per location before styling.
  4. Decide tile hosting — public vs self-hosted for privacy/air-gap.

Useful commands

# Inspect a geomap panel's layers and view
curl -s -H "Authorization: Bearer $TOKEN" \
  http://localhost:3000/api/dashboards/uid/edge-map \
  | jq '.dashboard.panels[] | select(.type=="geomap") | {layers:.options.layers, view:.options.view}'

Example config

Geomap with a markers layer colored/sized by latency, self-hosted tiles:

{
  "type": "geomap",
  "title": "Edge POP Latency",
  "options": {
    "basemap": {
      "type": "xyz",
      "config": { "url": "https://tiles.internal.example.com/{z}/{x}/{y}.png" }
    },
    "view": { "id": "coords", "lat": 20, "lon": 0, "zoom": 2 },
    "layers": [
      {
        "type": "markers",
        "location": { "mode": "coords", "latitude": "lat", "longitude": "lon" },
        "config": {
          "size": { "field": "p99_ms", "min": 4, "max": 20 },
          "color": { "field": "p99_ms" },
          "showLegend": true
        },
        "tooltip": true
      }
    ]
  },
  "fieldConfig": {
    "defaults": {
      "unit": "ms",
      "color": { "mode": "thresholds" },
      "thresholds": { "mode": "absolute", "steps": [
        { "color": "green", "value": null },
        { "color": "orange", "value": 100 },
        { "color": "red", "value": 250 } ] },
      "links": [
        { "title": "Region detail", "url": "/d/pop/pop?var-pop=${__data.fields.pop}&${__url_time_range}" }
      ]
    }
  }
}

Common findings this catches

  • Points at 0,0 → wrong location mode or missing fields.
  • Blank map → air-gapped Grafana can’t reach public tiles.
  • Nothing renders → time series not reshaped to per-location rows.
  • Wrong hemisphere → lat/lon swapped.
  • No hotspots → color/size not bound to thresholds.
  • Slow panel → too many unaggregated markers.

When to escalate

  • Data egress to third-party tile providers — security/privacy review.
  • Self-hosting a tile server for air-gapped Grafana — platform team.
  • Very large geospatial datasets — pre-aggregation/backend design.

Related prompts

Newsletter

Free: the DevOps AI Incident-Triage Cheat Sheet

Subscribe and we’ll send you the one-page cheat sheet — plus weekly AI prompts, automation ideas, and tool reviews for infrastructure engineers. One email a week. No spam, unsubscribe anytime.

  • AI Incident-Triage Cheat Sheet (PDF)
  • Access to 2,104 DevOps AI prompts
  • One practical workflow email per week