Skip to content
🎉 Launch sale:50% off everything over $22 — automatically applied at checkout· ends Aug 2Shop the sale →
DevOps AI ToolKit
Newsletter
All prompts
AI for Prometheus & Monitoring Difficulty: Intermediate ClaudeChatGPT

Grafana Transformations Design Prompt

Use Grafana transformations — join queries, calculate fields, filter, rename, group by, organize columns; combine data without changing queries.

Target user
Engineers building complex Grafana dashboards
Difficulty
Intermediate
Tools
Claude, ChatGPT

The prompt

You are a senior SRE who has used Grafana transformations to build dashboards combining data from multiple queries — joins, calculations, filters.

I will provide:
- The data flow goal
- Current transformations
- Symptom (transformation not applying, wrong result, slow)

Your job:

1. **Common transformations**:
   - **Reduce** — collapse rows to single value
   - **Merge** — combine multiple query results
   - **Outer Join** — join on field
   - **Add field from calculation** — math between fields
   - **Filter by name** — keep/exclude columns
   - **Filter by value** — row-level filter
   - **Organize fields** — rename, reorder
   - **Group by** — aggregate rows
   - **Sort by** — order results
   - **Convert field type** — string ↔ number
2. **For joining multiple queries**:
   - Each query as "A", "B", "C"
   - Outer join by common field
   - Useful for comparing related metrics
3. **For calculated fields**:
   - Math: A / B * 100
   - Useful for ratios, percentages
   - Reduce data before transformation
4. **For renaming**:
   - Series → friendlier names
   - For consistent legend appearance
5. **For filtering rows**:
   - Numerical or string match
   - Keep top-N
6. **For grouping**:
   - Aggregate by label
   - Reduce row count
7. **For pipeline thinking**:
   - Order matters
   - Reduce data early
   - Computational vs visual transforms
8. **For "transformation not working"**:
   - Check input fields exist
   - Step debugging
   - "Show data" reveals what each step sees

Mark DESTRUCTIVE: heavy transformations on huge data sets, transformations changing label semantics for alerts, joining on missing fields.

---

Data flow goal: [DESCRIBE]
Current transformations: [DESCRIBE]
Symptom: [DESCRIBE]

Run this prompt with AI

Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.

Why this prompt works

Transformations are powerful but underexplained. This prompt walks them.

How to use it

  1. Plan order.
  2. Reduce early.
  3. Test with “Show data”.
  4. Document intent.

Patterns

Join two queries (e.g., requests + errors → error rate)

Query A: sum by (job)(rate(http_requests_total[5m]))
Query B: sum by (job)(rate(http_requests_total{code=~"5.."}[5m]))

Transformations:
1. Outer join on field: "job"
2. Add field from calculation: "Error %" = (B / A) * 100
3. Organize fields: Hide A, B; show "Error %"

Top errors across multiple services

Query A: sum by (service)(rate(errors_total[5m]))

Transformations:
1. Reduce → "Reducer: Last"
2. Filter rows by value: Value > 0.01
3. Sort by Value descending
4. Limit: 10

Calculate field example

Add field from calculation:
- Operation: Binary operation
- Left: Total RPS
- Operator: /
- Right: Worker count
- Alias: "RPS per worker"

Filter / rename example

transformations:
- id: organize
  options:
    excludeByName:
      __name__: true
      job: true
    renameByName:
      Value: "Latency (ms)"
      instance: "Host"
    indexByName:
      Host: 0
      "Latency (ms)": 1

Common findings this catches

  • Transformation result empty → join field doesn’t match.
  • Calculation showing NaN → input field is string.
  • Order of transformations → reduce before join changes result.
  • Hidden fields still computed → reduce cost via filter.
  • Renamed field breaks threshold → update threshold mapping.
  • “Show data” reveals input vs expected → diagnostic.
  • Slow dashboard → heavy transformation; consider query-level.

When to escalate

  • Complex multi-DS dashboard — design review.
  • Transformations affecting alert behavior — coordinate.
  • Performance issues — query optimization first.

Related prompts

More Prometheus & Monitoring prompts & error guides

Browse every Prometheus & Monitoring prompt and troubleshooting guide in one place.

Free download · 368-page PDF

Reading prompts? Get all 500 in one free PDF

500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.

  • 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
  • Instant PDF download — yours free, forever
  • Plus one practical AI-workflow email a week (no spam)

Single opt-in · unsubscribe anytime · no spam.