<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: mo fa</title>
    <description>The latest articles on DEV Community by mo fa (@mo_fa_c582c4aa7819bc09272).</description>
    <link>https://dev.to/mo_fa_c582c4aa7819bc09272</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4031012%2Fd46b259f-551d-4c8f-83d4-68b80ed72d78.png</url>
      <title>DEV Community: mo fa</title>
      <link>https://dev.to/mo_fa_c582c4aa7819bc09272</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mo_fa_c582c4aa7819bc09272"/>
    <language>en</language>
    <item>
      <title>Turning NetBox change events into Grafana annotations</title>
      <dc:creator>mo fa</dc:creator>
      <pubDate>Wed, 15 Jul 2026 20:20:28 +0000</pubDate>
      <link>https://dev.to/mo_fa_c582c4aa7819bc09272/turning-netbox-change-events-into-grafana-annotations-2cpg</link>
      <guid>https://dev.to/mo_fa_c582c4aa7819bc09272/turning-netbox-change-events-into-grafana-annotations-2cpg</guid>
      <description>&lt;p&gt;NetBox is the source of truth for what's &lt;em&gt;supposed&lt;/em&gt; to be true about your network — but Grafana is where people actually watch it behave, and today those two are disconnected. An engineer re-roles a device or flips a status, and nothing marks that moment anywhere near the graphs that matter. Debugging "did anything change around when this started" means manually opening NetBox's changelog and eyeballing timestamps against a graph.&lt;/p&gt;

&lt;p&gt;I built a NetBox plugin to close that gap automatically.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9btza3grf1pfh11k7awe.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9btza3grf1pfh11k7awe.gif" alt="Demo: editing a device in NetBox produces an annotation on the matching Grafana graph" width="480" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;You edit an object in NetBox — a device role change, a status flip, whatever your Event Rule is scoped to.&lt;/li&gt;
&lt;li&gt;NetBox's own Event Rule/Webhook system (no custom signal handling) fires a POST at the plugin.&lt;/li&gt;
&lt;li&gt;The plugin resolves which Grafana dashboard/panel that object maps to — either a Grafana tag search (&lt;code&gt;netbox:{object_type}:{object_name}&lt;/code&gt;) or a NetBox custom field override — and posts an annotation via Grafana's Annotations API.&lt;/li&gt;
&lt;li&gt;The marker's already on the graph before anyone thinks to look for it.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Where this actually helps
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Correlating changes with metric shifts, either direction&lt;/strong&gt; — a change just landed, did anything break? Or something broke, what changed recently? Same value, whichever direction you're coming from.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Faster incident triage&lt;/strong&gt; — when several changes land close together, seeing them against real metrics narrows down which one's the likely cause vs. coincidence.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;On-call gut check&lt;/strong&gt; — a page fires, you glance at the graph, see a marker, and immediately know "yes, that's the change we just made."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bridges NetOps and SRE/NOC tooling&lt;/strong&gt; — neither team has to learn the other's tool to get the correlation.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;git+https://github.com/mfarook2/netbox-grafana-annotations-plugin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;PLUGINS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;netbox_grafana_annotations_plugin&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;PLUGINS_CONFIG&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;netbox_grafana_annotations_plugin&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;grafana_url&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://grafana.example.com&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;grafana_token&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;&amp;lt;Grafana API token, Bearer auth&amp;gt;&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;webhook_secret&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;&amp;lt;random string, must match the NetBox Webhook&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s Secret&amp;gt;&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Full setup walkthrough (Grafana token, webhook, event rule, dashboard tagging) is in the &lt;a href="https://github.com/mfarook2/netbox-grafana-annotations-plugin" rel="noopener noreferrer"&gt;README&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  One limitation, stated plainly
&lt;/h2&gt;

&lt;p&gt;A marker means "this was recorded in NetBox at this time," not "the device's behavior changed at this time." NetBox doesn't push config to devices itself. For teams that deploy close-in-time to NetBox edits, that gap is usually minutes — but it's not a claim of exact causation, and I didn't want to market it as one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Repo: &lt;a href="https://github.com/mfarook2/netbox-grafana-annotations-plugin" rel="noopener noreferrer"&gt;https://github.com/mfarook2/netbox-grafana-annotations-plugin&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Docs: &lt;a href="https://mfarook2.github.io/netbox-grafana-annotations-plugin/" rel="noopener noreferrer"&gt;https://mfarook2.github.io/netbox-grafana-annotations-plugin/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Apache-2.0, tested end-to-end against NetBox 4.6.4 + Grafana 13.0.2&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feedback, issues, and PRs welcome.&lt;/p&gt;

</description>
      <category>netbox</category>
      <category>grafana</category>
      <category>networking</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
