<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Fediverse on dotnet.work</title>
        <link>https://dotnet.work/tags/fediverse/</link>
        <description>Recent content in Fediverse on dotnet.work</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en-US</language>
        <managingEditor>dotnet@oles.cloud (Ole Albers)</managingEditor>
        <webMaster>dotnet@oles.cloud (Ole Albers)</webMaster>
        <copyright>Ole Albers</copyright>
        <lastBuildDate>Tue, 14 Oct 2025 12:28:00 +0200</lastBuildDate><atom:link href="https://dotnet.work/tags/fediverse/index.xml" rel="self" type="application/rss+xml" /><item>
            <title>Grafana - Notifications for Mastodon</title>
            <link>https://dotnet.work/blog/grafana-notifications-for-mastodon/</link>
            <pubDate>Tue, 14 Oct 2025 12:28:00 +0200</pubDate><author>dotnet@oles.cloud (Ole Albers)</author>
            <guid>https://dotnet.work/blog/grafana-notifications-for-mastodon/</guid>
            <description>&lt;img src=&#34;https://dotnet.work/blog/grafana-notifications-for-mastodon/Screenshot-from-2025-10-14-12-21-45_hu_6d1258580808eff7.png&#34; alt=&#34;Featured image of post Grafana - Notifications for Mastodon&#34; /&gt;&lt;p&gt;Grafana is a very useful tool for monitoring your own programs, discovering silly bugs, or simply looking at beautiful graphs :)&lt;/p&gt;&#xA;&lt;p&gt;Another feature is &amp;ldquo;Alerts&amp;rdquo;. These can be configured arbitrarily, whether high CPU load, too many errors in the log, or similar should trigger an alarm.&lt;/p&gt;&#xA;&lt;p&gt;This post won&amp;rsquo;t be about the alerts themselves, but rather about sending already configured alerts to Mastodon. These are called &lt;em&gt;Contact Points&lt;/em&gt; in Grafana and initially don&amp;rsquo;t offer Mastodon integration. However, this can be worked around with a few simple steps.&lt;/p&gt;&#xA;&lt;h2 id=&#34;mastodon&#34;&gt;&lt;a href=&#34;#mastodon&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Mastodon&#xA;&lt;/h2&gt;&lt;p&gt;First, we need some preparation, because of course not just any random application can post to Mastodon under our name (thankfully).&lt;/p&gt;&#xA;&lt;p&gt;Therefore, we log into the instance of our choice, select &lt;em&gt;Settings&lt;/em&gt; and then &lt;em&gt;Development&lt;/em&gt;. This should look something like this:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;Screenshot Applications&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;521px&#34; data-flex-grow=&#34;217&#34; data-title-escaped=&#34;Screenshot Applications&#34; height=&#34;922&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://dotnet.work/blog/grafana-notifications-for-mastodon/Screenshot-from-2025-10-14-12-21-45_hu_6d1258580808eff7.png&#34; srcset=&#34;https://dotnet.work/blog/grafana-notifications-for-mastodon/Screenshot-from-2025-10-14-12-21-45_hu_9918453b50955166.png 800w, https://dotnet.work/blog/grafana-notifications-for-mastodon/Screenshot-from-2025-10-14-12-21-45_hu_8244dccb771d446b.png 1600w, https://dotnet.work/blog/grafana-notifications-for-mastodon/Screenshot-from-2025-10-14-12-21-45_hu_6d1258580808eff7.png 2002w&#34; title=&#34;Screenshot Applications&#34; width=&#34;2002&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;(If the list is empty, it means you haven&amp;rsquo;t created any applications yet. If it&amp;rsquo;s not empty, you don&amp;rsquo;t need this part of the tutorial at all, because you&amp;rsquo;ve already done this before 😀)&lt;/p&gt;&#xA;&lt;p&gt;Click on &lt;em&gt;New Application&lt;/em&gt; here and choose a name. Leave the other two text fields as they are:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;Application Detail View&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;480px&#34; data-flex-grow=&#34;200&#34; data-title-escaped=&#34;Application Detail View&#34; height=&#34;1024&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://dotnet.work/blog/grafana-notifications-for-mastodon/Screenshot-from-2025-10-14-12-29-08_hu_8eca63e246ece1fd.png&#34; srcset=&#34;https://dotnet.work/blog/grafana-notifications-for-mastodon/Screenshot-from-2025-10-14-12-29-08_hu_c566f4335b88bed5.png 800w, https://dotnet.work/blog/grafana-notifications-for-mastodon/Screenshot-from-2025-10-14-12-29-08_hu_2067d1ad11c6660d.png 1600w, https://dotnet.work/blog/grafana-notifications-for-mastodon/Screenshot-from-2025-10-14-12-29-08_hu_8eca63e246ece1fd.png 2052w&#34; title=&#34;Application Detail View&#34; width=&#34;2052&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;For permissions, you only need &lt;em&gt;&amp;ldquo;write:statuses&amp;rdquo;&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;You should now see a page showing the secrets. You only need the access token (bottom value) from this.&lt;/p&gt;&#xA;&lt;h2 id=&#34;grafana&#34;&gt;&lt;a href=&#34;#grafana&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Grafana&#xA;&lt;/h2&gt;&lt;p&gt;Now we can switch to Grafana. There&amp;rsquo;s a menu item called &lt;em&gt;Contact points&lt;/em&gt; under &lt;em&gt;Alerting&lt;/em&gt;. At least Email should already appear in the list. We now add a new destination with &lt;em&gt;&amp;quot;+ Create contact point&amp;quot;&lt;/em&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;Screenshot Contact Point&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;535px&#34; data-flex-grow=&#34;223&#34; data-title-escaped=&#34;Screenshot Contact Point&#34; height=&#34;1112&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://dotnet.work/blog/grafana-notifications-for-mastodon/Screenshot-from-2025-10-14-12-35-32_hu_b50144b7f683b82.png&#34; srcset=&#34;https://dotnet.work/blog/grafana-notifications-for-mastodon/Screenshot-from-2025-10-14-12-35-32_hu_34840b37b23bf79e.png 800w, https://dotnet.work/blog/grafana-notifications-for-mastodon/Screenshot-from-2025-10-14-12-35-32_hu_6ceedc02f82f0213.png 1600w, https://dotnet.work/blog/grafana-notifications-for-mastodon/Screenshot-from-2025-10-14-12-35-32_hu_5ea25a905a5f1942.png 2400w, https://dotnet.work/blog/grafana-notifications-for-mastodon/Screenshot-from-2025-10-14-12-35-32_hu_b50144b7f683b82.png 2480w&#34; title=&#34;Screenshot Contact Point&#34; width=&#34;2480&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;The name is of course freely selectable, for integration choose &lt;em&gt;Webhook&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;For the URL, enter the following:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;https://chaos.social/api/v1/statuses?access_token=&amp;lt;Secret&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Instead of &lt;em&gt;&lt;Secret&gt;&lt;/em&gt;, enter the access token from Mastodon. If you now click on &lt;em&gt;Test&lt;/em&gt; (and leave the default values as they are), a new entry will already be created in Mastodon under your name:&#xA;&lt;img alt=&#34;Screenshot Test Notification&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;450px&#34; data-flex-grow=&#34;187&#34; data-title-escaped=&#34;Screenshot Test Notification&#34; height=&#34;352&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://dotnet.work/blog/grafana-notifications-for-mastodon/Screenshot-from-2025-10-14-12-39-18_hu_a2c4001f64561a4c.png&#34; title=&#34;Screenshot Test Notification&#34; width=&#34;660&#34;&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;getting-down-to-business&#34;&gt;&lt;a href=&#34;#getting-down-to-business&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Getting Down to Business&#xA;&lt;/h3&gt;&lt;p&gt;That&amp;rsquo;s nice for starters, but we obviously can&amp;rsquo;t do much with just &amp;ldquo;firing&amp;rdquo;. We want to see the actual error. Also, we probably don&amp;rsquo;t want to inform the whole world. It makes more sense to simply mention ourselves and set the visibility to &amp;ldquo;direct&amp;rdquo;.&lt;/p&gt;&#xA;&lt;p&gt;To do this, we open &lt;em&gt;Optional Webhook Settings&lt;/em&gt;, set &lt;em&gt;HTTP Method&lt;/em&gt; to &lt;em&gt;POST&lt;/em&gt; and click the &amp;ldquo;Edit Payload Template&amp;rdquo; button next to &lt;em&gt;Custom Payload&lt;/em&gt;. A new window pops up and after we&amp;rsquo;ve selected &lt;em&gt;Enter custom payload template&lt;/em&gt; there, we can enter the following content:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;{&#xA;  &amp;#34;status&amp;#34;: &amp;#34;Alert: {{ .CommonLabels.alertname }}\nStatus: {{ .Status }}\n{{ range .Alerts }}{{ .Annotations.summary }}{{ end }}&amp;#34;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now the alert is already a bit more meaningful:&#xA;&lt;img alt=&#34;Screenshot Alert&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;353px&#34; data-flex-grow=&#34;147&#34; data-title-escaped=&#34;Screenshot Alert&#34; height=&#34;448&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://dotnet.work/blog/grafana-notifications-for-mastodon/Screenshot-from-2025-10-14-12-44-36_hu_d60f4511809a5bfc.png&#34; title=&#34;Screenshot Alert&#34; width=&#34;660&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Still missing the private mode. This can be set via &lt;em&gt;Visibility&lt;/em&gt;. Additionally, it&amp;rsquo;s best to mention yourself. (I&amp;rsquo;ve modified my name slightly here so you don&amp;rsquo;t make a copy-paste mistake :) )&lt;/p&gt;&#xA;&lt;p&gt;While we&amp;rsquo;re at it, I&amp;rsquo;ve also used the &lt;em&gt;spoiler-text&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;{&#xA;  &amp;#34;status&amp;#34;: &amp;#34;@guacamoleeeee {{ .CommonAnnotations.summary }}&amp;#34;,&#xA;  &amp;#34;visibility&amp;#34;: &amp;#34;direct&amp;#34;,&#xA;  &amp;#34;sensitive&amp;#34;: false,&#xA;  &amp;#34;spoiler_text&amp;#34;: &amp;#34;🚨 {{ .CommonLabels.alertname }} {{ .Status }}&amp;#34;,&#xA;  &amp;#34;language&amp;#34;: &amp;#34;en&amp;#34;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The result is then as follows:&#xA;&lt;img alt=&#34;Screenshot Alert&#34; class=&#34;gallery-image&#34; data-flex-basis=&#34;254px&#34; data-flex-grow=&#34;106&#34; data-title-escaped=&#34;Screenshot Alert&#34; height=&#34;648&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://dotnet.work/blog/grafana-notifications-for-mastodon/Screenshot-from-2025-10-14-12-52-52_hu_6b769ac31c113ea0.png&#34; title=&#34;Screenshot Alert&#34; width=&#34;688&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;A complete list of Mastodon properties can be found here:&#xA;&lt;a class=&#34;link&#34; href=&#34;https://docs.joinmastodon.org/methods/statuses/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://docs.joinmastodon.org/methods/statuses/&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;have-fun&#34;&gt;&lt;a href=&#34;#have-fun&#34; class=&#34;header-anchor&#34;&gt;&lt;/a&gt;Have Fun&#xA;&lt;/h2&gt;&lt;p&gt;Wishing you many alerts might be a bit strange, but I hope I could help with this.&lt;/p&gt;</description>
        </item></channel>
</rss>
