<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Writing on Greg Wilson</title><link>https://imawilson.com/posts/</link><description>Recent content in Writing on Greg Wilson</description><generator>Hugo</generator><language>en-US</language><copyright>&amp;copy; 2026 Greg Wilson</copyright><lastBuildDate>Fri, 10 Jul 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://imawilson.com/posts/index.xml" rel="self" type="application/rss+xml"/><item><title>A Grafana dashboard for your Mastra agent metrics</title><link>https://imawilson.com/posts/mastra-agent-grafana-dashboard/</link><pubDate>Fri, 10 Jul 2026 00:00:00 +0000</pubDate><guid>https://imawilson.com/posts/mastra-agent-grafana-dashboard/</guid><description>&lt;p&gt;A single Grafana dashboard is enough to watch a Mastra agent during an incident: five golden-signal numbers, a p95 latency, and the throughput and spend underneath. Because the exporter emits Prometheus histogram buckets, the p95 is a true windowed percentile, and every spike is tagged with its &lt;code&gt;trace_id&lt;/code&gt; as an exemplar. This post builds that board, panel by panel, and ships the &lt;a href="https://imawilson.com/posts/mastra-agent-grafana-dashboard/overview-dashboard.json" download&gt;provisioned JSON&lt;/a&gt; so you can drop it into your own Grafana.&lt;/p&gt;</description></item><item><title>How to export Mastra agent metrics to Prometheus (no database required)</title><link>https://imawilson.com/posts/export-mastra-agent-metrics-to-prometheus/</link><pubDate>Fri, 03 Jul 2026 00:00:00 +0000</pubDate><guid>https://imawilson.com/posts/export-mastra-agent-metrics-to-prometheus/</guid><description>&lt;p&gt;Mastra derives per-agent metrics (latency, tokens, cost) from its traces, and shows them well in Studio. When you want those metrics in Prometheus so your production monitoring and alerting can use them, you need a scrape endpoint that Mastra doesn&amp;rsquo;t ship. You can add one without running an analytics database. Mastra puts every derived metric onto an observability event bus, so a small exporter can listen, feed &lt;code&gt;prom-client&lt;/code&gt;, and serve &lt;code&gt;/metrics&lt;/code&gt; from memory, with no analytics database (DuckDB or ClickHouse) to run. Here is how I wired it up, and the &lt;a href="https://github.com/charlesgwilson/mastra-prometheus-exporter" target="_blank" rel="nofollow noopener noreferrer"&gt;open-source exporter&lt;/a&gt;
 that does it.&lt;/p&gt;</description></item></channel></rss>