{
  "uid": "weather-overview",
  "title": "Weather Agent — Overview",
  "tags": [
    "mastra",
    "weather-agent"
  ],
  "schemaVersion": 39,
  "version": 1,
  "editable": true,
  "timezone": "browser",
  "refresh": "10s",
  "time": {
    "from": "now-30m",
    "to": "now"
  },
  "templating": {
    "list": []
  },
  "annotations": {
    "list": []
  },
  "panels": [
    {
      "id": 1,
      "type": "stat",
      "title": "Requests / s",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 0,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum(rate(mastra_agent_duration_seconds_count{service=\"weather-agent\"}[5m]))",
          "legendFormat": "",
          "range": false,
          "instant": true,
          "exemplar": false,
          "format": "time_series",
          "refId": "A"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "reqps",
          "color": {
            "mode": "fixed",
            "fixedColor": "text"
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "custom": {},
          "decimals": 3
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto",
        "graphMode": "area",
        "colorMode": "value",
        "orientation": "auto"
      }
    },
    {
      "id": 2,
      "type": "stat",
      "title": "Agent p95",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 4,
        "y": 0,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "histogram_quantile(0.95, sum by (le) (rate(mastra_agent_duration_seconds_bucket{service=\"weather-agent\"}[5m])))",
          "legendFormat": "",
          "range": false,
          "instant": true,
          "exemplar": false,
          "format": "time_series",
          "refId": "A"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "s",
          "color": {
            "mode": "thresholds",
            "fixedColor": "text"
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "orange",
                "value": 5
              },
              {
                "color": "red",
                "value": 10
              }
            ]
          },
          "custom": {},
          "decimals": 2
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto",
        "graphMode": "area",
        "colorMode": "value",
        "orientation": "auto"
      }
    },
    {
      "id": 3,
      "type": "stat",
      "title": "Agent error %",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 8,
        "y": 0,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "(sum(rate(mastra_agent_duration_seconds_count{service=\"weather-agent\",status=\"error\"}[5m])) / clamp_min(sum(rate(mastra_agent_duration_seconds_count{service=\"weather-agent\"}[5m])),1e-9)) or vector(0)",
          "legendFormat": "",
          "range": false,
          "instant": true,
          "exemplar": false,
          "format": "time_series",
          "refId": "A"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "percentunit",
          "color": {
            "mode": "thresholds",
            "fixedColor": "text"
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "orange",
                "value": 0.02
              },
              {
                "color": "red",
                "value": 0.05
              }
            ]
          },
          "custom": {},
          "decimals": 2
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto",
        "graphMode": "area",
        "colorMode": "value",
        "orientation": "auto"
      }
    },
    {
      "id": 4,
      "type": "stat",
      "title": "Tokens / s",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 12,
        "y": 0,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum(rate(mastra_model_tokens_total{service=\"weather-agent\",type=\"total\"}[5m]))",
          "legendFormat": "",
          "range": false,
          "instant": true,
          "exemplar": false,
          "format": "time_series",
          "refId": "A"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "short",
          "color": {
            "mode": "fixed",
            "fixedColor": "text"
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "custom": {},
          "decimals": 1
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto",
        "graphMode": "area",
        "colorMode": "value",
        "orientation": "auto"
      }
    },
    {
      "id": 5,
      "type": "stat",
      "title": "Target",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 16,
        "y": 0,
        "w": 4,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "up{job=\"weather-agent\"}",
          "legendFormat": "",
          "range": false,
          "instant": true,
          "exemplar": false,
          "format": "time_series",
          "refId": "A"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "short",
          "color": {
            "mode": "thresholds",
            "fixedColor": "text"
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "green",
                "value": 1
              }
            ]
          },
          "custom": {},
          "mappings": [
            {
              "type": "value",
              "options": {
                "0": {
                  "text": "DOWN",
                  "color": "red"
                },
                "1": {
                  "text": "UP",
                  "color": "green"
                }
              }
            }
          ]
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto",
        "graphMode": "none",
        "colorMode": "background",
        "orientation": "auto"
      }
    },
    {
      "id": 6,
      "type": "timeseries",
      "title": "Agent latency percentiles (exemplars on p95)",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 4,
        "w": 12,
        "h": 8
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "histogram_quantile(0.50, sum by (le) (rate(mastra_agent_duration_seconds_bucket{service=\"weather-agent\"}[5m])))",
          "legendFormat": "p50",
          "range": true,
          "instant": false,
          "exemplar": false,
          "format": "time_series",
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "histogram_quantile(0.90, sum by (le) (rate(mastra_agent_duration_seconds_bucket{service=\"weather-agent\"}[5m])))",
          "legendFormat": "p90",
          "range": true,
          "instant": false,
          "exemplar": false,
          "format": "time_series",
          "refId": "B"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "histogram_quantile(0.95, sum by (le) (rate(mastra_agent_duration_seconds_bucket{service=\"weather-agent\"}[5m])))",
          "legendFormat": "p95",
          "range": true,
          "instant": false,
          "exemplar": true,
          "format": "time_series",
          "refId": "C"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "histogram_quantile(0.99, sum by (le) (rate(mastra_agent_duration_seconds_bucket{service=\"weather-agent\"}[5m])))",
          "legendFormat": "p99",
          "range": true,
          "instant": false,
          "exemplar": false,
          "format": "time_series",
          "refId": "D"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "s",
          "color": {
            "mode": "palette-classic"
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "custom": {
            "drawStyle": "line",
            "fillOpacity": 10,
            "lineWidth": 2,
            "showPoints": "never",
            "stacking": {
              "mode": "none"
            },
            "spanNulls": true
          }
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "bottom",
          "calcs": [
            "lastNotNull",
            "max"
          ]
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 7,
      "type": "timeseries",
      "title": "Throughput by status",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 12,
        "y": 4,
        "w": 12,
        "h": 8
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum by (status) (rate(mastra_agent_duration_seconds_count{service=\"weather-agent\"}[5m]))",
          "legendFormat": "{{status}}",
          "range": true,
          "instant": false,
          "exemplar": false,
          "format": "time_series",
          "refId": "A"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "reqps",
          "color": {
            "mode": "palette-classic"
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "custom": {
            "drawStyle": "line",
            "fillOpacity": 30,
            "lineWidth": 2,
            "showPoints": "never",
            "stacking": {
              "mode": "normal"
            },
            "spanNulls": true
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "ok"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "green"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "error"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "red"
                }
              }
            ]
          }
        ]
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "bottom",
          "calcs": [
            "lastNotNull",
            "max"
          ]
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 8,
      "type": "timeseries",
      "title": "Tokens / s by direction",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 12,
        "w": 12,
        "h": 8
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum by (direction) (rate(mastra_model_tokens_total{service=\"weather-agent\",type=\"total\"}[5m]))",
          "legendFormat": "{{direction}}",
          "range": true,
          "instant": false,
          "exemplar": false,
          "format": "time_series",
          "refId": "A"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "short",
          "color": {
            "mode": "palette-classic"
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "custom": {
            "drawStyle": "line",
            "fillOpacity": 10,
            "lineWidth": 2,
            "showPoints": "never",
            "stacking": {
              "mode": "none"
            },
            "spanNulls": true
          }
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "bottom",
          "calcs": [
            "lastNotNull",
            "max"
          ]
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 9,
      "type": "timeseries",
      "title": "Best-effort cost (USD, cumulative)",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 12,
        "y": 12,
        "w": 12,
        "h": 8
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum(mastra_model_cost_usd_total{service=\"weather-agent\"})",
          "legendFormat": "cost $",
          "range": true,
          "instant": false,
          "exemplar": false,
          "format": "time_series",
          "refId": "A"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "currencyUSD",
          "color": {
            "mode": "palette-classic"
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "custom": {
            "drawStyle": "line",
            "fillOpacity": 10,
            "lineWidth": 2,
            "showPoints": "never",
            "stacking": {
              "mode": "none"
            },
            "spanNulls": true
          },
          "decimals": 5
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "bottom",
          "calcs": [
            "lastNotNull",
            "max"
          ]
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    }
  ]
}
